Skip to content

RS-21330: Fix label size measurement broken by flex body in new UI#137

Merged
JustinCCYap merged 4 commits intomasterfrom
RS-21330
Mar 11, 2026
Merged

RS-21330: Fix label size measurement broken by flex body in new UI#137
JustinCCYap merged 4 commits intomasterfrom
RS-21330

Conversation

@JustinCCYap
Copy link
Contributor

Summary

  • In the new Displayr UI, body has display:flex (previously display:block), causing any direct child div to become a flex item and stretch to fill the full width
  • calculateLabelDimensions in labelUtils.js appends a measurement div directly to document.body, so its width was being measured incorrectly (too wide), causing label positions to overflow and the pictograph to render blank
  • Fix: add position:fixed;visibility:hidden to the measurement div so it is taken out of the flex flow and measures its natural content size

Test plan

  • Open a document with Bar Pictographs in the new Displayr UI and confirm they render correctly
  • Confirm Bar Pictographs still render correctly in the old UI

Fixes: https://numbers.atlassian.net/browse/RS-21330

🤖 Generated with Claude Code

@JustinCCYap JustinCCYap requested a review from chschan March 11, 2026 04:40
@JustinCCYap
Copy link
Contributor Author

You can test this out in reusdev at the moment (might need hard refresh of the page after recalculating)

Use position:fixed;width:max-content instead of display:inline-block
so the measurement div is unaffected by flex/grid parent layouts
(e.g. the new UI sets body to display:flex) and immune to global
width rules that could skew the measured label dimensions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

@chschan chschan left a comment

Choose a reason for hiding this comment

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

LGTM

@chschan
Copy link
Contributor

chschan commented Mar 11, 2026

Remember to bump version and update flipStandardCharts

@JustinCCYap
Copy link
Contributor Author

Remember to bump version and update flipStandardCharts

What needs to be updated in flipStandardCharts?

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JustinCCYap JustinCCYap merged commit 6dd342d into master Mar 11, 2026
2 checks passed
@chschan
Copy link
Contributor

chschan commented Mar 11, 2026

You're right, flipStandardChart doesn't refer to a version so it should be fine to just get it updated on nixR/r-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants