@lightdash/cli 0.3465.1 → 0.3467.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,100 @@
1
+ # Dashboard blueprint (dashboard attached to the prompt)
2
+
3
+ > Read this when the prompt announces an attached dashboard with a blueprint at
4
+ > `/tmp/dashboard/blueprint.json`.
5
+
6
+ ## Contents
7
+
8
+ - What the blueprint JSON contains
9
+ - How to map tabs, the tile grid, and tile types to app structure
10
+ - How to wire dashboard filters as interactive controls
11
+ - What to skip and when to deviate
12
+
13
+ The user attached a Lightdash dashboard. The blueprint is its full structural
14
+ definition — use it as the layout spec and recreate the dashboard's design,
15
+ instead of inventing a layout from scratch. The chart queries themselves live in
16
+ `/tmp/metric-queries/*.json` (see `chart-references.md`); the blueprint tells you
17
+ how those charts were arranged and filtered.
18
+
19
+ ## Blueprint shape
20
+
21
+ ```jsonc
22
+ {
23
+ "dashboardUuid": "…",
24
+ "name": "Sales overview", // use as the app title unless the user names it
25
+ "description": "…", // may be null
26
+ "tabs": [ // sorted by order; [] when the dashboard has no tabs
27
+ { "uuid": "tab-1", "name": "Summary", "order": 0, "hidden": false }
28
+ ],
29
+ "tiles": [ /* see below */ ],
30
+ "filters": { // dashboard-level filters
31
+ "dimensions": [ /* DashboardFilterRule */ ],
32
+ "metrics": [],
33
+ "tableCalculations": []
34
+ },
35
+ "parameters": { /* default parameter values, or null */ },
36
+ "config": { /* date-zoom settings etc., or null */ }
37
+ }
38
+ ```
39
+
40
+ ### Tiles
41
+
42
+ Every tile has: `uuid`, `type`, `x`, `y`, `w`, `h`, `tabUuid`, `properties`.
43
+
44
+ **Grid geometry:** positions are on a **36-column grid** — `x`/`w` are column
45
+ units (a full-width tile is `w: 36`, a half-width tile `w: 18`), `y`/`h` are row
46
+ units of roughly 55px. Translate proportionally into your layout (e.g. CSS grid
47
+ with 12 columns: divide `x`/`w` by 3). Preserve the relative arrangement — what
48
+ sits side by side, what spans full width, the top-to-bottom order — rather than
49
+ the pixel-exact math. `tabUuid` says which tab the tile belongs to (`null` when
50
+ the dashboard has no tabs).
51
+
52
+ Tile types and their `properties`:
53
+
54
+ - `saved_chart` — `savedChartUuid`, `chartName`, optional `title` (falls back to
55
+ the chart name) and `hideTitle`. **Match it to its metric-query file via
56
+ `savedChartUuid` = the `chartUuid` field inside each
57
+ `/tmp/metric-queries/*.json`.** Build the tile's visualization from that
58
+ file's `metricQuery` + `chartConfig` (or `savedChart(uuid)` when the file says
59
+ LINKED).
60
+ - `markdown` — `title`, `content` (markdown source). Recreate as a text/prose
61
+ section.
62
+ - `heading` — `text`, `showDivider`. Recreate as a section header.
63
+ - `loom` — `title`, `url`. Recreate as a link out to the video (do not embed
64
+ arbitrary iframes).
65
+ - `sql_chart` — `savedSqlUuid`, `chartName`. Its query is NOT available in
66
+ `/tmp/metric-queries/`. Keep its place in the layout: render a clearly
67
+ labelled placeholder card with the tile's title, or rebuild it from catalog
68
+ fields if the prompt makes the intent obvious.
69
+ - `data_app` — an embedded data app. Skip it; note it in a comment.
70
+
71
+ ### Tabs
72
+
73
+ Recreate tabs as top-level navigation (tab bar / segmented control), one view
74
+ per tab, tiles assigned by `tabUuid`, ordered by `order`. Skip tabs with
75
+ `hidden: true`. Single implicit tab (empty `tabs`) → a single page, no tab
76
+ chrome.
77
+
78
+ ### Dashboard filters
79
+
80
+ Each rule in `filters.dimensions` is a `DashboardFilterRule`: `target`
81
+ (`fieldId`, `tableName`), `operator`, `values`, `label`, and `tileTargets`.
82
+ Recreate these as the app's interactive filter controls (see the global-filters
83
+ guidance in `skill.md`):
84
+
85
+ - One control per rule; `label` (or the target field's label) is the control's
86
+ caption; `values` are the default selection; `disabled: true` means "no
87
+ default value" — start unfiltered.
88
+ - `tileTargets` maps tile `uuid` → the field to filter on for that tile, or
89
+ `false` when the rule must NOT apply to that tile. A missing entry means
90
+ "apply with the rule's own target field". Respect exclusions — that a chart is
91
+ exempt from a filter is deliberate dashboard design.
92
+ - Apply selections via `.filters()` — inline convention for `query(...)`,
93
+ qualified ids for `savedChart(...)` (rules in `chart-references.md`).
94
+
95
+ ## When to deviate
96
+
97
+ The blueprint wins on structure (tabs, arrangement, which filters exist) unless
98
+ the user's prompt asks for something different — the prompt always wins. You may
99
+ modernize presentation (spacing, typography, card styling per the design skill)
100
+ while keeping the structure recognizably the same dashboard.
@@ -148,6 +148,10 @@ These metrics are **not additive over time**. A balance on Monday plus the balan
148
148
 
149
149
  If the prompt lists referenced charts (files under `/tmp/metric-queries/*.json`), read `/app/references/chart-references.md` before writing any query code — it defines the JSON shape, linked-vs-copied chart semantics (`savedChart`), and the field-id mapping rules.
150
150
 
151
+ ## Attached dashboard blueprint
152
+
153
+ If the prompt announces an attached dashboard (blueprint at `/tmp/dashboard/blueprint.json`), read `/app/references/dashboard-blueprint.md` before designing any layout — the blueprint defines the dashboard's tabs, tile grid, and filters, and it is the layout spec to recreate unless the user asks for a different design.
154
+
151
155
  ## Linked external connections
152
156
 
153
157
  If the prompt lists external connections (files under `/tmp/external-data/`), read `/app/references/external-apis.md` before calling any external API — it documents each connection file and the `externalFetch` rules.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.3465.1",
3
+ "version": "0.3467.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "unique-names-generator": "4.7.1",
42
42
  "uuid": "11.1.1",
43
43
  "yaml": "2.8.3",
44
- "@lightdash/common": "0.3465.1",
45
- "@lightdash/warehouses": "0.3465.1"
44
+ "@lightdash/common": "0.3467.0",
45
+ "@lightdash/warehouses": "0.3467.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",