Skip to content

fix: Native scrollbars in sidebar and panel views - #730

Merged
ilyabo merged 4 commits into
mainfrom
fix-native-scrollbars
Jun 19, 2026
Merged

ilyabo merged 4 commits into
mainfrom
fix-native-scrollbars

Conversation

@ilyabo

@ilyabo ilyabo commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Wrap sidebar sections, chart panels, and schema explorers in shared ScrollArea containers
  • Remove nested overflow scrolling that was clipping content in the CLI sidebar and mosaic panels
  • Keep grid and schema trees visible while restoring consistent native scrollbars

Testing

  • Not run (not requested)

Summary by CodeRabbit

  • Improvements
    • Added consistent scroll areas with visible scrollbars across sidebars, grid layouts, mosaic charts, chart spec viewers, and dashboard settings to improve scrolling clarity.
    • Updated overflow handling and sizing rules in the sidebar and schema/table panels to better maintain layout stability, including a change to the chat messages overflow behavior.
  • Tests
    • Updated Jest assertion formatting in Mosaic table reference tests without changing expected results.

@ilyabo ilyabo changed the title Fix native scrollbars in sidebar and panel views fix: Native scrollbars in sidebar and panel views Jun 18, 2026
@ilyabo
ilyabo marked this pull request as ready for review June 18, 2026 15:21
@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 165a070a-cda7-4d01-a652-6f937e42327d

📥 Commits

Reviewing files that changed from the base of the PR and between eccb94f and e94d8b9.

📒 Files selected for processing (8)
  • apps/sqlrooms-cli-ui/src/components/AssistantChatContainer.tsx
  • apps/sqlrooms-cli-ui/src/workspace/sidebar/CliDataSidebarSection.tsx
  • packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx
  • packages/mosaic/__tests__/mosaicTableReference.test.ts
  • packages/mosaic/src/charts/MosaicChart.tsx
  • packages/mosaic/src/charts/chart-settings/MosaicChartSpecViewerPanel.tsx
  • packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx
  • packages/mosaic/src/mosaicTableReference.ts
💤 Files with no reviewable changes (2)
  • packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx
  • packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx
✅ Files skipped from review due to trivial changes (3)
  • packages/mosaic/tests/mosaicTableReference.test.ts
  • packages/mosaic/src/mosaicTableReference.ts
  • apps/sqlrooms-cli-ui/src/workspace/sidebar/CliDataSidebarSection.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/sqlrooms-cli-ui/src/components/AssistantChatContainer.tsx
  • packages/mosaic/src/charts/MosaicChart.tsx

📝 Walkthrough

Walkthrough

Across ten files in packages/layout, packages/mosaic, packages/sql-editor, and apps/sqlrooms-cli-ui, plain div elements with overflow-auto used as scroll containers are replaced with ScrollArea and ScrollBar components from @sqlrooms/ui. Overflow and layout classNames (overflow-hidden, overflow-visible, min-h-0, flex constraints) are updated accordingly. Minor code formatting changes are applied to mosaicTableReference test and implementation files.

Changes

ScrollArea Migration and Layout Fixes

Layer / File(s) Summary
SchemaExplorer and TableStructurePanel scroll fixes
packages/sql-editor/src/components/SchemaExplorer.tsx, packages/sql-editor/src/components/TableStructurePanel.tsx
SchemaExplorerRoot removes overflow-auto from its ScrollArea className; SchemaExplorerTree and TableSchemaTree in both components now compose className with explicit overflow-visible via cn(...) helper.
Mosaic chart and dashboard panel ScrollArea upgrades
packages/mosaic/src/charts/MosaicChart.tsx, packages/mosaic/src/charts/chart-settings/MosaicChartSpecViewerPanel.tsx, packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx
MosaicChart and MosaicChartSpecViewerPanel replace div+overflow-auto wrappers with ScrollArea+ScrollBar. MosaicDashboardPanelLayout applies the same change in both the narrow-container early-return path and the resizable settings panel, preserving onResize wiring.
GridLayout ScrollArea upgrade
packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx
Replaces the overflow-auto div wrapper with a ScrollArea wired to the existing scrollContainerElementRef via viewportRef, and adds explicit horizontal ScrollBar beneath ResponsiveGridLayout.
CLI sidebar ScrollArea and layout constraints
apps/sqlrooms-cli-ui/src/workspace/sidebar/CliArtifactsSidebarSection.tsx, apps/sqlrooms-cli-ui/src/workspace/sidebar/CliDataSidebarSection.tsx, apps/sqlrooms-cli-ui/src/workspace/sidebar/CliWorkspaceSidebar.tsx, apps/sqlrooms-cli-ui/src/components/AssistantChatContainer.tsx
CliArtifactsSidebarSection wraps expanded menu in ScrollArea+ScrollBar with min-w-0/truncation fixes; CliDataSidebarSection splits SchemaExplorer into Header and Tree inside ScrollArea with both scrollbars; CliWorkspaceSidebar adds overflow-hidden, min-h-0, h-full, and flex-[0_1_46%] constraints for collapsed-icon mode; AssistantChatContainer switches print-container from overflow-auto to overflow-hidden.
Code formatting refactors
packages/mosaic/__tests__/mosaicTableReference.test.ts, packages/mosaic/src/mosaicTableReference.ts
Test assertions are reformatted from multi-line to single-line; implementation ternary and filter expressions are expanded across multiple lines while preserving the same return values and filter logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • sqlrooms/sqlrooms#699: CLI sidebar UI update directly overlaps with this PR's styling changes to CliArtifactsSidebarSection, CliDataSidebarSection, CliWorkspaceSidebar, and AssistantChatContainer.

Suggested reviewers

  • dmitriy-kostianetskiy

Poem

🐇 A rabbit hops past divs of old,
Where overflow-auto once scrolled so bold.
Now ScrollArea lines each panel neat,
With ScrollBar companions, the layout's complete!
No overflow escapes my paws today—
Each container now scrolls the proper way! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Native scrollbars in sidebar and panel views' accurately summarizes the primary change: implementing native scrollbars across UI components using ScrollArea containers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-native-scrollbars

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eccb94fccb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +48 to +49
<ScrollArea className="h-full">
<div className="h-full p-2">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve a definite height for chart content

When a chart is rendered in a panel, this ScrollArea adds a Radix viewport/content wrapper between the panel and the h-full chart container. That intermediate content element does not have a definite height, so the h-full chain that MosaicChartView/ResponsivePlot relies on can resolve to zero; ResponsivePlot ignores zero-height measurements, leaving fresh vgplot charts without a containerSize and rendering blank. Please keep a definite-height wrapper outside the scroll area, or force the viewport content wrapper to h-full before nesting the chart view.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 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.

Inline comments:
In `@packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx`:
- Around line 674-675: The ScrollArea component in GridLayout.tsx already
provides a vertical scrollbar internally, so the explicit vertical ScrollBar
component with orientation="vertical" is redundant and creates duplication.
Remove the line containing the vertical ScrollBar component and keep only the
horizontal ScrollBar component with orientation="horizontal".

In `@packages/mosaic/src/charts/chart-settings/MosaicChartSpecViewerPanel.tsx`:
- Around line 44-45: Remove the explicit ScrollBar component with
orientation="vertical" from the ScrollArea since ScrollArea already renders a
vertical scrollbar by default. Delete the line containing <ScrollBar
orientation="vertical" /> and keep only the <ScrollArea> component, which will
handle the vertical scrolling functionality automatically without any redundant
scrollbar rendering.

In `@packages/mosaic/src/charts/MosaicChart.tsx`:
- Around line 60-61: Remove the redundant vertical ScrollBar component from the
ScrollArea in MosaicChart.tsx. The ScrollArea component from `@sqlrooms/ui`
already includes a default vertical scrollbar internally, so the explicit
ScrollBar with orientation="vertical" creates duplication. Delete the first
ScrollBar element and keep only the ScrollBar with orientation="horizontal" to
maintain horizontal scrolling functionality.

In `@packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx`:
- Around line 72-73: The ScrollArea components in the MosaicDashboardPanelLayout
are displaying duplicate vertical scrollbars because explicit ScrollBar
components with vertical orientation are being added when the ScrollArea from
`@sqlrooms/ui` already provides a default vertical scrollbar. Remove the explicit
ScrollBar orientation="vertical" component from both ScrollArea usages (one in
the narrow settings branch and one in the split-view branch) to eliminate the
duplicate scrollbars while keeping the default scrollbar behavior intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9803ce46-4c17-4f4d-a468-41e97d20f52c

📥 Commits

Reviewing files that changed from the base of the PR and between dcb1a51 and eccb94f.

📒 Files selected for processing (10)
  • apps/sqlrooms-cli-ui/src/components/AssistantChatContainer.tsx
  • apps/sqlrooms-cli-ui/src/workspace/sidebar/CliArtifactsSidebarSection.tsx
  • apps/sqlrooms-cli-ui/src/workspace/sidebar/CliDataSidebarSection.tsx
  • apps/sqlrooms-cli-ui/src/workspace/sidebar/CliWorkspaceSidebar.tsx
  • packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx
  • packages/mosaic/src/charts/MosaicChart.tsx
  • packages/mosaic/src/charts/chart-settings/MosaicChartSpecViewerPanel.tsx
  • packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx
  • packages/sql-editor/src/components/SchemaExplorer.tsx
  • packages/sql-editor/src/components/TableStructurePanel.tsx

Comment thread packages/layout/src/node-renderers/grid-node-renderer/GridLayout.tsx Outdated
Comment thread packages/mosaic/src/charts/chart-settings/MosaicChartSpecViewerPanel.tsx Outdated
Comment thread packages/mosaic/src/charts/MosaicChart.tsx Outdated
Comment thread packages/mosaic/src/dashboard/panel/MosaicDashboardPanelLayout.tsx Outdated
ilyabo added 2 commits June 19, 2026 11:02
…crollbars

# Conflicts:
#	apps/sqlrooms-cli-ui/src/components/AssistantChatContainer.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e94d8b9dd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +34
<ScrollArea className="min-h-0 flex-1">
<div className="h-full p-2">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve spec viewer height through ScrollArea

When users open “View spec” in a chart settings pane, this new ScrollArea inserts Radix's viewport content wrapper between the flex-1 panel and the nested h-full editor wrapper. That intermediate wrapper has no definite height, unlike the previous flex-1 overflow-auto div, so the h-full chain for MosaicCodeMirrorEditor can resolve to auto/default height instead of filling the settings pane; the spec viewer becomes a small/collapsed editor in split or narrow panels. Add the same viewport-content h-full rule used for the chart view, or keep a definite-height wrapper outside the scroll area.

Useful? React with 👍 / 👎.

@ilyabo
ilyabo merged commit c58e0a1 into main Jun 19, 2026
4 checks passed
@ilyabo
ilyabo deleted the fix-native-scrollbars branch June 19, 2026 09:18
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.

1 participant