Skip to content

feat(aggregations): sticky document header in stage preview COMPASS-10630#8019

Draft
cursor[bot] wants to merge 8 commits into
mainfrom
cursor/aggregations-document-header-sticky-3e8c
Draft

feat(aggregations): sticky document header in stage preview COMPASS-10630#8019
cursor[bot] wants to merge 8 commits into
mainfrom
cursor/aggregations-document-header-sticky-3e8c

Conversation

@cursor

@cursor cursor Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

Stage preview document cards now keep the first root field row (typically _id) and the expand/collapse caret + actions visible while the rest of the document scrolls inside the card.

Follow-up fix: The first implementation used position: sticky on the header row, but the stage preview wrapper used overflow: auto, so that wrapper became the scrollport and the entire document (including the "sticky" row) scrolled together—matching the reported screenshot. The preview card wrapper now uses overflow: hidden with a flex column layout so only the document body region scrolls; the header stays pinned without relying on sticky.

Also fixed ReadonlyDocument event cleanup: unsubscribeFromDocumentEvents now calls doc.off instead of incorrectly re-registering listeners.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

Addresses COMPASS-10630: long aggregation preview documents required scrolling to the top to reach the expand caret and _id row.

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would change existing functionality)
Open in Web Open in Cursor 

Support rendering a subset of root-level visible fields, optional line
counter offset, and hiding the root visible-fields toggle for split layouts.
When stickyDocumentHeaderInScrollContainer is set, keep the first root
field and action bar in a sticky row with remaining fields in a nested
scroll area. Fix document event unsubscribe to use off().
Enable stickyDocumentHeaderInScrollContainer for preview documents and
adjust the preview card flex layout so the inner scroll region works.
cursoragent and others added 5 commits April 24, 2026 01:06
Use overflow:hidden on the stage preview card wrapper so scrolling happens
only in the document body flex region; sticky was ineffective when the
parent div was the scrollport.
Preview cards were allowed to grow to full document height, so the inner
document scroller never activated and the stage preview column scrolled the
entire card. Cap card height, tighten flex min-heights, and clip the card so
only the document body scrolls.
… scroll

documentStyles used flex-shrink: 0, which preserved the full document height
inside the capped KeylineCard so the ReadonlyDocument body never scrolled.
Use flex-shrink: 1, min-height: 0, and max-height: 100% so the inner scroller
gets a definite height.
…views

DocumentActionsGroup hides action buttons until hover by default; in the
split preview header the caret was effectively invisible. Pass
onlyShowOnHover={false} when stickyDocumentHeaderInScrollContainer is set.

Co-authored-by: misbamongo <misbamongo@users.noreply.github.com>
Replace pinned top header with a fixed left column for expand/actions while
the full document scrolls beside it. Add DocumentActionsGroup layout=gutter
and StickyPreviewGutter chrome; reduce extraGutterWidth in preview scroll area.

Co-authored-by: misbamongo <misbamongo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants