Skip to content

fix(menu/viewer): tighten menu chevron spacing and stop 4D readout overlap#243

Merged
korbinian90 merged 3 commits into
mainfrom
claude/flamboyant-chatterjee-1bd327
Jun 15, 2026
Merged

fix(menu/viewer): tighten menu chevron spacing and stop 4D readout overlap#243
korbinian90 merged 3 commits into
mainfrom
claude/flamboyant-chatterjee-1bd327

Conversation

@korbinian90

@korbinian90 korbinian90 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Menu-bar and 4D-viewer layout fixes.

1. Tighten the gap between a menu label and its dropdown chevron

A MenuItem (and ImageSelect) renders the label and the chevron as two separate nv-topbtn buttons. The visible gap between them was ~24px, built from the label button's 10px right padding, the caret button's 10px left padding, and the arrow SVG's own ms-1 (4px) margin — so each chevron looked detached from its label, while the space after the chevron was the normal 10px.

  • Add .nv-topbtn-label (padding-right: 2px) and .nv-topbtn-caret (padding-left: 2px) in Menu.css, applied to the label/caret pair in MenuItem and ImageSelect.
  • Drop the arrow's ms-1 margin.

Net: the gap before the chevron drops from ~24px to ~4px (short), while the gap after stays at the normal 10px.

2. Stop the readout, the 4D navigator and the timeseries graph from overlapping

On a 4D volume the POS … VAL … readout, the 4D navigator, and the timeseries graph NiiVue draws (autoSizeMultiplanar, View → Time Series) all piled into the bottom-right corner of each pane.

  • Readout → bottom-left, clear of both the 4D navigator and the graph quadrant.
  • 4D navigator → thin vertical column (+ / frame / − / play / sync) in the bottom-right, so it occupies minimal horizontal space (only clips the graph's far-right edge) and leaves the bottom edge free for the readout even on narrow tiles.
  • Fixed-width voxel value: integers print verbatim (e.g. 1044); floats show 5 significant figures without trimming trailing zeros, so the readout no longer jitters between 15.533 and 15.54 as the crosshair moves (it stays 15.540).

Notes for reviewers

  • All changes are layout/CSS plus one formatting helper — no behavior or data-flow changes. Test ids are unchanged (menu-item-dropdown-<label>, intensity-<index>, volume-play/sync/input-<index>).
  • The new menu classes are scoped to the label+caret pair, so MenuButton / MenuToggle are unaffected.
  • @niivue/react type-check and unit tests (85) pass.

🤖 Generated with Claude Code

The chevron sat ~24px from its label (10px label padding + 10px caret
padding + 4px arrow margin), making it look detached from its setting.
Add nv-topbtn-label / nv-topbtn-caret modifiers that trim the inner
padding to 2px and drop the arrow's ms-1 margin, so the chevron hugs the
label while the normal spacing after the chevron is preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🚀 PWA Preview Deployment

Your PWA preview has been deployed!

Preview URL: https://niivue.github.io/niivue-vscode/pr-243/


This preview will be updated automatically when you push new commits to this PR.

github-actions Bot added a commit that referenced this pull request Jun 14, 2026
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

coverage

Overall line coverage: 38.3% (−2.9) vs main

Package Statements Branches Functions Lines
Shared core (packages/niivue-react) 40.9% 42.4% (−0.1) 45.5% 41.4%
apps/pwa 28.9% 33.3% 52.9% 30.2%
apps/jupyter 14.4% 15.9% 14.9% 14.5%
apps/streamlit 17.8% 5.3% 18.5% 17.7%
apps/vscode 38.7% 39.6% 18.9% 38.1%
apps/desktop-tauri 81.8% 59.1% 78.9% 84.3%

📊 View full report →

The POS/VAL readout and the 4D navigator both anchored to the bottom-
right of the pane, so on a 4D volume they overlapped. Lift the readout to
bottom:48px (above the ~40px nav bar) and stack the two vertically when
the navigator is shown. Stacking keeps both bars right-aligned and full-
width safe on narrow tiles, where neither fits beside the other on one
edge. 3D panes are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@korbinian90 korbinian90 changed the title fix(menu): tighten gap between menu label and its dropdown chevron fix(menu/viewer): tighten menu chevron spacing and stop 4D readout overlap Jun 14, 2026
github-actions Bot added a commit that referenced this pull request Jun 14, 2026
Resolves the readout/4D-navigator/timeseries-graph pile-up in the bottom-
right corner of each pane:

- Move the POS/VAL readout to the bottom-left, clear of the 4D navigator
  and the graph NiiVue draws in the bottom-right quadrant.
- Turn the 4D navigator into a thin vertical column (+ / frame / - /
  play / sync) so it barely intrudes on the graph and leaves the bottom
  edge free for the readout on narrow tiles.
- Fix the voxel value width: integers print verbatim while floats show 5
  significant figures without trimming trailing zeros, so the readout no
  longer jumps between "15.533" and "15.54" (stays "15.540").

Supersedes the earlier bottom-right vertical-stacking approach.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
github-actions Bot added a commit that referenced this pull request Jun 14, 2026
@korbinian90 korbinian90 merged commit 900a58d into main Jun 15, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🧹 PWA Preview Cleanup

The preview deployment for this PR has been removed.

github-actions Bot added a commit that referenced this pull request Jun 15, 2026
github-actions Bot added a commit that referenced this pull request Jun 15, 2026
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