feat(ui): add a configurable statusline with connection metrics - #18
Merged
Merged
Conversation
Run dialog, history, send, link, button and read requests in a bounded JoinSet while one coordinator owns worker state. Preserve the in-flight update future across command and completion branches, and abort child tasks when their owner exits. Protect history and dialog snapshots against newer live changes. Start the update stream before the initial dialog request and stop truncating catch-up payloads. Validation: cargo fmt --all -- --check; cargo clippy --locked --all-targets --all-features -- -D warnings; cargo test --locked --all-targets --all-features (151 tests). Live Telegram latency has not been measured.
Follow Telegram startup recovery guidance: begin with the common difference and let channel gap notifications request targeted recovery. Preserve a known local channel PTS when updateChannelTooLong carries a newer remote PTS. Patch grammers-session 0.10.0 at upstream 5c6d44ff30e02d6c9295bcf1fcb51403ad77c981. Keep the original recovery engine and upstream tests; adjust the connection-flow assertion. Validation: fmt, strict all-targets clippy, and all-feature tests (153 tests), including a 500-channel startup and local-cursor gap regression.
Keep account-local messages, dialogs, attachment locations and complete update checkpoints in SQLite. Serve cached histories while the network worker connects and reconcile history snapshots without undoing newer edits or deletions. Clear cache content when the authenticated account changes or Telegram invalidates an old message range. Use libSQL already present in the dependency graph and retain rollback journaling. Vendor grammers-client 0.10.0 at 5c6d44ff30e02d6c9295bcf1fcb51403ad77c981 to expose whole update batches, restore application-owned cursors and report too-long differences. Preserve original licenses and record adaptations in vendor/README.md. Validation: formatting, strict Clippy and all-target/all-feature tests (156 tests), including restart, rollback, account isolation, complete-batch delivery and offline application navigation.
Keep startup commands bounded until authentication completes, clear stale account state and queued operations on identity changes, and consistently settle failed requests. Persist the initial update checkpoint even when a session receives no live messages. Drive active group recovery through a watch channel and the existing Grammers message-box engine. Respect the server timeout, stop short polling on focus changes, and never advance a known cursor when activating a group. Validation: strict Clippy, formatting, 157 application/integration tests and all 20 upstream grammers-session library tests. No logged-in latency benchmark was performed.
Reuse Yazi key parsing with declarative mlua configuration, message counts, chords, stable chat aliases and effective-binding help. Fetch older history pages on demand and cache only explicitly complete page boundaries. Derive configurable composer ghost text from the active bindings and remove repeated composer labels. Include bilingual configuration documentation. Validation: formatting, strict all-target/all-feature Clippy, 157 tests. BREAKING CHANGE: j/k navigate messages; use arrows for rendered rows. Use gg/Home for the oldest loaded message and G/End for the latest page.
Cache folder rules and order per account, retain pinned ordering, and navigate folders without losing conversation drafts. Refresh metadata after remote changes and apply incoming unread counts. Reuse Grammers raw API methods and follow Telegram Desktop membership precedence. Validation: formatting, strict Clippy, and 159 tests.
Add scoped local search, cancellable bounded background scans, result pagination, cache coverage and validated cached context. Preserve queries, drafts and unread state during historical navigation. Document the controls in English and Simplified Chinese. Validation: formatting, strict Clippy, and 161 tests.
Add a named ANSI color picker, terminal-default chat foreground and stable folder colors. Keep Lua defaults and managed per-account overrides separate, and reuse the atomic settings writer. Preserve preferences across cache resets and document precedence in both languages. Validation: formatting, strict Clippy, and 163 tests.
Bind O to reveal originals, reusing full previews or downloading before reveal. Track media IDs and request generations so edits and deletes reject stale transfers. Reuse tempfile for partial-file cleanup and preserve account cache ownership through background tasks. Bound completed media and cache metadata retention. Document platform behavior, cache paths and the O to g o binding migration in English and Simplified Chinese. Validation: formatting, strict Clippy, and 167 tests.
Track the actual last-message ID instead of deriving previews from a bounded history window. Clear deleted previews, refresh authoritative dialog state, and preserve intervening changes across slower snapshots. Seed startup watermarks and count cached incoming messages only once. Validation: formatting, strict Clippy, and 169 tests.
Support fixed Lua navigation counts and restore QR login key routing. Derive controls from effective bindings, preserve composer state when toggling overlays, and keep primary search controls visible on narrow terminals. Validation: formatting, strict all-target Clippy, and all-target/all-feature tests (172 passed).
Move detailed setup, configuration, keybindings, workflows, terminal behavior, releases, and architecture into matching English and Simplified Chinese Wiki sources. Add a small flat-page exporter and CI link/parity validation. Validation: 27 source pages, 28 exported pages, internal links and all 48 actions checked in both languages. No runtime code changes.
Keep main, archive, and custom-folder pin orders independent, persist server pins, and add native pin/reorder and archive/restore actions. Preserve chat selection and resolve aliases through the correct folder. Apply custom-filter edits to fresh server objects and preserve explicit membership when unpinning, following Telegram Desktop 4d4da471fbee771c10e173a83c003ba1728989f1 data/data_chat_filters.cpp. Archived chats live in Archive and are excluded from All chats. Validation: 174 tests pass, strict Clippy, cargo fmt, Wiki language/link validation and git diff --check. Live Telegram mutations were not exercised.
Add cached pinned-message pages, a compact conversation banner, and navigation to pinned context without marking unseen history read. Keep private-chat and group pin options explicit, support unpin/all, and coalesce background refreshes alongside live updates. Preserve live unpins, edits and deletions across stale requests, keep account/cache retention boundaries, and document contextual Lua actions in English and Simplified Chinese. Follow Telegram Desktop 4d4da471fbee771c10e173a83c003ba1728989f1 pin-message dialog behavior. Validation: 178 tests, strict Clippy, formatting and 29-page bilingual Wiki validation passed; cache regressions passed again after retention integration. Live account mutations were not exercised.
Discard pin-page and context revisions when Telegram invalidates cached history. Clear stale previews and confirmations, reload open pin lists, and invalidate worker metadata refreshes before recovery starts. Keep drafts, unrelated chats and in-flight mutations intact. Validate with 180 tests, including channel/global invalidation and stale read results, strict Clippy, formatting and bilingual Wiki checks.
Add an opt-in glyph adapter for chats, folders, pins and attachments. Keep semantic labels and default plain-font output, and reuse existing Unicode cell layout. Document terminal font selection in both languages. Validate with 181 tests, strict Clippy, formatting and Wiki parity/link checks. No font assets or additional dependencies are included.
Document one Cargo Git command for Linux, macOS and Windows, including pinned toolchains, native build prerequisites, install roots and updates. Make vendored Lua explicit and report commit-height versions for Git builds. Install and package each CI release through Cargo from a clean Git revision, exercising repository patches, locked dependencies and installation tracking on all six native platforms. Retain release version and credential overrides. Validate with 181 tests, strict Clippy, formatting and bilingual Wiki checks.
A Git install using the workspace target directory reused an older release build-script executable. Keep installation artifacts in target/cargo-install so cached workspace metadata cannot enter the Git installation pipeline. Validate workflow syntax and bilingual documentation.
Cargo creates an untracked .cargo-ok marker in fetched Git checkouts. Ignore that generated marker so an unmodified source installation is not labeled dirty, and document that the checkout branch can differ from the requested Git branch.
Windows ARM64 fails the multi-process session check before native Cargo installation, but the existing assertion discards subprocess output and exit status. Capture both output streams and report every failed writer after reaping all children so platform failures are actionable. Validation: the session concurrency integration test, targeted strict Clippy, formatting and diff whitespace checks pass on macOS arm64.
Native Windows ARM64 installation validation exposed a session writer access violation (0xc0000005). libSQL 0.9.30 closes its local SQLite handle twice through nested destructors, matching upstream issue #2251. Vendor the published Rust crate and backport upstream PR #2282 at 0070ff3331cd6d09425b812e1cd3ebe32e1d4206, including its focused ownership regression. Preserve licenses, source formatting and dependency versions. The PR Git revision would otherwise require the unrelated 0.10.0-pre.4 database engine upgrade. Document removal once a stable release contains the fix. Validation: 181 application tests and the upstream close-once regression pass on macOS arm64; strict application Clippy, formatting, actionlint and Wiki checks pass. CI now runs the upstream regression in addition to native multi-process session checks. Original vendored whitespace is retained.
Register composer hit regions, restore the last usable chat per Telegram account, and leave input mode when mouse focus moves. Preserve drafts and existing reply targets. Reuse the asynchronous media renderer for expanded previews. Keep effective preview/reply/close hints and prevent deleted preview targets from redirecting replies. Document the interaction changes in both Wiki languages. Validation: 185 tests, strict all-target Clippy, formatting and Wiki parity/link checks passed. BREAKING CHANGE: o previews media; g n and g p cycle message actions. i replies to an explicit conversation selection; Escape clears selection before leaving the conversation.
Move application, account and connection state to an ordered Lua statusline. Preserve mode and contextual actions in narrow windows, and keep long errors readable above the bar. Observe the primary DC and optional Ping on the existing Grammers client. Use a five-second display deadline while retaining at most one in-flight probe; terminate observations with the worker. Invalidate latency on disconnect, expiry and account changes. Document both languages and the example configuration. Validation: 187 tests, strict all-target Clippy, formatting and Wiki parity/link checks passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The application/account/connection header moves to a one-row bottom statusline. Lua selects and orders mode, application, account, contextual actions, connection, Ping, primary DC and reading-position items. Narrow windows remove optional items before mode/current-action hints; long errors remain readable above the bar.
Optional Ping measurements use the existing Grammers client in a worker-owned task, at most once per 60 seconds with a five-second display deadline. A timed-out probe remains the only in-flight observation until it finishes, avoiding queued requests during outages. Removing the latency item or disabling the bar disables these extra requests. Measurements include SDK scheduling/retries, are invalidated on disconnect or account changes, and are never presented as message-delivery latency. No drawing path performs network operations and the update stream still has one consumer.
English/Simplified Chinese Wiki pages and the example Lua configuration cover components, diagnostic semantics and layout priorities. The design follows Yazi’s ordered status components and Codex’s finite items; no upstream code is copied.
Validation: 187 tests, strict all-target Clippy, formatting, and Wiki parity/link checks passed. Regressions exercise reordered/disabled/narrow bars, persistent errors, and rejection of observations from before reconnect/account switches. Real-account latency and terminal-theme appearance are not benchmarked by these tests.
Stacked on #17 (
fix/compose-selection).Native CI also passed on all six Linux/macOS/Windows architecture targets, including Cargo Git installation and packaging: https://github.com/iebb/termgram/actions/runs/35478807284.