Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ range may break in any release.

### Added

- **Scrolling detail pane.** The detail pane now scrolls to keep the focused
field visible — the granular identity view is ~18 fields and could overflow a
shorter terminal. Reuses the form's `scroll_offset`; only the detail-focused
view scrolls (browsing is unchanged).

- **Granular identity field selectors.** 16 new `--field` selectors expose every
identity field individually — `identity-{title,first-name,middle-name,
last-name,username,company,ssn,passport,license,address1,address2,address3,
Expand Down
11 changes: 11 additions & 0 deletions crates/vault-tui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,19 @@ fn render_detail(frame: &mut Frame, app: &App, area: Rect) {
lines
},
);
// Scroll to keep the focused field visible (the identity detail can be
// taller than the pane). The body is [Name, Type, <fields…>, Folder, Id,
// "", hint], so the cursor field's line is `2 + detail_field`. Only the
// detail-focused path scrolls; every other state keeps offset 0.
let focused_line = if app.detail_focused() {
2 + app.detail_field
} else {
0
};
let offset = scroll_offset(focused_line, (area.height.saturating_sub(2)) as usize);
let para = Paragraph::new(lines)
.block(pane_block("Detail", app.detail_focused()))
.scroll((u16::try_from(offset).unwrap_or(u16::MAX), 0))
.wrap(Wrap { trim: true });
frame.render_widget(para, area);
}
Expand Down
Loading