Skip to content

fix(native): dedupe thread opens and keep local recents - #260

Merged
rynfar merged 1 commit into
nativefrom
nw/228-open-recents
Nov 5, 2026
Merged

rynfar merged 1 commit into
nativefrom
nw/228-open-recents

Conversation

@rynfar

@rynfar rynfar commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Quickly returning to a native thread currently sends another open, and its local recency is lost when the sidebar controller resets. The controller also waits for a usable shell before claiming an open and can accept a delayed callback from an earlier mount of the same thread.

This ports the main-view open path from threadVisits.ts / threadSearch.ts: claim on mount before shell arrival, dedupe opens for ten minutes by the client clock, and retain local recency even when no command is needed. One bounded, app-owned history survives sidebar and connection resets and feeds the existing palette ranking. Saved-entry namespaces bind their first known canonical identity without remounting; a different known server identity invalidates the namespace. Timers are canceled on shell/selection changes and checked against environment, connection, mount, and shell revision before dispatch. Existing highest-seen watermark, sticky unread, throttle, completion/wake handling, and older-row lookup remain intact.

Related to #228. TV-WATERMARK stays partial and #228 stays OPEN. Remaining work: query-bearing palette analytics, side-chat visit subscriptions, and legacy-server capability/local-watermark support. History is process-local and bounded to 4,096 open entries and 4,096 environment bindings; new keys can evict oldest local history. No broader palette, remote/relay/multi-device, performance, or full-frame visual parity claim.

Validation after the last edit:

  • Strict workspace Clippy; cargo test --workspace (1,400 tests); six focused tests with --features snapshot, including an AppState GPUI entity/reset test without an OS window.
  • Theme, 42 parity tests, and conformance generation check from packages/client-runtime.
  • Normal and explicit snapshot builds in the existing private DevSSD target; both binaries hashed. No normal app bundle was built or launched.
  • check:changed against the supplied base is RED on the inherited ledger formatting. The baseline ledger fails the same check. Rustfmt actually checked all four changed Rust files; the inherited app-file formatting remains RED on both baseline and final sources. Owned new blocks and the core file were formatted without rewriting unrelated app code. The staged autoformatter hook is skipped for the commit because it would reformat unrelated ledger rows; the explicit checks above are retained. No repo-wide fallback command was used. The initial default check:changed comparison included pre-existing native history; its full output and interrupt attempt are preserved.

Behavioral evidence is pre-RPC: the original controller extraction compiled and failed on missing pre-shell mount and duplicate reopen; restored old timer and palette projections compiled and failed on stale dispatch and recent ordering. Tests now exercise before/at ten minutes, skipped-open recency, unknown/known identities, environment separation/replacement, A→B→A/reconnect, sticky unread after older shells, stale timer guards, and reset lifetime. Intermediate malformed-fixture and missing-GPUI-theme failures are retained, not treated as bug reproduction.

Immutable per-round source copies/manifests, patches, argv/cwd/start/end/exit records, raw logs, binary hashes, and published Git binding are under /private/tmp/native-factory-2f5f764a/228open-evidence/. Build receipts identify the actual base HEAD at build time and the working source hashes; the later commit is verified against those bytes, not described as having existed during compilation.

No live visit/mark-unread/refresh, provider turn, settings/auth change, new server, real window, computer use, or browser automation was used as proof. No screenshot is presented as a reproduction: the existing bounded snapshot hooks do not expose this switching/history scenario without selecting real threads, and no new production fixture hook was added. Known #202 remains outside this slice; no visual repair is claimed.

Built with GPT-6.1 Sol in Codex

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