From 0a104da1cd0b0b0c9efb3e34ae834e0f7d9607d1 Mon Sep 17 00:00:00 2001 From: Dhiraj Kumar Date: Tue, 2 Jun 2026 21:21:52 +0530 Subject: [PATCH 01/12] fix explore styling --- .../docs/reference/project-files/component.md | 6 ++- proto/rill/ui/v1/dashboard.proto | 4 ++ .../ai/instructions/data/resources/canvas.md | 3 ++ runtime/parser/schema/project.schema.yaml | 6 +++ .../src/components/forms/Checkbox.svelte | 7 ++- .../pivot/CanvasPivotDisplay.svelte | 4 ++ .../features/canvas/components/pivot/index.ts | 31 ++++++++++++- .../canvas/inspector/ParamMapper.svelte | 8 ++-- .../components/charts/explore-transformer.ts | 2 + .../dashboards/pivot/PivotDisplay.svelte | 6 +++ .../dashboards/pivot/PivotToolbar.svelte | 43 ++++++++++++++++++- .../pivot/pivot-column-definition.ts | 6 ++- .../dashboards/pivot/pivot-data-store.ts | 4 +- .../dashboards/pivot/pivot-expansion.ts | 2 +- .../dashboards/pivot/pivot-row-selection.ts | 11 ++--- .../features/dashboards/pivot/pivot-utils.ts | 10 +++-- .../src/features/dashboards/pivot/types.ts | 2 + .../dashboards/proto-state/fromProto.ts | 4 ++ .../dashboards/proto-state/toProto.ts | 2 + .../dashboards/stores/dashboard-stores.ts | 14 ++++++ .../stores/get-rill-default-explore-state.ts | 2 + .../dashboards/stores/test-data/data.ts | 2 + .../stores/test-data/store-mutations.ts | 3 ++ ...ert-partial-explore-state-to-url-params.ts | 8 ++++ .../url-state/convertPresetToExploreState.ts | 6 +++ .../url-state/convertURLToExplorePreset.ts | 10 +++++ .../explore-web-view-specific-url-params.ts | 2 + .../url-state/getDefaultExplorePreset.ts | 2 + .../dashboards/url-state/url-params.ts | 2 + .../url-state/url-state-variations.spec.ts | 8 ++++ ...dashboard-from-aggregation-request.spec.ts | 8 ++++ .../get-dashboard-from-aggregation-request.ts | 2 + ...etrics-resolver-query-to-dashboard.spec.ts | 4 ++ ...map-metrics-resolver-query-to-dashboard.ts | 2 + .../src/proto/gen/rill/ui/v1/dashboard_pb.ts | 16 +++++++ .../src/runtime-client/gen/index.schemas.ts | 2 + 36 files changed, 233 insertions(+), 21 deletions(-) diff --git a/docs/docs/reference/project-files/component.md b/docs/docs/reference/project-files/component.md index 45dea5b13fc1..948bcc9f3702 100644 --- a/docs/docs/reference/project-files/component.md +++ b/docs/docs/reference/project-files/component.md @@ -264,6 +264,10 @@ _[object]_ - (no description) - **`col_dimensions`** - _[array of string]_ - Dimensions for table columns + - **`show_row_totals`** - _[boolean]_ - Whether to show the per-row totals column + + - **`show_col_totals`** - _[boolean]_ - Whether to show the column totals row + - **`comparison_range`** - _[string]_ - Comparison time range - **`filter`** - _[string]_ - Filter expression @@ -294,4 +298,4 @@ _[object]_ - (no description) - **`title`** - _[string]_ - Image title - - **`description`** - _[string]_ - Image description \ No newline at end of file + - **`description`** - _[string]_ - Image description diff --git a/proto/rill/ui/v1/dashboard.proto b/proto/rill/ui/v1/dashboard.proto index ef32cbc08015..f457936ca2e9 100644 --- a/proto/rill/ui/v1/dashboard.proto +++ b/proto/rill/ui/v1/dashboard.proto @@ -147,6 +147,10 @@ message DashboardState { optional bool pivot_enable_comparison = 34; // Row limit for pivot table (number of child rows to show under each dimension) optional int32 pivot_row_limit = 41; + // Show per-row totals column for pivot tables. + optional bool pivot_show_row_totals = 42; + // Show column totals row for pivot/flat tables. + optional bool pivot_show_col_totals = 43; // List of all dimensions selected for rows repeated PivotElement pivot_row_all_dimensions = 35; diff --git a/runtime/ai/instructions/data/resources/canvas.md b/runtime/ai/instructions/data/resources/canvas.md index 8836a20b8c15..7b0cde195af7 100644 --- a/runtime/ai/instructions/data/resources/canvas.md +++ b/runtime/ai/instructions/data/resources/canvas.md @@ -788,6 +788,8 @@ pivot: - total_revenue - order_count - average_order_value + show_row_totals: true + show_col_totals: true ``` **Simple pivot (rows only):** @@ -819,6 +821,7 @@ table: - total_revenue - order_count - average_price + show_col_totals: true ``` **With dimension filters:** diff --git a/runtime/parser/schema/project.schema.yaml b/runtime/parser/schema/project.schema.yaml index f9c57d64b7ab..5430ddc9276d 100644 --- a/runtime/parser/schema/project.schema.yaml +++ b/runtime/parser/schema/project.schema.yaml @@ -3265,6 +3265,12 @@ definitions: items: type: string description: Dimensions for table columns + show_row_totals: + type: boolean + description: Whether to show the per-row totals column + show_col_totals: + type: boolean + description: Whether to show the column totals row comparison_range: type: string description: Comparison time range diff --git a/web-common/src/components/forms/Checkbox.svelte b/web-common/src/components/forms/Checkbox.svelte index 35a1dac7bd2a..a2130c6015a2 100644 --- a/web-common/src/components/forms/Checkbox.svelte +++ b/web-common/src/components/forms/Checkbox.svelte @@ -9,6 +9,7 @@ type $$Props = CheckboxPrimitive.RootProps & { label?: string; + labelClass?: string; inverse?: boolean; hint?: string; optional?: boolean; @@ -17,6 +18,7 @@ export let checked: $$Props["checked"] = false; export let disabled: $$Props["disabled"] = undefined; export let label: $$Props["label"] = undefined; + export let labelClass: $$Props["labelClass"] = undefined; export let inverse = false; export let hint: string | undefined = undefined; export let optional: boolean = false; @@ -49,7 +51,10 @@ {#if label} -