Skip to content

Add hide/show details toggle to NotePanel metadata#897

Merged
multiplex55 merged 3 commits intomasterfrom
codex/add-metadata-toggle-to-notepanel
Feb 19, 2026
Merged

Add hide/show details toggle to NotePanel metadata#897
multiplex55 merged 3 commits intomasterfrom
codex/add-metadata-toggle-to-notepanel

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple per-panel runtime control to hide or show metadata (Tags, Links, Backlinks) so users can focus on the note content while preserving fine-grained metadata UI state.
  • Keep existing editor/preview behavior and accessibility/focus handling intact when toggling metadata visibility.

Description

  • Added a new boolean field show_metadata: bool to NotePanel and initialized it to true in NotePanel::from_note so panels default to showing metadata.
  • Added details_toggle_label() helper and a top-row toggle button (renders Hide Details / Show Details) placed before the font-size controls; toggling reuses the existing focus_textedit_next_frame pattern to preserve keyboard focus behavior.
  • Wrapped rendering of the Tags row, Links row, and Backlinks section in ui with if self.show_metadata { ... } guards; the editor/preview content area remains always visible and backlink tabs/pagination state are preserved when hiding/showing.
  • Added unit tests in the existing #[cfg(test)] module: toggle_hides_metadata_sections_in_ui, toggle_button_label_reflects_state, and toggle_preserves_tab_and_pagination_state, and a small helper render_panel_and_dump_shapes to exercise UI rendering in tests.

Testing

  • Ran cargo fmt -- src/gui/note_panel.rs successfully to format the changes.
  • Attempted to run targeted tests (e.g. cargo test toggle_button_label_reflects_state), but the test build failed in this environment due to a missing system dependency required by a transitive crate (alsa-sys requires a system alsa pkg-config file), preventing completion of cargo test runs here.
  • The added unit tests are included in the PR and should pass in a normal development environment with standard system build dependencies installed.

Codex Task

@multiplex55 multiplex55 merged commit 77dfd45 into master Feb 19, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/add-metadata-toggle-to-notepanel branch February 20, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant