Skip to content

fix: [data-view] keep the renderer inside a sized parent - #1029

Open
rohanchkrabrty wants to merge 2 commits into
mainfrom
fix/dataview-container-height
Open

rohanchkrabrty wants to merge 2 commits into
mainfrom
fix/dataview-container-height

Conversation

@rohanchkrabrty

Copy link
Copy Markdown
Contributor

Summary

  • DataView rendered only a context provider, so the toolbar and the renderer were siblings in your element. The renderer used height: 100% of that element and overflowed a fixed-height parent by the height of the toolbar.
  • DataView now renders a root div (data-slot="data-view"). It is a flex column with width: 100% and height: 100%. The renderers take flex: 1 and fill the height that the toolbar leaves. They keep height: 100%, so a sized wrapper inside DataView still works.
  • DataViewProps extends the div props through useRender, so className, style, ref and render go to the root.
  • Breaking: the parts are children of the root, not of your element, and each part is a flex item. The CHANGELOG and upgrading.mdx cover selectors, tests that read container.firstChild, and inline children.
  • The timeline tests find the pane by data-slot, not by container.firstElementChild. The DataView docs add the data-view slot and a note on sizing.

Closes #907

DataView rendered only a context provider, so the toolbar and the renderer
were siblings in the consumer's element. The renderer used height: 100% of
that element, and overflowed it by the height of the toolbar.

DataView now renders a root div (data-slot="data-view") through useRender.
It is a flex column with height: 100% and min-width/min-height: 0. The
renderers keep height: 100%. As scroll containers they shrink into the
height that the toolbar leaves, and they still fill a sized wrapper inside
DataView. DataViewProps extends the div props, so className, style, ref
and render go to the root.
The root takes width: 100%, so a flex parent that does not stretch its
items still gives DataView the full width, as the renderers had before.

The renderers take flex: 1, so they fill the height that the other parts
leave. A sibling with overflow set, such as a banner between the toolbar
and the list, keeps its height. height: 100% stays for a sized wrapper
inside DataView.

The docs say that the parts are flex items and how custom content
scrolls below the toolbar.
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
apsara Ready Ready Preview Nov 29, 2026 8:28pm UTC

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

DataView now renders a root div with a data-view slot and forwards div props to it. The root uses a full-size column flex layout, and the list and timeline renderers flex to fill the available height. Tests verify the root and use data slots instead of assuming renderer elements are first children. The documentation and changelog describe the updated layout, migration considerations, and custom-renderer guidance.

Suggested reviewers: shreyag02, ravisuhag, rohilsurana

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 03cd9

DataView now renders a full-height flex-column root so the renderers fill the space below the toolbar. The change is documented as breaking for direct-child selectors and inline children, and the migration notes cover it. No concrete defect was found, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (renderer kept inside a sized parent) and the scope ([data-view]). It matches the main change: DataView now renders a root div with flex layout so the renderer fills the space …
Description check Passed The description states the problem (renderer overflowing a fixed-height parent by the toolbar height), the new root div with data-slot, flex layout, useRender-based props forwarding, the breaking chan…
Linked Issues check Passed Issue #907 requires that a DataView renderer not overflow a fixed-height container by the toolbar height. At the reviewed head, DataView renders a root div with data-slot="data-view" (data-view.tsx, v…
Out of Scope Changes check Passed All changed areas connect to #907 or to the documented breaking change. These are: the data-view.tsx root wrapper and DataViewProps extension to div props (data-view.types.tsx); the CSS changes to .ro…
Full details: Title check

Explanation

The title names the fix (renderer kept inside a sized parent) and the scope ([data-view]). It matches the main change: DataView now renders a root div with flex layout so the renderer fills the space below the toolbar instead of overflowing a fixed-height parent.

Full details: Description check

Explanation

The description states the problem (renderer overflowing a fixed-height parent by the toolbar height), the new root div with data-slot, flex layout, useRender-based props forwarding, the breaking change, timeline test updates, and docs updates. It is directly related to the changeset.

Full details: Linked Issues check

Explanation

Issue #907 requires that a DataView renderer not overflow a fixed-height container by the toolbar height. At the reviewed head, DataView renders a root div with data-slot="data-view" (data-view.tsx, via useRender). The root is a flex column with height: 100% and min-height: 0 (data-view.module.css, .root). The list and timeline renderers use flex: 1 with overflow: auto. Because flex-basis 0% overrides height: 100% in the main axis, and overflow: auto makes min-height compute to 0, the renderer shrinks to the space the toolbar leaves. This meets the outcome in #907. The PR does not use the issue's suggested mechanism exactly. It keeps height: 100% on the renderers instead of replacing it with min-height: 0. This is a design choice, not a missed requirement. The issue's other coding requirements are present: the data-slot attribute, a Root row in the Slots documentation, updated structural tests (data-slots.test.tsx, data-view.test.tsx, timeline.test.tsx), and a breaking-change migration note in the CHANGELOG and upgrading.mdx. Non-coding items were not assessed. Evidence came from the summary and the reviewed data-view.module.css. Source of data-view.tsx and the test diffs were taken from the summary, not re-read.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to #907 or to the documented breaking change. These are: the data-view.tsx root wrapper and DataViewProps extension to div props (data-view.types.tsx); the CSS changes to .root, .listRoot and .timelineRoot; the test updates that adapt to the new root (data-slots, data-view, and timeline tests); and the documentation and CHANGELOG entries that describe the new root and migration. The DataViewProps change to extend div props is a direct consequence of adding a root that accepts className, style, ref and render. The timeline test change, which locates the pane by data-slot, follows from the new DOM structure. No unrelated change was identified in the reviewed evidence.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.6.5)

packages/react/components/data-view/__tests__/data-slots.test.tsx

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

packages/react/components/data-view/__tests__/data-view.test.tsx

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

packages/react/components/data-view/__tests__/timeline.test.tsx

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

  • 3 others

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: acc78af7-bff8-45b2-9c08-24a10b9336ef
Commits

Reviewing files that changed from the base of the PR and between 23f5b50 and 03cd959.

Files selected for processing: 9

  • apps/www/src/content/docs/(overview)/upgrading.mdx
  • apps/www/src/content/docs/dataview/index.mdx
  • packages/react/CHANGELOG.md
  • packages/react/components/data-view/__tests__/data-slots.test.tsx
  • packages/react/components/data-view/__tests__/data-view.test.tsx
  • packages/react/components/data-view/__tests__/timeline.test.tsx
  • packages/react/components/data-view/data-view.module.css
  • packages/react/components/data-view/data-view.tsx
  • packages/react/components/data-view/data-view.types.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@1029

commit: 03cd959

This branch was successfully deployed

1 active deployment
Preview — 03cd959b Deployed Nov 29, 2026 by vercel[bot]
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.

DataView: renderer overflows its container by the height of the toolbar

1 participant