Skip to content

Commit e5d3452

Browse files
royendoclaude
andcommitted
Tint dev-preview header and polish the breadcrumb visuals
Visual-only changes layered on top of PR-3's dev-preview chrome: - `Header` gains a `tinted` prop that swaps `bg-surface-base` for `bg-surface-active`. `ProjectHeader` passes `tinted={inEditDevPreview}` so the dev-preview surface (`/-/edit/{dashboards,status,ai,explore,canvas}`) picks up a soft tint that signals "editing-in-progress" at a glance. - Render a `Tag` of the current mode ("Developer" on the editor side, "Preview" on the dev-preview surface) next to the logo, mirroring local's mode tag. - Add a `theme` color variant to `Tag` (`bg-surface-base` / `border-border` / `text-fg-secondary`) so the mode pill flips to a neutral dark surface in dark mode instead of the light-only gray-100 fill. - Replace the active-branch pill with a proper breadcrumb segment (`Slash` + `GitBranch` icon + branch name), so the trail reads `org / project / branch / resource` like the production header. - `BreadcrumbItem` renders the resource-kind icon next to the selected label, so the resource segment shows its kind glyph (e.g. an Explore icon before a dashboard name). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4356353 commit e5d3452

4 files changed

Lines changed: 32 additions & 11 deletions

File tree

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
import { sidebarActions } from "@rilldata/web-common/features/chat/layouts/sidebar/sidebar-store";
1616
import { skipNextPlatformReset } from "@rilldata/web-common/features/preview-mode/platform-reset";
1717
import Breadcrumbs from "@rilldata/web-common/components/navigation/breadcrumbs/Breadcrumbs.svelte";
18+
import Slash from "@rilldata/web-common/components/navigation/breadcrumbs/Slash.svelte";
1819
import type { PathOption } from "@rilldata/web-common/components/navigation/breadcrumbs/types";
20+
import { GitBranch } from "lucide-svelte";
1921
import { useCanvas } from "@rilldata/web-common/features/canvas/selector";
2022
import ChatToggle from "@rilldata/web-common/features/chat/layouts/sidebar/ChatToggle.svelte";
2123
import GlobalDimensionSearch from "@rilldata/web-common/features/dashboards/dimension-search/GlobalDimensionSearch.svelte";
2224
import StateManagersProvider from "@rilldata/web-common/features/dashboards/state-managers/StateManagersProvider.svelte";
2325
import { ResourceKind } from "@rilldata/web-common/features/entity-management/resource-selectors";
2426
import { useExplore } from "@rilldata/web-common/features/explores/selectors";
2527
import { featureFlags } from "@rilldata/web-common/features/feature-flags";
28+
import Tag from "@rilldata/web-common/components/tag/Tag.svelte";
2629
import Header from "@rilldata/web-common/layout/header/Header.svelte";
2730
import HeaderLogo from "@rilldata/web-common/layout/header/HeaderLogo.svelte";
2831
import PreviewModeToggleButton from "@rilldata/web-common/layout/header/PreviewModeToggleButton.svelte";
@@ -236,21 +239,27 @@
236239
$: currentPath = [organization, project, currentDashboard, report || alert];
237240
</script>
238241

239-
<Header borderBottom={!onProjectPage && !inEditDevPreview}>
242+
<Header
243+
borderBottom={!onProjectPage && !inEditDevPreview}
244+
tinted={inEditDevPreview}
245+
>
240246
<HeaderLogo href={rillLogoHref} logoUrl={organizationLogoUrl} />
247+
{#if editContext}
248+
<Tag text={inEditDevPreview ? "Preview" : "Developer"} color="theme" />
249+
{/if}
241250
{#if onPublicURLPage}
242251
<PageTitle title={publicURLDashboardTitle} />
243252
{:else if organization}
244253
<Breadcrumbs {pathParts} {currentPath}>
245254
<svelte:fragment slot="after-project">
246255
{#if editContext && activeBranch}
247-
<li class="flex items-center mr-2">
248-
<span
249-
class="inline-block truncate max-w-[200px] px-2 py-0 rounded-2xl border bg-primary-50 border-primary-200 text-primary-800"
250-
title={activeBranch}
251-
>
252-
{activeBranch}
253-
</span>
256+
<Slash />
257+
<li
258+
class="flex items-center gap-x-1 px-2 text-fg-primary text-xs font-medium"
259+
title={activeBranch}
260+
>
261+
<GitBranch size="14" />
262+
<span class="truncate max-w-[200px]">{activeBranch}</span>
254263
</li>
255264
{:else if !onPublicURLPage && projectPermissions?.manageDev}
256265
<BranchSelector {organization} {project} {primaryBranch} />

web-common/src/components/navigation/breadcrumbs/BreadcrumbItem.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
1919
$: ({ options, carryOverSearchParams } = pathOptions);
2020
$: selected = options.get(current.toLowerCase());
21+
$: selectedIcon = selected?.resourceKind
22+
? resourceIconMapping[selected.resourceKind]
23+
: undefined;
2124
2225
function linkMaker(
2326
current: (string | undefined)[],
@@ -71,9 +74,12 @@
7174
href={isCurrentPage
7275
? "#top"
7376
: linkMaker(currentPath, depth, current, selected, "")}
74-
class="text-fg-muted hover:text-fg-secondary flex flex-row items-center gap-x-2"
77+
class="text-fg-muted hover:text-fg-secondary flex flex-row items-center gap-x-1.5"
7578
class:current={isCurrentPage}
7679
>
80+
{#if selectedIcon}
81+
<svelte:component this={selectedIcon} size="14px" />
82+
{/if}
7783
<span>{selected?.label}</span>
7884
</a>
7985
{#if selected?.pill}

web-common/src/components/tag/Tag.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
| "orange"
99
| "amber"
1010
| "blue"
11-
| "purple";
11+
| "purple"
12+
| "theme";
1213
</script>
1314

1415
<script lang="ts">
@@ -40,6 +41,8 @@
4041
return "bg-primary-50 border-primary-300 text-primary-600";
4142
case "purple":
4243
return "bg-purple-50 border-purple-300 text-purple-600";
44+
case "theme":
45+
return "bg-surface-base border-border text-fg-secondary";
4346
default:
4447
return "bg-gray-100 border-gray-300 text-fg-secondary";
4548
}

web-common/src/layout/header/Header.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<script lang="ts">
22
export let borderBottom: boolean = false;
3+
export let tinted: boolean = false;
34
</script>
45

56
<header
6-
class="flex items-center w-full pr-4 pl-2 py-1 bg-surface-base border-b"
7+
class="flex items-center w-full pr-4 pl-2 py-1 border-b"
8+
class:bg-surface-base={!tinted}
9+
class:bg-surface-active={tinted}
710
class:border-transparent={!borderBottom}
811
>
912
<slot />

0 commit comments

Comments
 (0)