Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions web-admin/src/routes/-/embed/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import { ResourceKind } from "@rilldata/web-common/features/entity-management/resource-selectors.ts";
import { featureFlags } from "@rilldata/web-common/features/feature-flags";
import DashboardChat from "@rilldata/web-common/features/chat/DashboardChat.svelte";
import ThemeProvider from "@rilldata/web-common/features/dashboards/ThemeProvider.svelte";
import { activeDashboardTheme } from "@rilldata/web-common/features/themes/active-dashboard-theme";
import {
createIframeRPCHandler,
emitNotification,
Expand Down Expand Up @@ -134,12 +136,14 @@
authContext="embed"
>
{#if showTopBar}
<div
class="flex items-center w-full pr-4 py-1 min-h-[2.5rem]"
class:border-b={!onProjectPage}
>
<EmbedHeader {activeResource} {navigationEnabled} />
</div>
<ThemeProvider theme={$activeDashboardTheme} applyLayout={false}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when there is no active dashboard?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there ever an embed state without an active dashboard?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, when you embed the home page; its cleared

So it's safe — when there's no active dashboard, the ThemeProvider just passes through with default/unthemed styling. Same behavior as DashboardChat.svelte which uses the same pattern.

<div
class="flex items-center w-full pr-4 py-1 min-h-[2.5rem] bg-surface-subtle"
class:border-b={!onProjectPage}
>
<EmbedHeader {activeResource} {navigationEnabled} />
</div>
</ThemeProvider>
{/if}

<div class="flex h-full overflow-hidden">
Expand Down
Loading