feat(vault-tui): scroll the detail pane to keep the field cursor visible#37
Merged
Conversation
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>
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.
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_detailcomputes the focused line (2 + app.detail_field, since the body is[Name, Type, <fields…>, Folder, Id, "", hint]) when the detail pane is focused, and appliesParagraph::scroll((scroll_offset(focused_line, inner_height), 0))— reusing the pure, unit-testedscroll_offsetfrom 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_offsetalready has unit coverage; the existingrender_detailUI tests (offset-0 path) stay green.fmt --check, fresh-isolatedclippy --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 →
Tabinto the detail pane →jpast the bottom → the pane scrolls to keep the cursor field in view.🤖 Generated with Claude Code