Skip to content

Modern Docker Management, Designed for Everyone

fix: route matching for resource detail pages when switching environments

Kyle Mendelldb552f546a68
diff --git a/frontend/src/lib/stores/environment.store.svelte.ts b/frontend/src/lib/stores/environment.store.svelte.ts
index be7b95c70..6afa80687 100644
--- a/frontend/src/lib/stores/environment.store.svelte.ts
+++ b/frontend/src/lib/stores/environment.store.svelte.ts
@@ -14,8 +14,10 @@ function getResourceListPage(): string | null {
const resourcePrefixes = ['/containers', '/images', '/projects', '/networks', '/volumes'];
for (const prefix of resourcePrefixes) {
- // Match routes like /containers/[containerId] but not /containers or /containers/components/...
- if (routeId.startsWith(prefix + '/[') && !routeId.includes('/components/')) {
+ // Match routes like /containers/[containerId] or /(app)/containers/[containerId]
+ // but not /containers or /containers/components/...
+ const pattern = prefix + '/[';
+ if (routeId.includes(pattern) && !routeId.includes('/components/')) {
return prefix;
}
}
diff --git a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
index a1427cdec..4f8a32d06 100644
--- a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
+++ b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
@@ -483,15 +483,17 @@
</Tabs.Content>
{/snippet}
</TabbedPageLayout>
-{:else if !data.error}
+{:else}
<div class="flex min-h-screen items-center justify-center">
<div class="text-center">
<div class="bg-muted/50 mb-6 inline-flex rounded-full p-6">
<ProjectsIcon class="text-muted-foreground size-10" />
</div>
- <h2 class="mb-3 text-2xl font-medium">{m.common_not_found_title({ resource: m.project() })}</h2>
+ <h2 class="mb-3 text-2xl font-medium">
+ {data.error ? 'Error Loading Project' : m.common_not_found_title({ resource: m.project() })}
+ </h2>
<p class="text-muted-foreground mb-8 max-w-md text-center">
- {m.common_not_found_description({ resource: m.project().toLowerCase() })}
+ {data.error || m.common_not_found_description({ resource: m.project().toLowerCase() })}
</p>
<ArcaneButton
action="base"