Skip to content

Commit 6b3e077

Browse files
royendoclaude
andcommitted
Pin breadcrumb resource swaps to /-/edit/... in dev-preview
When `inEditDevPreview` is true, set an explicit `href` on each visualization breadcrumb option so picking a different dashboard from the resource dropdown stays inside the dev-preview chrome (`${branch}/-/edit/{explore|canvas}/{name}`) instead of falling back to the production `${section}/${name}` path the breadcrumb linkMaker would otherwise build. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5fac16d commit 6b3e077

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

web-admin/src/features/projects/ProjectHeader.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,22 @@
168168
.reduce((map, resource) => {
169169
const name = resource.meta.name.name;
170170
const isMetricsExplorer = !!resource?.explore;
171+
const slug = isMetricsExplorer ? "explore" : "canvas";
172+
// In the dev-preview chrome, swapping resources via the breadcrumb
173+
// dropdown should keep the user inside `/-/edit/...`. Set an
174+
// explicit `href` that pins the edit prefix; otherwise fall back
175+
// to the production-style `${section}/${name}` path linkMaker
176+
// builds from `section` alone.
177+
const href = inEditDevPreview
178+
? `/${organization}/${project}${branchPathPrefix(activeBranch)}/-/edit/${slug}/${name}`
179+
: undefined;
171180
return map.set(name.toLowerCase(), {
172181
label:
173182
(isMetricsExplorer
174183
? resource?.explore?.spec?.displayName
175184
: resource?.canvas?.spec?.displayName) || name,
176-
section: isMetricsExplorer ? "explore" : "canvas",
185+
section: slug,
186+
href,
177187
resourceKind: isMetricsExplorer
178188
? ResourceKind.Explore
179189
: ResourceKind.Canvas,

0 commit comments

Comments
 (0)