Skip to content

fix(input)!: restore composition and select media before opening - #17

Merged
mizorewww merged 24 commits into
mainfrom
fix/compose-selection
Sep 20, 2026
Merged

mizorewww merged 24 commits into
mainfrom
fix/compose-selection

Conversation

@mizorewww

@mizorewww mizorewww commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Clicking the visible composer now enters input, and i restores the current account’s last usable chat when none is open. Clicking a chat or message leaves input mode without losing its draft. Last-chat preferences persist by Telegram account ID.

Media clicks select without activating downloads or external applications. o opens an expanded preview using the existing asynchronous media renderer; i replies to the selected message. Preview errors retain an effective retry/close shortcut, and a deleted preview target cannot redirect a reply to another message. Composer clicks preserve an existing reply draft.

Default-key migration: o now previews media; g n / g p move between message actions. i replies only to an explicit conversation selection; Escape clears that selection first. English and Simplified Chinese Wiki sources describe the new behavior and Lua bindings.

Validation: 185 tests passed, strict Clippy for all targets passed, formatting and Wiki parity/link checks passed. Focused tests cover Unicode composer input, account-isolated restoration across restart, mouse selection, preview/reply/deletion, and small-window preview controls. No authenticated message was sent during validation.

Stacked on #16 (feat/cargo-install).

Native CI also passed on Linux x64/ARM64, macOS Intel/ARM64 and Windows x64/ARM64, including Cargo Git installation and packaging: https://github.com/iebb/termgram/actions/runs/35478283600.

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.
@mizorewww
mizorewww changed the base branch from feat/cargo-install to main September 20, 2026 12:43
@mizorewww
mizorewww merged commit 4bf0a7c into main Sep 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant