Skip to content

fix(ui): take the scroll area viewport's wrapper out of table layout - #559

Merged
cevheri merged 1 commit into
mainfrom
fix/scroll-area-clipping
Sep 4, 2026
Merged

fix(ui): take the scroll area viewport's wrapper out of table layout#559
cevheri merged 1 commit into
mainfrom
fix/scroll-area-clipping

Conversation

@kaya-abdullah

Copy link
Copy Markdown
Member

Description

The Explorer sidebar (and the row detail sheet, which shares the same scroll area primitive) clips the right edge of its content when an item's name is long enough. Radix's ScrollAreaPrimitive.Viewport renders its own wrapper div with an inline display: table; min-width: 100%. A table box grows to its content's own minimum width regardless of the parent's width, so a long enough name pushes the wrapper past the visible panel, and the viewport's overflow-x: hidden clips the excess. A table's row count badge lost its trailing character this way (2.0k read as 2.0), and a connection badge was sliced mid glyph.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Related Issue

Closes #558

Changes Made

  • src/components/ui/scroll-area.tsx: added [&>div]:block! to the viewport, which takes Radix's direct-child wrapper out of table layout so the viewport's own width acts as a real cap instead of a floor. Nothing in this component ever scrolls horizontally (no call site passes orientation="horizontal" to the scrollbar), so this is safe.
  • tests/components/ui/scroll-area.test.tsx: new test file against the real @radix-ui/react-scroll-area (Sidebar and RowDetailSheet both mock that module process-wide, so this needs its own isolated test file to exercise the real primitive).
  • tests/run-components.sh: added Group 21 for the new test file, in its own isolated process for the reason above.
  • src/lib/db/compatibility.ts and docs/providers/README.md: corrected the Apache Cloudberry caveat text, which described the monitoring dashboard's overview and performance tabs as failing alongside the table and index statistics panels. Screenshots taken while preparing an unrelated docs contribution show those two tabs read correctly (connections, database size, table count, deadlocks, checkpoint stats), and only the Tables tab's per-table breakdown and the Storage tab's largest-tables list fail, each with the correct "this database could not answer this panel" framing rather than a miscategorized connection error.

Testing

  • I have tested this locally
  • I have added/updated tests
  • All existing tests pass

Test Environment

  • LibreDB Studio Version: 0.13.7
  • Browser: Chrome, via Playwright, and confirmed visually in production-build screenshots
  • OS: Linux
  • Node.js/Bun Version: Bun 1.3.10
  • Database Type: PostgreSQL-wire (Apache Cloudberry), though the bug itself is in the shared UI primitive, not a provider

Screenshots (if applicable)

None attached to this PR. The bug and the fix were both confirmed visually while preparing screenshots for an unrelated docs contribution: before the fix, an object browser listing pg_ext_aux.pg_pax_fastsequence read a 2000-row table's count as 2.0; after the fix, the same view reads 2.0k in full.

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published (not applicable, no dependent changes)

Additional Notes

Ran bun run format, lint, typecheck, knip, chart:check, channels:showcase:check, readme:check, security:check, the full test suite, bun run test:coverage plus coverage:check, and bun run build. All pass; coverage is 100 percent.

Radix's ScrollAreaPrimitive.Viewport renders its own direct-child
wrapper with an inline display: table; min-width: 100%. A table box
grows to its content's own minimum width regardless of the parent's
width, so a long enough item name (a qualified table name, for
example) pushes the wrapper past the visible panel, and the
viewport's overflow-x: hidden then clips the excess. A row's count
badge lost its trailing character this way (2.0k read as 2.0), and a
connection badge was sliced mid glyph. Truncation on the item name
cannot prevent it, since truncation needs a definite container width
and a table box has none until its content has already forced one.

Takes the wrapper out of table layout instead (display: block).
Nothing in this component ever scrolls horizontally, so this is
safe: no call site passes orientation="horizontal" to the scrollbar.

Also corrects the Apache Cloudberry caveat text in compatibility.ts
and docs/providers/README.md, which described the monitoring
dashboard's overview and performance tabs as failing alongside the
table and index statistics panels; screenshots taken while preparing
an unrelated docs contribution show those two tabs read correctly,
and only the per-table and per-index breakdowns fail.

Closes #558
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@cevheri
cevheri merged commit c0dfebe into main Sep 4, 2026
27 checks passed
@cevheri
cevheri deleted the fix/scroll-area-clipping branch September 4, 2026 22:35
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.

Explorer sidebar clips a table's row count when a long table name is present

2 participants