fix: make MCP sessions table scrollable with sticky header and improved pagination UI - #4774
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe MCP Sessions page outer wrapper switches to a flex column layout with a computed viewport height. ChangesMCP Sessions layout and pagination
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
|
Confidence Score: 4/5This is close, but the table scrolling fix should be completed before merging.
ui/app/workspace/mcp-sessions/views/sessionsTable.tsx Important Files Changed
Reviews (7): Last reviewed commit: "fix: mcp sessions ui fixes" | Re-trigger Greptile |
af58759 to
b95a121
Compare
af483cc to
eae8b64
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@ui/app/workspace/mcp-sessions/views/sessionsTable.tsx`:
- Line 262: The pagination container in the sessions table uses a generic test
id that breaks the local naming convention and can collide with other pages.
Update the `sessionsTable.tsx` pagination wrapper to use a namespaced
`data-testid` consistent with the other `mcp-sessions-*` selectors in this view,
and verify sibling test ids nearby so the new identifier follows the existing
`entity-element-qualifier` pattern used by Playwright tests.
- Around line 262-295: The pagination footer in sessionsTable’s pagination block
is forced into a single row, causing the count text, page indicator, and
navigation buttons to collide on narrow screens. Update the footer container and
its inner controls to allow wrapping or switch to a stacked layout at small
widths so the new internal-scroll view remains usable on mobile. Focus on the
flex wrappers around the pagination area and the Button/page indicator group,
keeping the existing pagination 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d23ca583-e19a-4756-b2aa-3d20bb5aed34
📒 Files selected for processing (2)
ui/app/workspace/mcp-sessions/page.tsxui/app/workspace/mcp-sessions/views/sessionsTable.tsx
b95a121 to
9e56cfb
Compare
eae8b64 to
3d10adc
Compare
3d10adc to
e3dc25b
Compare
9e56cfb to
b87c24a
Compare
e3dc25b to
2de7853
Compare
2de7853 to
b197e08
Compare
b87c24a to
74cf118
Compare
Merge activity
|
The base branch was changed.
b197e08 to
2913b4d
Compare
| <div className="flex grow flex-col overflow-auto"> | ||
| <div className={`mb-2 grow overflow-auto rounded-sm border ${isFetching ? "opacity-70 transition-opacity" : ""}`}> |
There was a problem hiding this comment.
This still lets the table area grow to the rows' full content height. With a full page of sessions, these growing flex children keep their default min-height: auto, so the table viewport can refuse to shrink into the remaining page space. The pagination then can be pushed below the visible area, or scrolling can move to the wrong ancestor instead of staying inside the table region.
| <div className="flex grow flex-col overflow-auto"> | |
| <div className={`mb-2 grow overflow-auto rounded-sm border ${isFetching ? "opacity-70 transition-opacity" : ""}`}> | |
| <div className="flex min-h-0 grow flex-col overflow-auto"> | |
| <div className={`mb-2 min-h-0 grow overflow-auto rounded-sm border ${isFetching ? "opacity-70 transition-opacity" : ""}`}> |
…ed pagination UI (#4774) ## Summary Improves the MCP Sessions page layout so the table fills the available viewport height and scrolls internally, rather than causing the entire page to scroll. The pagination controls are also refreshed for a cleaner appearance. ## Changes - The sessions page container is now a full-height flex column (`h-[calc(100dvh-50px)]`), constraining the layout to the visible viewport. - The sessions table wrapper uses `grow` and `overflow-hidden` so the table expands to fill remaining space, with the table body scrolling independently via a sticky header. - The `Table` component receives a `containerClassName` of `h-full overflow-auto` and the `TableHeader` is made sticky (`sticky top-0 z-20 bg-muted`) so column headers remain visible while scrolling. - Pagination controls are updated: "Previous"/"Next" text labels are replaced with icon-only ghost buttons, and a "Page X of Y" indicator is added between them. Entry counts now use `toLocaleString()` for number formatting and the label is updated to "X–Y of Z entries". - Filter bar and header sections are wrapped with explicit `mb-4` margins to maintain spacing within the new flex layout. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test Navigate to the MCP Sessions page with a sufficient number of sessions to trigger pagination. Verify that: 1. The table fills the viewport height without the page itself scrolling. 2. The table header remains sticky as you scroll through rows. 3. Pagination shows "Page X of Y" with icon-only previous/next buttons, and entry counts are formatted with locale separators. ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before/after screenshots of the MCP Sessions page showing the sticky header, viewport-constrained table, and updated pagination controls are recommended. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Improves the MCP Sessions page layout so the table fills the available viewport height and scrolls internally, rather than causing the entire page to scroll. The pagination controls are also refreshed for a cleaner appearance.
Changes
h-[calc(100dvh-50px)]), constraining the layout to the visible viewport.growandoverflow-hiddenso the table expands to fill remaining space, with the table body scrolling independently via a sticky header.Tablecomponent receives acontainerClassNameofh-full overflow-autoand theTableHeaderis made sticky (sticky top-0 z-20 bg-muted) so column headers remain visible while scrolling.toLocaleString()for number formatting and the label is updated to "X–Y of Z entries".mb-4margins to maintain spacing within the new flex layout.Type of change
Affected areas
How to test
Navigate to the MCP Sessions page with a sufficient number of sessions to trigger pagination. Verify that:
Screenshots/Recordings
Before/after screenshots of the MCP Sessions page showing the sticky header, viewport-constrained table, and updated pagination controls are recommended.
Breaking changes
Related issues
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines