Skip to content

add: pager help overlay and incremental search - #11

Merged
halkn merged 10 commits into
mainfrom
feat/pager-help-and-search
Aug 13, 2026
Merged

halkn merged 10 commits into
mainfrom
feat/pager-help-and-search

Conversation

@halkn

@halkn halkn commented Aug 13, 2026

Copy link
Copy Markdown
Owner

変更理由

競合の pager(moar/moor、glow、less、frogmouth、DocSail)の実装を読み、mdvu の pager と比較して埋められる差を実装した。

  • アプリ内にキー一覧が無い(glow ? / moar h / less h は全て持つ)
  • 検索が Enter まで無反応(moar は find-as-you-type)
  • 検索プロンプトの編集が Backspace のみ(DocSail は readline 相当)
  • 一致の現在位置が status bar に出ず、現在の一致とそれ以外が同じ強調で区別できない
  • 常に case-insensitive

マウス・$EDITOR 起動・OSC 52 コピーは、.claude/rules/runtime.md と CLAUDE.md の決定(マウスキャプチャを有効にしない / サブプロセスを起こさない)を維持するため入れていない。

変更内容

  • ? でキー一覧 overlay。 表は src/pager/help.rs が正で、README のキー表はそれに追従する。低い端末では j / k でリスト末尾まで到達できる
  • インクリメンタル検索。 打鍵ごとに / を押した位置から検索し直し、Esc で viewport と確定済み検索の両方を戻す。プレビューの一致集合は確定済みと別に持つ
  • プロンプトの readline 編集。 caret と Ctrl-a/e/b/f/w/u/k/d・矢印・Home/End。グラフェム境界で動く
  • status bar に (3/12)。 入力中も確定後も同じ右端に出る。n / N が端で折り返したら wrapped
  • 現在の一致だけマゼンタ反転(StyleRole::CurrentMatch)。他の一致は従来どおり素の反転
  • smart case。 クエリが全て小文字なら case-insensitive、大文字を含めば case-sensitive

影響範囲

src/pager/ に閉じている。追加は StyleRole::CurrentMatch(src/layout/mod.rs / theme.rs)のみで、layout 以前の段と stdout backend の出力は変わらない(golden snapshot 無変更)。判断基準は .claude/rules/runtime.md に追記した。

確認手順

```console
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
```

  • unit 320 / cli 24 / render 53 通過。pager::watch の 2 件のみ手元の sandbox で失敗するが、これは FSEvents が届かない環境制約(.claude/rules/runtime.md に記録済み、CI で検証される)
  • clippy 警告なし
  • pager の対話動作そのものは手元で実機確認できていない。状態遷移は state.rs / event.rs の unit test、描画は ratatui の TestBackend による 1 フレーム検証で固めている

@halkn
halkn merged commit 0fb34b0 into main Aug 13, 2026
4 checks passed
@halkn
halkn deleted the feat/pager-help-and-search branch August 13, 2026 22:01
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