feat(sidebar): add Tables and Files flyouts to the collapsed rail - #6882
Conversation
Chats and Workflows already open a hover flyout on the collapsed rail; Tables and Files were plain links. Both now list their contents, with folders as submenus and the open resource marked. The chip stays a real link, so clicking still opens the list page and right-click still reaches the nav context menu. Each flyout owns its queries and mounts only when the menu opens: a hook on the sidebar keeps its cache subscription on every workspace route even when disabled, so an unrelated writer would re-render the whole sidebar for a closed flyout. Rows are ordered by the shared sortResources, so pinned rows float and the flyout reads in the same order as the page it links into. Also removes two dead components (CollapsedFileFolderItems, FileList) that were exported but never rendered, and extracts SidebarNavChip so the rail chip has one definition.
Every DropdownMenuContent was capped at a flat 240px. A menu is 28px per row, 13px per separator, plus 12px padding, so a 7-row action menu with 3 separators measures 247px and scrolled for 7px while the 7-row menu beside it with 1 separator did not. Raises the cap to 420px, which clears every hand-authored action menu, and clamps it with min() against the space Radix measures so a menu near a viewport edge stays on screen — which the flat value never did. The cap still exists so a long data-driven list scrolls instead of running the height of the screen.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryCursor Bugbot is generating a summary for commit 49700d0. Configure here. |
Greptile SummaryThe PR adds collapsed-rail flyouts for Tables and Files, with folder nesting, pinned ordering, active-resource highlighting, and lazy query mounting. It also extracts the shared navigation chip, removes unused file-list components, and raises the shared dropdown height cap while respecting available viewport space. Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported cross-workspace placeholder-data issue is addressed by gating both resource and folder queries until current-workspace data resolves.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/rail-resource-flyout/rail-resource-flyout.tsx | The workspace-transition fix now withholds both flyouts while either resource or folder data is pending or retained as placeholder data. |
| apps/sim/app/workspace/[workspaceId]/components/folders/flyout-entries.ts | Adds a shared builder for nested, pinned-first resource entries with deterministic ordering and orphan handling. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx | Generalizes the collapsed menu to support linked navigation triggers and recursive resource flyouts. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx | Wires lazily mounted Tables and Files flyouts into the collapsed navigation rail. |
| packages/emcn/src/components/dropdown-menu/dropdown-menu.tsx | Increases the dropdown content cap while clamping it to Radix-reported available viewport height. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Rail[Collapsed sidebar rail] -->|Hover Tables or Files| Menu[Resource flyout mounts]
Menu --> Queries[Load resources, folders, and pins]
Queries --> Gate{Pending or placeholder data?}
Gate -->|Yes| Loading[Show loading row]
Gate -->|No| Builder[Build sorted folder tree]
Builder --> Rows[Render folder submenus and resource links]
Reviews (3): Last reviewed commit: "improvement(sidebar): mark pinned rows i..." | Re-trigger Greptile
…orkspace Both the resource and folder queries keep the previous workspace's rows as placeholder data across a switch. Gating only on isPending let the flyout build a tree from one workspace's resources against another's folders, where no folder id resolves — which the builder reads as "archived out from under it" and files the whole list at the root. Gate on isPlaceholderData too, matching foldersResolved in use-folder-ancestors. An error settles a query without resolving it and is deliberately not held: the flyout then renders flat, which still reaches every row.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8f75a88. Configure here.
The flyout sorts pinned rows to the top via the shared sortResources, but rendered no indicator, so that ordering read as arbitrary — the exact pairing Resource's own label cell documents. Carry `pinned` on each row and render the same non-interactive glyph, on folders as well as resources. Adds folder-structure coverage alongside it: per-level ordering, the full depth of a nested chain, and an empty folder staying in the tree.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d1bb132. Configure here.
Summary
sortResources, so pinned rows float and the flyout reads in the same order as the page it links into.enabled: false, so an unrelated writer (the table-import poller ticks every 2s) would re-render the whole sidebar for a flyout nobody opened.DropdownMenuContentwas capped at a flat 240px. At 28px per row, 13px per separator and 12px padding, a 7-row action menu with 3 separators measures 247px and scrolled for 7px, while the 7-row menu beside it with 1 separator did not. The cap is now 420px, clamped withmin()against the space Radix measures so a menu near a viewport edge stays on screen — which the flat value never did.CollapsedFileFolderItems,FileList) that were exported but never rendered, and extractsSidebarNavChipso the rail chip has one definition.Type of Change
Testing
bun run type-checkclean acrossapps/simandpackages/emcn;bun run lint,bun run check:audits(30/30), and the block-registry audit all pass. 217 sidebar/folders tests and 75 emcn tests green.Notes
The menu height class is shared by every
DropdownMenuContentandDropdownMenuSubContent, so menus that scrolled at 240px now grow to their content height up to 420px. Three call sites already override the class deliberately to be viewport-tall; those are unchanged. A deeper fix — invert the default to viewport-only and make the cap an opt-inmaxHeightprop for the long data-driven lists — is worth doing separately, but it is a larger design-system change than this bug warrants.Checklist