-
Notifications
You must be signed in to change notification settings - Fork 70
refactor(dashboard): move tabs to route segments #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
249b292
fix(dashboard): isolate tab routing and error boundaries
ben-fornefeld 5563a10
fix(dashboard): align root dashboard error boundary
ben-fornefeld b806cd8
style(dashboard): format route error component
ben-fornefeld 6c9db3f
refactor(dashboard): simplify shared tabs implementation
ben-fornefeld bcf86d2
fix(dashboard): refresh router on error retry
ben-fornefeld e7dfe80
fix(dashboard): satisfy strict tab indexing checks
ben-fornefeld ee8464c
refactor(dashboard): move tabs to route segments
ben-fornefeld 11cf9f7
fix(dashboard): support webpack builds with Next 16.2
ben-fornefeld cabdb74
fix(dashboard): expose tab URL map outside route handler
ben-fornefeld 8cadc98
fix(build): alias fs promises for webpack browser stubs
ben-fornefeld 1fd14c7
test(dashboard): cover E2B browser stubs and inspect SDK usage
ben-fornefeld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function AccountPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function BillingPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function BillingPlanPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/app/dashboard/[teamSlug]/billing/plan/select/error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function BillingPlanSelectPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function TeamDashboardError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function GeneralPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function KeysPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function LimitsPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function MembersPageError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
3 changes: 0 additions & 3 deletions
3
src/app/dashboard/[teamSlug]/sandboxes/(tabs)/@list/default.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/app/dashboard/[teamSlug]/sandboxes/(tabs)/@monitoring/default.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function SandboxesTabsError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,33 @@ | ||
| import { DashboardTab, DashboardTabs } from '@/ui/dashboard-tabs' | ||
| import { PROTECTED_URLS } from '@/configs/urls' | ||
| import { DashboardTabsList } from '@/ui/dashboard-tabs' | ||
| import { ListIcon, TrendIcon } from '@/ui/primitives/icons' | ||
|
|
||
| export default function SandboxesLayout({ | ||
| list, | ||
| monitoring, | ||
| }: LayoutProps<'/dashboard/[teamSlug]/sandboxes'> & { | ||
| list: React.ReactNode | ||
| monitoring: React.ReactNode | ||
| }) { | ||
| export default async function SandboxesTabsLayout({ | ||
| children, | ||
| params, | ||
| }: LayoutProps<'/dashboard/[teamSlug]/sandboxes'>) { | ||
| const { teamSlug } = await params | ||
|
|
||
| return ( | ||
| <DashboardTabs | ||
| type="query" | ||
| layoutKey="tabs-indicator-sandboxes" | ||
| className="mt-2 md:mt-3" | ||
| > | ||
| <DashboardTab | ||
| id="monitoring" | ||
| label="Monitoring" | ||
| icon={<TrendIcon className="size-4" />} | ||
| > | ||
| {monitoring} | ||
| </DashboardTab> | ||
| <DashboardTab | ||
| id="list" | ||
| label="List" | ||
| icon={<ListIcon className="size-4" />} | ||
| > | ||
| {list} | ||
| </DashboardTab> | ||
| </DashboardTabs> | ||
| <div className="mt-2 md:mt-3 min-h-0 h-full flex flex-col"> | ||
| <DashboardTabsList | ||
| layoutKey="tabs-indicator-sandboxes" | ||
| tabs={[ | ||
| { | ||
| id: 'monitoring', | ||
| label: 'Monitoring', | ||
| href: PROTECTED_URLS.SANDBOXES_MONITORING(teamSlug), | ||
| icon: <TrendIcon className="size-4" />, | ||
| }, | ||
| { | ||
| id: 'list', | ||
| label: 'List', | ||
| href: PROTECTED_URLS.SANDBOXES_LIST(teamSlug), | ||
| icon: <ListIcon className="size-4" />, | ||
| }, | ||
| ]} | ||
| /> | ||
| {children} | ||
| </div> | ||
| ) | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/app/dashboard/[teamSlug]/sandboxes/(tabs)/list/error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function SandboxesListError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/app/dashboard/[teamSlug]/sandboxes/(tabs)/monitoring/error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function SandboxesMonitoringError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
18 changes: 14 additions & 4 deletions
18
...ug]/sandboxes/(tabs)/@monitoring/page.tsx → ...lug]/sandboxes/(tabs)/monitoring/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| export default function SandboxesTabsPage() { | ||
| return null // this page is not used, it's just to satisfy the parallel routes | ||
| import { redirect } from 'next/navigation' | ||
| import { PROTECTED_URLS } from '@/configs/urls' | ||
|
|
||
| export default async function SandboxesTabsPage({ | ||
| params, | ||
| }: PageProps<'/dashboard/[teamSlug]/sandboxes'>) { | ||
| const { teamSlug } = await params | ||
|
|
||
| redirect(PROTECTED_URLS.SANDBOXES_MONITORING(teamSlug)) | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/app/dashboard/[teamSlug]/sandboxes/[sandboxId]/error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| 'use client' | ||
|
|
||
| import { DashboardRouteError } from '@/features/dashboard/shared/route-error' | ||
|
|
||
| export default function SandboxDetailsError({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error & { digest?: string } | ||
| reset: () => void | ||
| }) { | ||
| return <DashboardRouteError error={error} reset={reset} /> | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.