Update icons for measurement tools#9569
Conversation
📝 WalkthroughWalkthroughA new local helper merges disabled-state styling with a 1.5× scale transform for dropdown option icons; that helper is applied to brush, erase, and measurement tool dropdown icons. An unreleased_changes markdown entry documents the icon improvements. ChangesIcon styling and menus
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/javascripts/viewer/view/action_bar/tools/tool_buttons.tsx (1)
461-461: ⚡ Quick winConsider using
fontSizefor icon scaling in dropdown menu items for consistencyWhile
transform: scale()works here, usingfontSizeis more idiomatic for Ant Design Icon sizing and avoids relying on CSS transforms for layout-aware sizing. The Icon component in each dropdown menu item (lines 461 and 482) could be sized viafontSizeinstead, which participates in the layout system:🔧 Refactoring suggestion
- style={{ ...getMaybeDisabledButtonStyle(isLineMeasurementDisabled), transform: "scale(1.5)" }} + style={{ ...getMaybeDisabledButtonStyle(isLineMeasurementDisabled), fontSize: "1.5em" }}- style={{ ...getMaybeDisabledButtonStyle(isAreaMeasurementDisabled), transform: "scale(1.5)" }} + style={{ ...getMaybeDisabledButtonStyle(isAreaMeasurementDisabled), fontSize: "1.5em" }}Note: The current
transform: scale()approach is already used elsewhere in the codebase (e.g.,brush_presets.tsx,view_modes_view.tsx) and works without issues. This change improves stylistic consistency rather than fixing a bug.Also applies to: 482-482
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/javascripts/viewer/view/action_bar/tools/tool_buttons.tsx` at line 461, Replace the inline CSS transform scaling on the Icon elements used in the dropdown menu items in tool_buttons.tsx with an explicit fontSize style so the Ant Design Icon participates in layout sizing; locate the Icon JSX inside the dropdown menu items (the entries around the current transform: scale(...) usages) and change the style from transform: scale(...) to style={{ fontSize: <appropriateValue> }} (match the numeric scale to an equivalent fontSize) for both occurrences so the icons size consistently with other Ant Design icons.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@frontend/javascripts/viewer/view/action_bar/tools/tool_buttons.tsx`:
- Line 461: Replace the inline CSS transform scaling on the Icon elements used
in the dropdown menu items in tool_buttons.tsx with an explicit fontSize style
so the Ant Design Icon participates in layout sizing; locate the Icon JSX inside
the dropdown menu items (the entries around the current transform: scale(...)
usages) and change the style from transform: scale(...) to style={{ fontSize:
<appropriateValue> }} (match the numeric scale to an equivalent fontSize) for
both occurrences so the icons size consistently with other Ant Design icons.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f047379b-89fb-4351-8730-7e8e128f3675
⛔ Files ignored due to path filters (2)
frontend/assets/images/icons/icon-area-measurement.svgis excluded by!**/*.svgfrontend/assets/images/icons/icon-line-measurement.svgis excluded by!**/*.svg
📒 Files selected for processing (1)
frontend/javascripts/viewer/view/action_bar/tools/tool_buttons.tsx
See https://scm.slack.com/archives/C5AKLAV0B/p1777309359116229
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)
$PR_NUMBER.mdfile inunreleased_changesor use./tools/create-changelog-entry.py)