Skip to content

feat(sidebar): add Tables and Files flyouts to the collapsed rail - #6882

Merged
waleedlatif1 merged 4 commits into
stagingfrom
feat/sidebar-tables-files
Aug 20, 2026
Merged

feat(sidebar): add Tables and Files flyouts to the collapsed rail#6882
waleedlatif1 merged 4 commits into
stagingfrom
feat/sidebar-tables-files

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Tables and Files now open a hover flyout on the collapsed rail, matching Chats and Workflows. Folders render as submenus, the open resource is marked, and the chip stays a real link so clicking still opens the list page and right-click still reaches the nav context menu.
  • 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.
  • 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 with enabled: false, so an unrelated writer (the table-import poller ticks every 2s) would re-render the whole sidebar for a flyout nobody opened.
  • Fixes a menu height bug that is not sidebar-specific: every DropdownMenuContent was 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 with min() against the space Radix measures so a menu near a viewport edge stays on screen — which the flat value never did.
  • Removes two dead components (CollapsedFileFolderItems, FileList) that were exported but never rendered, and extracts SidebarNavChip so the rail chip has one definition.

Type of Change

  • New feature
  • Bug fix

Testing

  • 11 new tests covering the entry builder (ordering, pinned-first, orphan hoisting, cycle dropping) and the flyout trigger. Each verified to fail when the code it covers is reverted.
  • bun run type-check clean across apps/sim and packages/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.
  • Not yet checked visually in a browser.

Notes

The menu height class is shared by every DropdownMenuContent and DropdownMenuSubContent, 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-in maxHeight prop for the long data-driven lists — is worth doing separately, but it is a larger design-system change than this bug warrants.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

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

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 20, 2026 1:47am

Request Review

@cursor

cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown

PR Summary

Cursor Bugbot is generating a summary for commit 49700d0. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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/5

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

Important Files Changed

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]
Loading

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

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

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

✅ 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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

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

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

@waleedlatif1
waleedlatif1 merged commit 02ae2b4 into staging Aug 20, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/sidebar-tables-files branch August 20, 2026 01:54
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