Skip to content

feat(qt): add bounded literal Find to main screen and history - #325

Merged
JavaZeroo merged 8 commits into
mainfrom
agent/qt-find/record-hidden-retention-2e7373117ea0
Nov 6, 2026
Merged

JavaZeroo merged 8 commits into
mainfrom
agent/qt-find/record-hidden-retention-2e7373117ea0

Conversation

@JavaZeroo-Bot

@JavaZeroo-Bot JavaZeroo-Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

背景

#29 主线已有 TextSearch、TextDocument、HistoryViewport、ViewMapping 和历史/源选择。本切片把既定的有界字面量 Find 接入正式 Qt 正常主屏与历史显示页,不新增搜索语义,不依赖粘贴 #324。

内容

  • Ctrl+Shift+F 打开当前会话 Find 面板;查询框取得焦点,Previous/Next/Close 按钮、Match case 开关和状态文本。
  • 查询上限沿用 4096 UTF-8 字节、结果上限 1024;字面量、无规范化、ASCII case folding;循环/截断/持续扫描提示沿用既有 TextSearch 状态。
  • 搜索按 TextSearch::step 的 4096 单位预算在计时器切片中推进,不一次扫描整个文档;输出变化通过 notify_change 失效并重扫。
  • 命中保存为源 TextPosition,通过 HistoryViewport::reveal 定位历史/当前页,当前 ViewMapping 投影高亮;不保存显示行号。
  • Escape 关闭面板并把焦点还给终端;复制仍走已合入的源选择/系统 Copy 合同。

验证

  • 新增 qt_find:Ctrl+Shift+F 实际按键、查询焦点、确定性 child 的 SEL_SOFT_ 源命中、历史 reveal、高亮投影、Previous/Next、无命中、Escape 焦点恢复、4096 查询上限。
  • 本地 Qt 正式路径 10/10(含 qt_find 1/1),未触个人剪贴板/桌面。
  • 已补多个命中顺序/双向循环、精确源文本/列/显示宽度、历史/当前页 reveal、缩窄扩大同源迁移、淘汰不复活、旧 epoch 失效、双会话查询/输入隔离、查询零泄漏、Escape 后输入恰好一次、空查询/Match case/Return/F3/Shift+F3、4096 字节 ASCII+中文+NFD 明确拒绝;见 README 的缺口→证据表。当前已补真实 child 的1040个命中→1024项截断、明确提示与有限循环,以及扫描中局部命中导航不越界;ASCII真实键盘、中文/NFD的Qt输入法提交事件验证查询字节边界,详见当前head证据。

边界

Add Ctrl+Shift+F, a current-session Find panel with query focus, Previous/Next/
Close buttons, a Match case toggle and status text. Reuse TextSearch's bounded
literal policy (4096 UTF-8 byte query, 1024-result cap, ASCII case folding,
existing loop/truncation statuses) in incremental timer slices. Hits stay
source-positioned; navigation reveals the source row through HistoryViewport
and highlights via the current ViewMapping, so display row numbers are never
stored. Escape closes the panel and restores terminal focus.

Add a formal Qt regression with the deterministic selection fixture: public
shortcut/query, history reveal, source hit and painted spans, Previous/Next,
no-match status, Escape focus restoration and query limit. No system clipboard,
paste, BCD/VM or new search semantics are changed.
Add the Find implementation/verification record, source and test identity, the
captured offscreen panel image, and converge FEATURES/EVIDENCE on the bounded
capability. Keep selection, TUI/alternate-screen Find, physical presentation,
DPI and performance outside the claim.
Add multiple-match source/order/wrap assertions with exact painted width,
history and current-page reveal, narrow/wide source migration, eviction
non-resurrection, epoch invalidation, two real sessions with independent input
recording, zero query leakage and post-Escape input targeting. Exercise empty
query, actual Match case, 4097-byte/Chinese/NFD over-limit rejection without
silent truncation, and Return/F3/Shift+F3.

Make the query field stop silently truncating at 4096 units; TextSearch now
rejects the exact UTF-8 byte limit with an explicit status. Add F3/Shift+F3 to
the existing Next/Previous contract. The test-only selection child can record
received input bytes; no product clipboard/desktop is touched.
Use the formal query entry for ASCII keyboard and Qt input-method commit text:
legal 4096-byte and >4096 Chinese/NFD inputs preserve the full text and show
the explicit limit without silent truncation, with zero child-input leakage.

Add a third real child with bounded deterministic output: repeated short
literals exceed 1024 non-overlapping hits, exercising the Qt capped notice and
finite first/last wrap; a >4096-byte scan keeps an observable Searching stage
with partial hits, and public navigation stays inside the scanned prefix
instead of wrapping into unscanned output. Pacing is a test-only timer setting;
product budgets and caps are unchanged.
@JavaZeroo
JavaZeroo merged commit ce2bbba into main Nov 6, 2026
10 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.

2 participants