Skip to content

ui: make Metrics page charts responsive to viewport width#170977

Open
virajchogle wants to merge 1 commit into
cockroachdb:masterfrom
virajchogle:metrics-resize-170975
Open

ui: make Metrics page charts responsive to viewport width#170977
virajchogle wants to merge 1 commit into
cockroachdb:masterfrom
virajchogle:metrics-resize-170975

Conversation

@virajchogle
Copy link
Copy Markdown

@virajchogle virajchogle commented May 27, 2026

uPlot charts on the Metrics page were hardcoded to 947px wide and .visualization used width: fit-content, so the right-hand Summary panel was clipped on viewports narrower than ~1350px (e.g. 13" MacBook Pro at default Retina scaling). No scrollbar appeared because the layout panel uses overflow: hidden.

Replace the fixed width with the container's actual clientWidth at chart creation time, add a ResizeObserver to call uPlot.setSize() on resize, and switch .visualization to width: 100%. Remove the hardcoded min-width: 947px from the loading spinner wrapper.

bars.ts (BarGraph component) has the same hardcoded width; left as a follow-up to keep this PR scoped to the reported Metrics page bug.

image

Fixes: #170975
Epic: CRDB-64261

Release note (ui change): Fixed a bug on the DB Console Metrics page where the Summary panel was clipped on viewports narrower than ~1350px. Charts now resize to fit the available width.

Fixes: cockroachdb#170975
Epic: CRDB-64261

Release note (ui change): Fixed a bug on the DB Console Metrics
page where the Summary panel was clipped on viewports narrower
than ~1350px. Charts now resize to fit the available width.
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 27, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented May 27, 2026

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI.

I have added a few people who may be able to assist in reviewing:

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl Bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels May 27, 2026
@blathers-crl blathers-crl Bot requested a review from srosenberg May 27, 2026 05:14
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@virajchogle virajchogle marked this pull request as ready for review May 27, 2026 05:34
@virajchogle virajchogle requested a review from a team as a code owner May 27, 2026 05:34
@virajchogle virajchogle requested review from kyle-a-wong and removed request for a team May 27, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-community Originated from the community X-blathers-triaged blathers was able to find an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: Metrics page Summary panel clipped on narrow viewports (≤1350px) due to hardcoded chart width

2 participants