Skip to content

FIX dataset dropdown auto-resizes to fit long dataset names#630

Merged
mvdoc merged 6 commits into
mainfrom
claude/mystifying-cartwright-439859
May 9, 2026
Merged

FIX dataset dropdown auto-resizes to fit long dataset names#630
mvdoc merged 6 commits into
mainfrom
claude/mystifying-cartwright-439859

Conversation

@mvdoc

@mvdoc mvdoc commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Size of dropdown dataset selector should auto-adjust to longer dataset names #628: the dataset dropdown selector had a hardcoded max-width: 400px, so long dataset names wrapped onto multiple lines and looked ugly.
  • Replaced with width: max-content (capped at 90vw) on #dataopts and ul#datasets, plus white-space: nowrap on each list item, so the dropdown auto-fits the longest dataset name and gracefully caps at the viewport width.
  • Added Viewer.fitDataname() to auto-shrink the #dataname heading font-size when a long name would otherwise overflow the panel cap, so the heading still fits cleanly. Called after each setData and on window resize.

After

dropdown auto-resizes and heading shrinks

(Compare with the "before" screenshot in #628.)

Test plan

  • Open viewer with 1 short dataset name → dropdown stays at sensible width, heading at full 24pt
  • Open viewer with 5 datasets including very long names → dropdown widens to fit, no wrapping or horizontal scrollbar; heading shrinks to fit the panel
  • Verified ul#datasets's scrollWidth === clientWidth (no clipped horizontal overflow)
  • Verified #dataname.scrollWidth <= clientWidth for long names (no clipped heading)

🤖 Generated with Claude Code

Replace the hardcoded 400px max-width on #dataopts and ul#datasets with
width: max-content (capped at 90vw) and add white-space: nowrap to each
list item. Long dataset names now display without ugly wrapping or
truncation, while short names still render compactly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CSS for the MRI viewer to improve layout responsiveness by replacing fixed pixel widths with dynamic values like max-content and viewport-based constraints. Feedback suggests explicitly setting overflow-x: hidden to prevent horizontal scrollbars when vertical scrolling is active and adding text-overflow: ellipsis to gracefully handle long dataset names that exceed the container width.

Comment thread cortex/webgl/resources/css/mriview.css
Comment thread cortex/webgl/resources/css/mriview.css
mvdoc and others added 5 commits May 9, 2026 12:14
Even with the dropdown panel widening to fit long dataset names, the 24pt
heading text could still exceed the 90vw panel cap and get clipped. Add
fitDataname() to scale the heading font-size down (24pt → min 14px) when
the rendered width exceeds 90vw, and call it after every #dataname update
plus on window resize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 1s transition-delay + .3s all-property transition on #dataopts caused
the dropdown panel to lag noticeably when its width changed (e.g. when
selecting a dataset with a different name length). Removing the rule
makes the panel snap to its new size immediately. The dataset list
slide toggle is unaffected — that animation is driven by jQuery, not CSS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ul#datasets: add explicit overflow-x: hidden so the implicit auto
  promotion from overflow-y: auto cannot produce a horizontal scrollbar
  if the parent ever has to cap the list width.
- ul#datasets li: add overflow: hidden and text-overflow: ellipsis so
  pathologically long names (e.g. on very narrow viewports) degrade
  gracefully with an ellipsis instead of overflowing the row.

Verified at 800px viewport (all items fit, no ellipsis) and 350px
viewport (longest two names show ellipsis as expected).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mvdoc mvdoc merged commit 0c050bb into main May 9, 2026
12 checks passed
@mvdoc mvdoc deleted the claude/mystifying-cartwright-439859 branch May 9, 2026 19:24
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.

Size of dropdown dataset selector should auto-adjust to longer dataset names

1 participant