Skip to content

fix(ui): dashboard context menu works everywhere#85

Merged
NicholaiVogel merged 1 commit intomainfrom
fix/dashboard-context-menu
Feb 15, 2026
Merged

fix(ui): dashboard context menu works everywhere#85
NicholaiVogel merged 1 commit intomainfrom
fix/dashboard-context-menu

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Contributor

Summary

  • Right-click context menu now triggers across the entire dashboard viewport (sidebar, header, main content) instead of only within MainContent
  • Fixed pre-existing crash where NavFiles called useFiles() outside FilesProvider when sidebar was expanded on the files route

Changes

  • layout.tsx: Hoisted FeedbackWidget and DashboardContextMenu to wrap SidebarProvider, covering sidebar + header + content
  • main-content.tsx: Forward refs and spread props via React.ComponentPropsWithRef<"div"> for Radix asChild compatibility
  • use-files.tsx: Added useFilesOptional() hook that returns null instead of throwing outside provider
  • nav-files.tsx: Uses useFilesOptional() and conditionally renders StorageIndicator

Test plan

  • Right-click anywhere in dashboard viewport shows custom context menu
  • Right-click in sidebar shows context menu
  • Right-click on header shows context menu
  • Context menu items work (copy URL, toggle theme, navigate)
  • File browser items retain their own context menu
  • Expanding sidebar on /dashboard/files does not crash
  • Storage indicator still shows in files sidebar nav

Move DashboardContextMenu to wrap SidebarProvider so the
right-click menu triggers across the entire dashboard
viewport including sidebar, header, and main content.

- MainContent now forwards refs and spreads props for Radix
  asChild compatibility
- FeedbackWidget hoisted above SidebarProvider so
  DashboardContextMenu can access useFeedback from wider
  scope
- NavFiles uses useFilesOptional to avoid crash when
  rendered outside FilesProvider (sidebar is in dashboard
  layout, not files route layout)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 15, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
compass 32f686a Feb 15 2026, 11:58 PM

@NicholaiVogel NicholaiVogel merged commit 909af53 into main Feb 15, 2026
7 of 10 checks passed
@NicholaiVogel NicholaiVogel deleted the fix/dashboard-context-menu branch February 15, 2026 23:58
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