Repository navigation
feat(term): implement scrollback search and selection persistence (CTX-0060) - #95
Merged
Merged
Conversation
…X-0060) Implements bounded scrollback search in bitty-term-state (SEARCH_MAX_PATTERN_LEN 256, SEARCH_MAX_RESULTS 1000, case-sensitive/insensitive headless deterministic search over scrollback + live grid) and buffer-anchored PersistentSelection in bitty-ui (BufferPos, PersistentSelection with line_id-anchored validity, scroll/resize/prune resilience, View-aware conversion) wired through Runtime search/persistent_selection APIs. Fixes review S-1 stale buffer_row after pruning (is_valid exact id check, text id-located, line_id None handling), S-2 dead column check, S-3 duplicate branch collapse, S-4 clamped only clamps (snap deferred), S-5 after_full_reset doc. Adds integration test crates/bitty-runtime/tests/scrollback_search_selection_persistence.rs (9 headless tests) and unit coverage in search.rs; gates: cargo check --workspace --all-targets PASS, cargo clippy -D warnings PASS, cargo test --workspace --all-targets PASS, just check 28 files 0 issues. Refs: CTX-0060
Xuepoo
force-pushed
the
ctx-0060/feat-scrollback-search
branch
from
August 28, 2026 13:18
1d7866f to
fab7938
Compare
This was referenced Oct 19, 2026
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.
Implements scrollback search and selection persistence (CTX-0060).
Summary
bitty-term-state/src/search.rs: bounded headless deterministic search over scrollback + live grid (SEARCH_MAX_PATTERN_LEN256,SEARCH_MAX_RESULTS1000, ASCII case-insensitive option, bounded heap, pureState -> Vec<SearchMatch>).bitty-ui/src/selection.rs:BufferPos+PersistentSelectionbuffer-anchored selection persisting across scroll/resize/pruning,line_id-anchored validity (is_validexact id check),View-aware conversion (from_view_selection/to_view_selection/clamped), deferred snap semantics.bitty-runtime/src/runtime.rs:Runtime::search/search_case_sensitive/persistent_selection/restore_persistent_selection/persistent_selection_text/is_persistent_selection_validheadless wiring.Review fixes S-1..S-5 (ses_fb793f416 PASS)
buffer_rowafter pruning:is_validnow validatesscrollback_line(buffer_row).id == stored_idforline_id Some;textlocates via id search and invalidates shift;line_id Noneremains valid for scrolled history (grid->scrollback).width>0 && col>=width).runtime restore_persistent_selectionand simplifiedis_validelse-if.clampednow only clamps column, snap deferred to resolution (deterministic).after_full_resetdoc corrected to always returnsNone.Tests & gates
crates/bitty-runtime/tests/scrollback_search_selection_persistence.rs: 9 headless tests covering search, persistence across scroll, pruning invalidation, view offset, resize clamp.cargo check --workspace --all-targetsPASScargo clippy --workspace --all-targets -- -D warningsPASScargo test --workspace --all-targetsPASS (61+39+48+… +9 new)just check28 files 0 issues (fmt/clippy/test/actionlint/markdownlint)Fixes #94
Refs: CTX-0060
CarryCtx: CTX-0060