Skip to content

feat(vault-tui): scroll the detail pane to keep the field cursor visible#37

Merged
UnbreakableMJ merged 1 commit into
mainfrom
detail-pane-scroll
Jun 16, 2026
Merged

feat(vault-tui): scroll the detail pane to keep the field cursor visible#37
UnbreakableMJ merged 1 commit into
mainfrom
detail-pane-scroll

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

What

The granular-identity slice (PR #36) grew the identity detail to ~18 fields, which can overflow the detail pane (a single non-scrolling Paragraph) on a normal-height terminal — pushing the lower fields and the per-field cursor off-screen. This adds a scroll offset to the detail pane keyed to the cursor field. Last tracked code follow-up.

How

render_detail computes the focused line (2 + app.detail_field, since the body is [Name, Type, <fields…>, Folder, Id, "", hint]) when the detail pane is focused, and applies Paragraph::scroll((scroll_offset(focused_line, inner_height), 0)) — reusing the pure, unit-tested scroll_offset from the add/edit form. When the pane isn't focused the offset is 0, so browsing and every other render are unchanged.

Tests / Verification

scroll_offset already has unit coverage; the existing render_detail UI tests (offset-0 path) stay green. fmt --check, fresh-isolated clippy --all-features -D warnings, cargo test --workspace --all-targets, cargo deny check, both headless builds — all green.

Manual: on a short terminal, select an identity → Tab into the detail pane → j past the bottom → the pane scrolls to keep the cursor field in view.

🤖 Generated with Claude Code

The granular identity detail is ~18 fields and could overflow the detail
pane (a single non-scrolling Paragraph), pushing the lower fields and the
per-field cursor off-screen. render_detail now applies a scroll offset
keyed to the cursor field (`2 + detail_field`, the body's header being
Name+Type), reusing the form's pure `scroll_offset`. Only the
detail-focused view scrolls; browsing/other panes are unchanged (offset 0).

- docs: CHANGELOG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@UnbreakableMJ UnbreakableMJ merged commit d16ab12 into main Jun 16, 2026
8 checks passed
@UnbreakableMJ UnbreakableMJ deleted the detail-pane-scroll branch June 16, 2026 14:12
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