feat(history): add full-history search, cleanup and global timeline navigation - #723
Open
pascalandr wants to merge 9 commits into
Open
pascalandr wants to merge 9 commits into
pascalandr wants to merge 9 commits into
Conversation
…h native RPC Replace transcript-wide API downloads with bounded plugin-side history scans. The search window now offers session/workspace scope, message and technical-content snapshots, paginated excerpts and explicit single-message previews that do not populate or displace the resident transcript window. Plan whole-session technical cleanup using compact IDs, revisions and counts, then execute batches through the existing synchronous SQLite ownership and durable execution-claim fences. Preserve text and pre-compaction history semantics, refuse changed or active content, retain atomic retry receipts, and expose progress, cancellation and partial failures. Bind reads to the authenticated daemon storage, constrain cursors and payload sizes, and validate every contributing location against local worktree ownership before publishing workspace counts or excerpts. Keep native RPC access narrow, preserve migrated global history, add translations for all locales, and retain search-input focus with the new controls. Validation: 56 server/plugin/route tests, 45 UI store tests, 43 transcript browser regressions and 8 search/utility-window browser tests passed. Server/UI typechecks, the UI build and bundled plugin build passed. The isolated Windows OpenCode 2.0.5 fixture verified 241-message counts/search/cleanup, exact batch retries, active-claim refusal, pre-compaction discovery and existing concurrency/cache behavior. Desktop release interaction and other native platforms remain separate validation.
Extend the existing history-query plugin with bounded outline and anchor-window reads so timeline and current-session search can reach distant passages without loading intervening transcript pages. Share daemon-storage identity binding, preserve location/project/revert authorization, enforce payload budgets and retain overlapping neighbors for reading-position restoration. Route timeline, search and missing restoration anchors through the existing message-load authority fences. Keep the visible transcript during navigation, let the latest requested destination win, reject late results after cancellation or leaving the session, and retain historical reading positions during live generation. Restore a discreet timeline scrollbar with stable reserved geometry. Only marker rectangles narrow; icon dimensions and vertical spacing remain fixed across hover, focus, RTL and fractional zoom. Include localized loading/retry UI and document the navigation contract. Validated with server/plugin/route regressions, 75 UI store tests, 56 distinct Chromium cases, server/UI typechecks, UI/plugin builds and an isolated Windows OpenCode 2.0.5 fixture comparing 1501-message navigation against native export and message reads. Installed desktop and other-platform validation remain separate.
Contributor
Author
|
Additional isolated target-runtime qualification: published head 5b988ec passes scripts/test-session-pruning-native.mjs with the official Windows x64 OpenCode 2.0.11 CLI and unchanged client/plugin 2.0.4. Includes 241-message counts/search/complete technical cleanup and batch receipts; 1501-message outline/distant windows/overlap/native payload and restore parity; surrounding proxy, worktree, event-relay, plugin lifecycle and pruning concurrency/history checks. Synthetic fixture DB only, no shared daemon or user storage. #728 records the evidence and upgrades client/plugin separately; the combined merge will still need its own native rerun. |
Update two source-level regression assertions left over from exhaustive resident-transcript search. The current implementation guards its local locator directly and publishes a bounded native-query result page with an atomic active-index reset. Retain the synchronous raw-query invalidation and batched-publication invariants. All 23 pagination tests pass; direct search click and keyboard navigation are additionally covered by the Chromium history-navigation fixture. This changes tests only and leaves the rebuilt desktop artifacts unchanged.
Cancel deferred active-marker reveals when the reader scrolls or interacts with the global rail, and reveal without a smooth animation. A previous selection must not move or unmount the next click target while its distant window is still loading. Extend the Chromium latest-intent regression to keep the next destination visible beyond the reveal delay. Update the isolated native pruning UI fixture to proxy history routes and provide the same service-location inventory used by whole-session cleanup. Validated all five browser navigation cases, the UI typecheck, packaged-resource smoke checks, and the complete isolated OpenCode 2.0.5 native/UI pruning fixture, including whole-session confirmation and persistence after reload.
Keep unchanged outline projections referentially stable within each message section. Virtua keys its rows by item identity, so rebuilding historical marker objects on resident updates remounted distant hover, focus and automation targets during generation. Bound the projection cache to the current outline and compare all generated presentation fields, including tool-part identities, so changed content and locale labels still update normally. Add a real-component Chromium regression proving that a new resident streamed message retains a distant marker's DOM node, and verify historical-window streaming too. The new test fails without identity reuse and passes with it; all six history-navigation tests and the UI typecheck pass.
Replace estimated timeline row measurements with an exact virtual layout derived from the marker and group-gap primitives. Hidden tools no longer contribute estimated heights, and the rail uses the same standard native scrollbar as the transcript: only marker width changes, never icons or vertical spacing. Manual rail browsing suppresses active-marker reveals until a transcript gesture, and intermediate window positions cannot reclaim it. Keep native transcript thumb drags escaped beyond the ordinary gesture timeout, delay adjacent-window paging until release, and recognize wheel gestures at an already-clamped boundary. Publish follow state before handing boundary callbacks control. Preserve access to first/latest commands at local window edges and default history search to excluding tools and reasoning. Exercise the real SessionView with mixed long replies, short replies, tools and idle records. Browser regressions verify exact scroll extent, native held-thumb dragging, streaming anchors, distant landing positions, adjacent windows, global endpoints, keyboard ownership, RTL and fractional zoom. The held-thumb regression is red with native drag ownership disabled and green with it; transcript rendering and nested-scroll regressions and UI typecheck pass.
The installed Windows application returned only four metadata entries from a 10,763-message session because the outline's wall-time budget included cooperative event-loop waits. Remove scheduler time from pagination and bound each page by 256 rows and 24 MiB of parsed source payloads instead. Yield every 16 rows in both outline and message-window reads, preserving cancellation without paying one scheduler round trip per message. Regression coverage advances the clock across each observation, checks full metadata pages, verifies cancellation releases the read transaction, and proves byte-budget pagination retains the first unread message. Strengthen the isolated native fixture to require full small-record pages. Seven navigation/store/route checks and the server typecheck pass.
Keep four recent metadata-only outline snapshots across SessionView unmounts. A hidden or evicted view cancels its active request but retains accepted pages and the sequence-horizon cursor. Returning immediately reuses a completed rail, or resumes its interrupted scan, instead of repeatedly showing only the resident transcript while scanning from zero. Fence cached metadata by instance/session, connection generation, destructive content revision and staged undo. Message revisions and status transitions refresh completed snapshots without clearing their display; status churn cannot discard an incomplete scan. Show localized initial loading progress so a partial resident timeline is not silently presented as complete. A real SessionView browser regression pauses the second outline page, changes status, unmounts and returns, then checks cursor reuse and immediate completed-rail restoration. All 14 navigation/browser cases and the UI typecheck pass.
Historical markers rendered a bare paragraph outside the rich MessagePreview surface, leaving its text unbounded and transparent across the application. Use the same small plain-text tooltip for historical and resident markers, with wrapping, an opaque surface, viewport-constrained width and height, and clamped placement on either side of the rail. Hover no longer mounts a message renderer or reads resident message data. Cancel delayed previews on scrolling and detached markers, dismiss on resize or Escape, and support keyboard focus with tooltip descriptions. A real SessionView regression covers both historical and resident previews, geometry, opaque styling and absence of payload loads; keyboard and native rail-thumb regressions and the UI typecheck pass.
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.
Summary
Combine full-history search/counts and technical cleanup with a global timeline and direct message-window navigation through the existing bundled native pruning plugin.
Implementation and boundaries
history,pruneBatch,outlineandwindowoperations. Generic RPC proxy access remains closed.User-visible semantics
Validation
Native fixtures use synthetic isolated DB/config and child daemons. WSL, Linux and macOS are not covered by these Windows checks.
Installed Windows Tauri build: 0.20.0-dev-20260920-c5d9aa40, executable/UI hashes verified. On the real long conversation, a native held-thumb gesture landed at 49.54% with the transcript anchor and pixel offset unchanged. A session-away/return cycle retained 13,815 markers, scroll extent, rail offset and transcript anchor exactly; no history HTTP errors were observed during the subsequent 45-second capture. An earlier intermittent refresh HTTP 500 was observed; the retained completed rail remained usable. User acceptance and final gatekeeper review remain pending.
Documentation and maintenance
See
dev-docs/SESSION_HISTORY_QUERIES.md,dev-docs/SESSION_HISTORY_NAVIGATION.mdand the updated agent conventions.Existing oversized files touched, under
packages/ui/src/:components/message-section.tsx(~1,525 lines),components/message-timeline.tsx(~654),components/session/session-view.tsx(~694),lib/api-client.ts(~584),stores/opencode-data.ts(~691),stores/session-api.ts(~1,846),stores/session-request-authority.test.ts(~2,029), plus the original history changes inlib/hooks/use-commands.ts(~635) andstores/session-actions.ts(~680). New concerns are isolated in focused modules.