Skip to content

Commit f22e4b2

Browse files
royendoclaude
andcommitted
fix: final passes at Snowflake and preview mode fixes (#9196)
* snowflake reverts * Update snowflake.go * revert go to olap true, add front end override add scaffolding for snowflake toggle * too eager; reverting to simpler; * prettier * forgot to revert this * show breadcrumbs on viz routes regardless of mode The previous commit removed the (viz) route override for mode, but that also removed breadcrumbs from explore/canvas routes in developer mode. Now breadcrumbs show whenever on a viz route, while the mode tag and CTAs correctly reflect developer vs preview state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * prettier * fix color selector svelte upgrade --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c9361b8 commit f22e4b2

8 files changed

Lines changed: 30 additions & 17 deletions

File tree

web-common/src/components/color-picker/ColorInput.svelte

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@
1818
1919
let open = false;
2020
21-
$: ({ h: hue, s: saturation, l: lightness } = stringColorToHsl(stringColor));
21+
// Use a reactive block (not destructuring assignment) so that hue/saturation/lightness
22+
// are plain state variables, not derived. Derived values are read-only in Svelte 5 compat
23+
// and can't be updated via bind:value on the sliders.
24+
let hue = 0;
25+
let saturation = 100;
26+
let lightness = 50;
27+
$: {
28+
const parsed = stringColorToHsl(stringColor);
29+
hue = parsed.h;
30+
saturation = parsed.s;
31+
lightness = parsed.l;
32+
}
2233
2334
$: hsl = `hsl(${hue}, ${saturation}%, ${lightness}%)`;
2435

web-common/src/components/color-picker/ColorSlider.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
min="0"
3838
max={mode === "hue" ? 360 : 100}
3939
bind:value
40-
onchange={onChange}
40+
oninput={onChange}
4141
/>
4242

4343
<input

web-common/src/features/add-data/form/ImportTableForm.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
getAnalyzedConnectorByName,
1111
getAnalyzedConnectors,
1212
} from "@rilldata/web-common/features/connectors/selectors.ts";
13+
1314
import { Button } from "@rilldata/web-common/components/button";
1415
import {
1516
type AddDataConfig,

web-common/src/features/add-data/manager/steps/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export function isExplorerType(connectorDriver: V1ConnectorDriver) {
7979
}
8080

8181
export function isLiveConnectorType(connectorDriver: V1ConnectorDriver) {
82-
return !!connectorDriver?.implementsOlap;
82+
return (
83+
!!connectorDriver?.implementsOlap && !connectorDriver?.implementsWarehouse
84+
);
8385
}
8486

8587
const NonModelSteps = [
@@ -92,8 +94,6 @@ export function getImportStepsForConnector(
9294
config: AddDataConfig,
9395
driver: V1ConnectorDriver,
9496
) {
95-
// Live connectors cannot create models as of now.
96-
// They will create metrics views directly.
9797
const steps = isLiveConnectorType(driver) ? NonModelSteps : FullListOfSteps;
9898
return config.importOnly ? [steps[0]] : steps;
9999
}

web-common/src/features/sources/modal/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const SOURCES = [
9191
"postgres",
9292
"redshift",
9393
"s3",
94+
"snowflake",
9495
"sqlite",
9596
"supabase",
9697
"https",
@@ -99,7 +100,6 @@ export const SOURCES = [
99100

100101
export const OLAP_ENGINES = [
101102
"clickhouse",
102-
"snowflake",
103103
"motherduck",
104104
"duckdb",
105105
"druid",

web-common/src/features/templates/schemas/snowflake.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import type { MultiStepFormSchema } from "./types";
22

3+
// TODO: Add a "Use as OLAP engine" toggle to the Snowflake form.
4+
// When enabled, set olap_connector: snowflake in rill.yaml so
5+
// isLiveConnectorType resolves true and skips DuckDB ingestion.
36
export const snowflakeSchema: MultiStepFormSchema = {
47
$schema: "http://json-schema.org/draft-07/schema#",
58
type: "object",
69
title: "Snowflake",
7-
"x-category": "olap",
10+
"x-category": "warehouse",
811
"x-form-height": "tall",
912
properties: {
1013
auth_method: {

web-common/src/layout/ApplicationHeader.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
route,
3838
} = $page);
3939
40+
$: onVizRoute = route.id?.includes("explore") || route.id?.includes("canvas");
41+
4042
$: ({ unsavedFiles } = fileArtifacts);
4143
$: ({ size: unsavedFileCount } = $unsavedFiles);
4244
$: onDeployPage = isDeployPage($page);
@@ -102,7 +104,7 @@
102104

103105
<Tag text={mode} color="gray"></Tag>
104106

105-
{#if mode === "Preview"}
107+
{#if mode === "Preview" || onVizRoute}
106108
{#if $exploresQuery?.data}
107109
<Breadcrumbs {pathParts} {currentPath} />
108110
{/if}
@@ -120,12 +122,10 @@
120122
{/if}
121123

122124
<div class="flex gap-x-2 items-center ml-auto">
123-
{#if mode === "Preview"}
124-
{#if route.id?.includes("explore")}
125-
<ExplorePreviewCTAs exploreName={dashboardName} />
126-
{:else if route.id?.includes("canvas")}
127-
<CanvasPreviewCTAs canvasName={dashboardName} />
128-
{/if}
125+
{#if route.id?.includes("explore")}
126+
<ExplorePreviewCTAs exploreName={dashboardName} />
127+
{:else if route.id?.includes("canvas")}
128+
<CanvasPreviewCTAs canvasName={dashboardName} />
129129
{:else if showDeveloperChat}
130130
<ChatToggle />
131131
{/if}

web-local/src/routes/+layout.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@
9797
$: onDeployPage = isDeployPage($page);
9898
$: isPreviewMode = $previewModeStore;
9999
100-
// Preview mode from store OR (viz) route group
101-
$: mode =
102-
isPreviewMode || route.id?.includes("(viz)") ? "Preview" : "Developer";
100+
$: mode = isPreviewMode ? "Preview" : "Developer";
103101
104102
$: shouldShowPreviewNav =
105103
isPreviewMode && showPreviewNav($page.url.pathname) && !onDeployPage;

0 commit comments

Comments
 (0)