@antelopejs/dms-ai 0.7.0 → 0.9.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.
- package/README.md +17 -7
- package/dist/lifecycle/skill-sources.js +17 -17
- package/dist/lifecycle/skill-sources.js.map +1 -1
- package/dist/pages/settings/availability.js.map +1 -1
- package/dist/pages/settings/sections.js +10 -0
- package/dist/pages/settings/sections.js.map +1 -1
- package/dist/routes/builder.d.ts +7 -1
- package/dist/routes/builder.js +3 -0
- package/dist/routes/builder.js.map +1 -1
- package/dist/routes/changes.d.ts +5 -4
- package/dist/routes/changes.js.map +1 -1
- package/dist/routes/codex-account.d.ts +3 -2
- package/dist/routes/codex-account.js.map +1 -1
- package/dist/routes/sidecar-results.d.ts +2 -2
- package/dist/routes/sidecar-results.js.map +1 -1
- package/dist/routes/status.js.map +1 -1
- package/dist/sidecar/http-client.js +3 -1
- package/dist/sidecar/http-client.js.map +1 -1
- package/dist/sidecar/index.d.ts +1 -0
- package/dist/sidecar/index.js +1 -0
- package/dist/sidecar/index.js.map +1 -1
- package/dist/sidecar/json-body.d.ts +4 -0
- package/dist/sidecar/json-body.js +33 -0
- package/dist/sidecar/json-body.js.map +1 -0
- package/dist/sidecar/settings-values.d.ts +5 -2
- package/dist/sidecar/settings-values.js.map +1 -1
- package/dist/vocabulary/tools.js +3 -0
- package/dist/vocabulary/tools.js.map +1 -1
- package/frontend-vue/app/chat/components/ChatView.vue +38 -37
- package/frontend-vue/app/chat/components/NoticeCard.vue +16 -0
- package/frontend-vue/app/chat/components/PanelHeader.vue +2 -6
- package/frontend-vue/app/chat/composables/conversation-events.ts +4 -0
- package/frontend-vue/app/chat/composables/useConversation.ts +6 -0
- package/frontend-vue/app/chat/types/protocol.ts +9 -1
- package/frontend-vue/app/chat/utils/status-label.ts +50 -0
- package/frontend-vue/app/chat/utils/tool-lexicon.ts +16 -0
- package/frontend-vue/app/components/SkillDetail.vue +1 -1
- package/frontend-vue/app/plugins/ai.client.ts +2 -2
- package/frontend-vue/app/runtime/assistant-actions.ts +4 -2
- package/frontend-vue/app/runtime/assistant-session.ts +5 -1
- package/frontend-vue/app/runtime/block-health.ts +135 -0
- package/frontend-vue/app/runtime/constants.ts +1 -0
- package/frontend-vue/app/runtime/navigation-complete.ts +47 -6
- package/frontend-vue/app/runtime/panel-intents.ts +6 -2
- package/frontend-vue/app/views/ChangeSetPanel.vue +1 -1
- package/frontend-vue/app/views/composables/useAiData.ts +10 -18
- package/frontend-vue/app/views/composables/useChangeSetActions.ts +5 -15
- package/frontend-vue/app/views/constants.ts +1 -1
- package/frontend-vue/app/views/types.ts +1 -1
- package/frontend-vue/build/backend-boundary.ts +54 -21
- package/frontend-vue/i18n/locales/dms-ai-pages-en-GB.json +7 -0
- package/frontend-vue/i18n/locales/dms-ai-pages-fr-FR.json +7 -0
- package/frontend-vue/i18n/locales/dms-ai-panel-en-GB.json +6 -1
- package/frontend-vue/i18n/locales/dms-ai-panel-fr-FR.json +6 -1
- package/frontend-vue/tests/assistant-actions.test.ts +37 -0
- package/frontend-vue/tests/block-health.test.ts +142 -0
- package/frontend-vue/tests/chat/conversation-events.test.ts +34 -0
- package/frontend-vue/tests/chat/tool-lexicon.test.ts +1 -0
- package/frontend-vue/tests/navigation.test.ts +67 -2
- package/frontend-vue/tests/support/api-error-presenter.ts +28 -0
- package/frontend-vue/tests/support/panel-harness.ts +2 -2
- package/frontend-vue/tests/views/api-data-reads.test.ts +2 -0
- package/frontend-vue/tests/views/api-error-presentation.test.ts +89 -0
- package/package.json +7 -6
- package/sidecar/dist/agent/provider.d.ts +5 -0
- package/sidecar/dist/agent/runner.d.ts +5 -0
- package/sidecar/dist/agent/runner.js +2 -0
- package/sidecar/dist/agent/runner.js.map +1 -1
- package/sidecar/dist/builder/builder-client.js +2 -2
- package/sidecar/dist/builder/builder-client.js.map +1 -1
- package/sidecar/dist/constants/builder.d.ts +2 -1
- package/sidecar/dist/constants/builder.js +12 -0
- package/sidecar/dist/constants/builder.js.map +1 -1
- package/sidecar/dist/constants/claude.d.ts +2 -0
- package/sidecar/dist/constants/claude.js +2 -0
- package/sidecar/dist/constants/claude.js.map +1 -1
- package/sidecar/dist/constants/mcp.d.ts +1 -1
- package/sidecar/dist/constants/mcp.js +1 -1
- package/sidecar/dist/constants/mcp.js.map +1 -1
- package/sidecar/dist/constants/native-binary.d.ts +5 -2
- package/sidecar/dist/constants/native-binary.js +5 -2
- package/sidecar/dist/constants/native-binary.js.map +1 -1
- package/sidecar/dist/constants/settings.d.ts +1 -0
- package/sidecar/dist/constants/settings.js +2 -0
- package/sidecar/dist/constants/settings.js.map +1 -1
- package/sidecar/dist/constants/timing.d.ts +1 -0
- package/sidecar/dist/constants/timing.js +1 -0
- package/sidecar/dist/constants/timing.js.map +1 -1
- package/sidecar/dist/constants/tool-kinds.js +1 -0
- package/sidecar/dist/constants/tool-kinds.js.map +1 -1
- package/sidecar/dist/logs/logs-client.js +2 -1
- package/sidecar/dist/logs/logs-client.js.map +1 -1
- package/sidecar/dist/logs/types.d.ts +2 -1
- package/sidecar/dist/mcp/define-tool.d.ts +1 -1
- package/sidecar/dist/mcp/define-tool.js.map +1 -1
- package/sidecar/dist/mcp/tools/builder-compose.d.ts +51 -0
- package/sidecar/dist/mcp/tools/builder-compose.js +96 -0
- package/sidecar/dist/mcp/tools/builder-compose.js.map +1 -0
- package/sidecar/dist/mcp/tools/builder-expr.d.ts +5 -0
- package/sidecar/dist/mcp/tools/builder-expr.js +25 -0
- package/sidecar/dist/mcp/tools/builder-expr.js.map +1 -0
- package/sidecar/dist/mcp/tools/builder-gate.js +2 -2
- package/sidecar/dist/mcp/tools/builder-gate.js.map +1 -1
- package/sidecar/dist/mcp/tools/builder-project.js +54 -1
- package/sidecar/dist/mcp/tools/builder-project.js.map +1 -1
- package/sidecar/dist/mcp/tools/builder-queries.d.ts +65 -0
- package/sidecar/dist/mcp/tools/builder-queries.js +73 -0
- package/sidecar/dist/mcp/tools/builder-queries.js.map +1 -0
- package/sidecar/dist/mcp/tools/builder-table-view-schema.d.ts +99 -0
- package/sidecar/dist/mcp/tools/builder-table-view-schema.js +118 -0
- package/sidecar/dist/mcp/tools/builder-table-view-schema.js.map +1 -0
- package/sidecar/dist/mcp/tools/builder-table-view.d.ts +102 -0
- package/sidecar/dist/mcp/tools/builder-table-view.js +24 -0
- package/sidecar/dist/mcp/tools/builder-table-view.js.map +1 -0
- package/sidecar/dist/mcp/tools/builder.d.ts +166 -20
- package/sidecar/dist/mcp/tools/builder.js +20 -73
- package/sidecar/dist/mcp/tools/builder.js.map +1 -1
- package/sidecar/dist/mcp/tools/navigate-to-page.js +12 -4
- package/sidecar/dist/mcp/tools/navigate-to-page.js.map +1 -1
- package/sidecar/dist/mcp/types.d.ts +2 -1
- package/sidecar/dist/pages/block-health.d.ts +14 -0
- package/sidecar/dist/pages/block-health.js +60 -0
- package/sidecar/dist/pages/block-health.js.map +1 -0
- package/sidecar/dist/prompts/agent.d.ts +1 -1
- package/sidecar/dist/prompts/agent.js +4 -3
- package/sidecar/dist/prompts/agent.js.map +1 -1
- package/sidecar/dist/protocol/events.d.ts +43 -0
- package/sidecar/dist/protocol/events.js +10 -0
- package/sidecar/dist/protocol/events.js.map +1 -1
- package/sidecar/dist/protocol/json.d.ts +4 -0
- package/sidecar/dist/protocol/json.js +29 -0
- package/sidecar/dist/protocol/json.js.map +1 -1
- package/sidecar/dist/protocol/messages.d.ts +57 -0
- package/sidecar/dist/protocol/messages.js +22 -0
- package/sidecar/dist/protocol/messages.js.map +1 -1
- package/sidecar/dist/providers/claude/config.d.ts +20 -3
- package/sidecar/dist/providers/claude/config.js +17 -5
- package/sidecar/dist/providers/claude/config.js.map +1 -1
- package/sidecar/dist/providers/claude/model-fallback.d.ts +9 -0
- package/sidecar/dist/providers/claude/model-fallback.js +37 -0
- package/sidecar/dist/providers/claude/model-fallback.js.map +1 -0
- package/sidecar/dist/providers/claude/provider.js +23 -22
- package/sidecar/dist/providers/claude/provider.js.map +1 -1
- package/sidecar/dist/providers/claude/resolve-binary.js +18 -13
- package/sidecar/dist/providers/claude/resolve-binary.js.map +1 -1
- package/sidecar/dist/providers/claude/session-stream.d.ts +23 -0
- package/sidecar/dist/providers/claude/session-stream.js +58 -0
- package/sidecar/dist/providers/claude/session-stream.js.map +1 -0
- package/sidecar/dist/server/chat-events.d.ts +16 -3
- package/sidecar/dist/server/chat-events.js +1 -0
- package/sidecar/dist/server/chat-events.js.map +1 -1
- package/sidecar/dist/server/http-io.d.ts +2 -1
- package/sidecar/dist/server/http-io.js.map +1 -1
- package/sidecar/dist/server/http-routes.js +4 -7
- package/sidecar/dist/server/http-routes.js.map +1 -1
- package/sidecar/dist/server/navigation-completer.d.ts +15 -2
- package/sidecar/dist/server/navigation-completer.js +42 -41
- package/sidecar/dist/server/navigation-completer.js.map +1 -1
- package/sidecar/dist/server/permission-events.d.ts +8 -4
- package/sidecar/dist/server/permission-events.js.map +1 -1
- package/sidecar/dist/server/routing.js +15 -2
- package/sidecar/dist/server/routing.js.map +1 -1
- package/sidecar/dist/server/safety-net.js +2 -2
- package/sidecar/dist/server/safety-net.js.map +1 -1
- package/sidecar/dist/server/tool-calls.d.ts +13 -4
- package/sidecar/dist/server/tool-calls.js.map +1 -1
- package/sidecar/dist/server/turns.d.ts +16 -2
- package/sidecar/dist/server/turns.js +13 -3
- package/sidecar/dist/server/turns.js.map +1 -1
- package/sidecar/dist/state/change-sets.js +4 -1
- package/sidecar/dist/state/change-sets.js.map +1 -1
- package/sidecar/dist/state/conversations.d.ts +1 -0
- package/sidecar/dist/state/conversations.js +8 -0
- package/sidecar/dist/state/conversations.js.map +1 -1
- package/sidecar/dist/state/settings-store.d.ts +1 -0
- package/sidecar/dist/state/settings-store.js +1 -0
- package/sidecar/dist/state/settings-store.js.map +1 -1
- package/sidecar/dist/state/settings-types.d.ts +1 -0
- package/sidecar/dist/state/store.js +8 -2
- package/sidecar/dist/state/store.js.map +1 -1
- package/sidecar/dist/state/types.d.ts +8 -1
- package/sidecar/dist/state/types.js.map +1 -1
- package/sidecar/package.json +2 -2
- package/skills/dms-ai/SKILL.md +1 -1
- package/skills/dms-builder-safe/REFERENCE.md +5 -6
- package/skills/dms-builder-safe/SKILL.md +12 -10
- package/skills/dms-external-database/REFERENCE.md +20 -8
- package/skills/dms-external-database/SKILL.md +64 -18
- package/skills/dms-page-design/SKILL.md +192 -0
- package/skills/dms-page-design/cases.json +57 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dms-page-design
|
|
3
|
+
description: Designs DMS pages that show data, through the Builder tools. Use when building or changing an analytics, stats or dashboard page or a table page, choosing a chart or a KPI for some data, picking a page's period, naming a page and its icon, or deciding how a table displays (badges, prices, relation labels, status tabs, saved views, kanban, cards, footer totals, KPI cards above the table).
|
|
4
|
+
icon: i-ph-chart-pie-slice
|
|
5
|
+
category: Builder
|
|
6
|
+
tags: [Pages, Charts, Dashboard, Tables, DMS]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Designing data pages
|
|
10
|
+
|
|
11
|
+
A data page answers the questions its owner asks about the data. Each block answers one
|
|
12
|
+
question, and its title says which ("Revenue per month", "Top 10 countries by revenue").
|
|
13
|
+
Build every page from the questions, the shapes below and the checks at the end, in that
|
|
14
|
+
order, so that two runs over the same data produce the same page.
|
|
15
|
+
|
|
16
|
+
This skill decides **what** to build. The tools and their arguments are in `dms-builder-safe`
|
|
17
|
+
(safe mode) and `dms-pages` (code); `dms-best-practices` still holds.
|
|
18
|
+
|
|
19
|
+
## Pick the block from the data's shape
|
|
20
|
+
|
|
21
|
+
| The data | Block | Query |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| A measure or a row count over time | `ChartCard` around `ChartArea`, full width | `series`, `groupBy` the time axis, `bucket`, `response: "card"` |
|
|
24
|
+
| A second series over time (orders beside revenue) | `ChartCard` around `ChartColumn` or `ChartLine` | as above |
|
|
25
|
+
| A column with 2 to 6 values (status, segment, media type) | `ChartCard` around `ChartDonut`, with `showSeriesLegend: true` | `series`, `groupBy` the column, `response: "card"` |
|
|
26
|
+
| A column with 7 or more values, a top N | A bare `ChartBar`, or a `TopListCard` with `showBar` | `series`, `orderBy: "measure"`, `direction: "desc"`, `limit: 10`; `response: "card"` for the chart, `"items"` for the list |
|
|
27
|
+
| One figure with its trend (revenue, orders, customers) | `KpiCard` with `showDelta`, `showSparkline` | `series` by the time axis (never `count` or `aggregate`, which answer no previous period and no sparkline), `response: "value"`, `compare: true` |
|
|
28
|
+
| Numbers used as categories (a rating 1 to 5, a year) | `ChartCard` around `ChartColumn` with `xaxisType: "category"` | `series`, `groupBy` the column |
|
|
29
|
+
| A status column on a table | Tabs on the `TableView`, plus a donut on the analytics page | see *Tables* |
|
|
30
|
+
|
|
31
|
+
- Put a chart in a `ChartCard`: it adds the headline figure. In safe mode its `chart` is a
|
|
32
|
+
nested block value, `{ "$block": { "type": "ChartArea", "config": {} } }`. A horizontal
|
|
33
|
+
`ChartBar` stays bare: inside a card its category labels read `NaN`.
|
|
34
|
+
- The `response` must match the block: `card` for a `ChartCard` or a bare chart, `value` for a
|
|
35
|
+
`KpiCard`, `items` for a `TopListCard`. Any other pairing draws nothing.
|
|
36
|
+
- Compare periods on KPI cards and top lists (`compare: true`), never on a chart over time:
|
|
37
|
+
the previous period's buckets are other categories, so they draw beside the period instead
|
|
38
|
+
of under it.
|
|
39
|
+
- Sum a measure that adds up (a total, a quantity). Count rows for everything else. Never sum
|
|
40
|
+
a unit price or a rate.
|
|
41
|
+
- Format money with `valueFormat: "currency"` and a `currencyCode` only when the data names its
|
|
42
|
+
currency (a currency column, a comment). Otherwise use `valueFormat: "number"`: the default
|
|
43
|
+
currency is the euro, and a wrong symbol is worse than none.
|
|
44
|
+
- Grouping by a foreign key shows ids. Group by the relation's own columns only; a breakdown by
|
|
45
|
+
a related entity's name goes under *Not possible yet* in your report.
|
|
46
|
+
|
|
47
|
+
## Lay out an analytics page
|
|
48
|
+
|
|
49
|
+
Add the blocks in this order. Every analytics page has items 1 to 4.
|
|
50
|
+
|
|
51
|
+
1. A `PageToolbar` holding a `PeriodSelector`, first on the page (see *Period*).
|
|
52
|
+
2. One `GridRow` of 3 or 4 `KpiCard`s, each bound to the period.
|
|
53
|
+
3. The main series over time, a full-width `ChartCard`.
|
|
54
|
+
4. A `GridRow` of two breakdowns: a bare `ChartBar` for the largest category column, and a
|
|
55
|
+
`ChartDonut` or a `ChartColumn` for another column or a second measure over time.
|
|
56
|
+
5. A `TopListCard` for a second category column, when one exists.
|
|
57
|
+
|
|
58
|
+
Use at least 3 different chart kinds on the page when the data has the shapes for them. The
|
|
59
|
+
chart kinds are `ChartArea`, `ChartLine`, `ChartColumn`, `ChartBar` and `ChartDonut`; KPI cards
|
|
60
|
+
and top lists are not chart kinds. Use a second kind before you repeat one. A page of KPI cards
|
|
61
|
+
alone is never done.
|
|
62
|
+
|
|
63
|
+
Every card binds the page's period: `periodScope: "page"` on the block, and on its query
|
|
64
|
+
`where` filters on the time axis bound to the request,
|
|
65
|
+
`{ "field": "<time axis>", "op": "ge", "value": { "$param": { "name": "from" } } }` and
|
|
66
|
+
`"le"` with `"to"`. A card over a relation with no time axis stays unbound.
|
|
67
|
+
|
|
68
|
+
## Period
|
|
69
|
+
|
|
70
|
+
The default period is computed from the data's real dates, never assumed. Read the time
|
|
71
|
+
axis's `range` from the analysis, or profile that column. Then take the first rule that holds,
|
|
72
|
+
counting from today:
|
|
73
|
+
|
|
74
|
+
1. The data reaches into the last 30 days and spans at least 90 days: `last-90-days`,
|
|
75
|
+
compared with `previous-period`.
|
|
76
|
+
2. The current year holds at least 3 months of data: `ytd`, compared with `previous-year`.
|
|
77
|
+
3. Last calendar year holds data: `last-year`, compared with `previous-year` when the year
|
|
78
|
+
before it holds data too, else `none`.
|
|
79
|
+
4. Otherwise bind nothing to a period, leave the selector out, and say so in your report.
|
|
80
|
+
|
|
81
|
+
Set it on the selector: `defaultPreset`, `defaultComparison`, `presets` (the default, any
|
|
82
|
+
other preset whose window holds data, and `custom`) and `comparisons`. Leave `all` out of
|
|
83
|
+
`presets`: it sends no `from` or `to`, and every bound query fails without them.
|
|
84
|
+
|
|
85
|
+
Pick the bucket so the default window holds 8 to 31 points: `day` up to 31 days, `week` up to about 7 months (a 90-day window is 13 weeks), `month` beyond. A time chart with fewer than 8 points reads as a curve with no story. An axis
|
|
86
|
+
chart (area, line, column, bar) over time takes `xaxisType: "category"`, unless a preview's
|
|
87
|
+
`x` values are epoch milliseconds, which take `xaxisType: "datetime"`. A donut or pie takes
|
|
88
|
+
no axis option.
|
|
89
|
+
|
|
90
|
+
## Name every page
|
|
91
|
+
|
|
92
|
+
Every page you create or map gets a title, an icon and a description; a raw relation name is
|
|
93
|
+
never a title.
|
|
94
|
+
|
|
95
|
+
- **Title**: what the owner calls the content, in their words and plural for lists ("Support
|
|
96
|
+
tickets", not "support_ticket"; "Sales", not "orders stats"). Drop technical prefixes and
|
|
97
|
+
suffixes (`tbl_`, `_v2`). An analytics page is named for the area it covers ("Sales",
|
|
98
|
+
"Customers", "Overview"). Two pages never share a title: when a table page is already
|
|
99
|
+
"Customers", its analytics page is "Customer insights".
|
|
100
|
+
- **Icon**: a Phosphor icon, `i-ph-<name>`, that a reader links to the content at a glance
|
|
101
|
+
(`i-ph-users` for people, `i-ph-package` for goods, `i-ph-receipt` for invoices,
|
|
102
|
+
`i-ph-chart-line-up` for an analytics page). Two pages in one menu never share an icon.
|
|
103
|
+
- **Description**: one sentence on what the page holds or answers, from the data
|
|
104
|
+
("Every order with its payment and shipping status").
|
|
105
|
+
- **Order**: the main analytics page first (`order: 0`), then the most used lists. Keep a
|
|
106
|
+
table page's order at 100 or more unless it must sit among the dashboards.
|
|
107
|
+
|
|
108
|
+
Set them with `BuilderCreatePage` on new pages, per resource in `BuilderMapResources`
|
|
109
|
+
(`title`, `icon`, `description`, `order`), or with `BuilderConfigurePage` afterwards.
|
|
110
|
+
|
|
111
|
+
## Tables
|
|
112
|
+
|
|
113
|
+
A table page is a working tool: the reader finds a row, sees its state, and acts. Read the
|
|
114
|
+
relation's columns with `BuilderResourceStructure` (and the proposal's profiles when there
|
|
115
|
+
is one), then give the table every feature its data supports, and none it does not. Each
|
|
116
|
+
rule below names the shape that earns the feature; decide from the columns and their values,
|
|
117
|
+
never from the relation's name.
|
|
118
|
+
|
|
119
|
+
**Columns.** A primary key gets no display and is never a row's label. A boolean keeps its
|
|
120
|
+
default display (no badge). A column that a view filters on, a tab splits on, or a footer
|
|
121
|
+
`where` reads must be `filterable` in the mapping; one that a view sorts on, `sortable`.
|
|
122
|
+
Keep the Builder's proposed displays unless the column's meaning says otherwise:
|
|
123
|
+
a column with few distinct values (a status, a type, a channel, a priority, under about 12
|
|
124
|
+
values) shows coloured badges, one tone per value (green for done or good, amber for waiting,
|
|
125
|
+
red for failed or lost, grey for closed or neutral); free text (a subject, a note, a name)
|
|
126
|
+
never shows badges, even when the sample repeats. A money column shows a price. A relation
|
|
127
|
+
column (a `customer_id`, an `order_id`) is titled by its target ("Customer") and shows the
|
|
128
|
+
target's label, never the raw number: map the target relation with a label first, then send
|
|
129
|
+
the relation column as a relation. Raw id columns stay off the list. Send each field's `display` and the relation's `tabs` in `BuilderMapResources`.
|
|
130
|
+
|
|
131
|
+
**Tabs.** A single-choice column with 2 to 6 values that splits the rows into states people
|
|
132
|
+
work through (a status, a stage) gives one tab per value after "All". One tab column per table.
|
|
133
|
+
|
|
134
|
+
**Saved views** (`views`). Add 2 to 4 views when a recurring question is a fixed filter on the
|
|
135
|
+
table: rows waiting for action (a status that means "to do"), recent rows (a date
|
|
136
|
+
`greater_than` `{{now-7d}}` or `{{now-30d}}`), rows assigned to the reader (an owner column
|
|
137
|
+
equal to `{{user.id}}`), outliers worth a look (a stock or a score under a threshold read from
|
|
138
|
+
the profile, a high amount). Each view has a short label that states the question
|
|
139
|
+
("Awaiting shipment", "This week", "Low stock"), a sort that puts the first row to handle on
|
|
140
|
+
top, and `count: true` when the number itself matters. Keep views and tabs from repeating each
|
|
141
|
+
other: views for questions that cross columns or dates, tabs for the plain split by state.
|
|
142
|
+
|
|
143
|
+
**Display modes.** Offer another display when the data reads better that way, and make it the
|
|
144
|
+
default only when it is the main way to work the table:
|
|
145
|
+
|
|
146
|
+
- **Kanban** (`kanban.groupBy`) when a single-choice status or stage column describes a flow
|
|
147
|
+
rows move through, with 3 to 7 values and rows that are handled one by one (tickets, tasks,
|
|
148
|
+
deliveries, applications). Not for a column that only classifies (a country, a category).
|
|
149
|
+
Kanban works on a read-only table: it shows the flow without moving cards. Leave `draggable`
|
|
150
|
+
off unless the table is editable.
|
|
151
|
+
- **Cards** (`cards.fields`) when each row is an entity people recognise by a few fields
|
|
152
|
+
rather than compare across many columns (a product, a person, a place): 3 to 5 fields, the
|
|
153
|
+
label first, then the badge and the key figure.
|
|
154
|
+
- **Grouped** (`grouped`) when rows are read by day or week (a log, bookings, events): group by
|
|
155
|
+
the main date column with `by: "day"` or `"week"`.
|
|
156
|
+
|
|
157
|
+
**Footer totals** (`footer.summary`). When the table has an additive money or quantity column,
|
|
158
|
+
show its `sum`, and a `count` of rows; add a `count` with a `where` on a status value when that
|
|
159
|
+
number is what the reader checks ("Refunded"). Never sum a unit price, a rate or a score.
|
|
160
|
+
|
|
161
|
+
**KPI cards above the table.** When the relation has a measure or a state worth tracking (an
|
|
162
|
+
amount, rows waiting, a share of a status), put a `GridRow` of 3 or 4 `KpiCard`s above the
|
|
163
|
+
`TableView`, each answering one question the table's reader asks ("Revenue this month",
|
|
164
|
+
"Awaiting shipment", "Refund rate"), with the series and `compare` rules above. A lookup list
|
|
165
|
+
(a reference table, tags, settings) gets none.
|
|
166
|
+
|
|
167
|
+
Set displays, views and footer per resource as `tableOptions` in `BuilderMapResources`, or on
|
|
168
|
+
an existing page with `BuilderConfigureTableView`. A refused choice comes back as
|
|
169
|
+
`invalid_config` with the setting it names: fix that one and send again.
|
|
170
|
+
|
|
171
|
+
## Build a page in one call, and check it first
|
|
172
|
+
|
|
173
|
+
Build every page, or every set of blocks added to a page, with one `BuilderComposePage` call:
|
|
174
|
+
the blocks as an ordered tree (containers carry `children`), each data block with its `query`
|
|
175
|
+
inline (same fields as `BuilderAddQuery`). It writes everything at once and typechecks once.
|
|
176
|
+
Use the single-block tools only for a small fix afterwards.
|
|
177
|
+
|
|
178
|
+
1. Call it first with `"preview": true` and the default period's `from` and `to` as `args`.
|
|
179
|
+
It writes nothing and answers each block's status. Change or drop every block marked
|
|
180
|
+
`empty`, `zero` or `error` (another measure, the whole history for a card that should not
|
|
181
|
+
follow the period), then preview again. Never write a block over an empty answer.
|
|
182
|
+
2. Call it again without `preview` to write. A refusal lists every refused block by pointer:
|
|
183
|
+
fix those and call again; nothing was written.
|
|
184
|
+
3. KPI cards above a table: `pageRef` of the table page, `placement: { "before": "table" }`,
|
|
185
|
+
and the `GridRow` of `KpiCard`s as `blocks`. A later remap keeps them.
|
|
186
|
+
4. After the last page, `NavigateToPage` once per page and fix any block it reports as empty
|
|
187
|
+
or failed.
|
|
188
|
+
5. Your report names every block that still shows no data, and why.
|
|
189
|
+
|
|
190
|
+
The page is done when every block has data in the default period, the page meets the
|
|
191
|
+
layout above, it has a title, an icon and a description, and each table uses every feature
|
|
192
|
+
its data supports.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"id": "dms-page-design-dashboard",
|
|
6
|
+
"area": "dms-ai",
|
|
7
|
+
"style": "clean",
|
|
8
|
+
"prompt": "Build a sales dashboard over the orders table with the Builder: KPIs, a trend over time and a breakdown by status.",
|
|
9
|
+
"expect": {
|
|
10
|
+
"skills": ["dms-page-design"],
|
|
11
|
+
"acceptable": ["dms-builder-safe", "dms-best-practices", "dms-pages"]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "dms-page-design-chart-choice",
|
|
16
|
+
"area": "dms-ai",
|
|
17
|
+
"style": "casual",
|
|
18
|
+
"prompt": "which chart should i use for orders by country, theres like 24 countries",
|
|
19
|
+
"expect": {
|
|
20
|
+
"skills": ["dms-page-design"],
|
|
21
|
+
"acceptable": ["dms-builder-safe", "dms-pages"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "dms-page-design-period",
|
|
26
|
+
"area": "dms-ai",
|
|
27
|
+
"style": "clean",
|
|
28
|
+
"prompt": "The charts on the stats page are empty because the period defaults to the last 30 days and the data stops last year. Fix the default period.",
|
|
29
|
+
"expect": {
|
|
30
|
+
"skills": ["dms-page-design"],
|
|
31
|
+
"acceptable": ["dms-builder-safe", "dms-pages", "dms-best-practices"],
|
|
32
|
+
"mustMention": ["PeriodSelector"]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "dms-page-design-table-badges",
|
|
37
|
+
"area": "dms-ai",
|
|
38
|
+
"style": "clean",
|
|
39
|
+
"prompt": "On the orders table, show the status as coloured badges, the total as a price, and add a tab per status.",
|
|
40
|
+
"expect": {
|
|
41
|
+
"skills": ["dms-page-design"],
|
|
42
|
+
"acceptable": ["dms-builder-safe", "dms-external-database", "dms-pages"]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "dms-page-design-not-safe-mode-approval",
|
|
47
|
+
"area": "dms-ai",
|
|
48
|
+
"style": "clean",
|
|
49
|
+
"prompt": "In safe mode the Builder refuses to add a block to the sales page until I approve it. Where do I approve a pending Builder change?",
|
|
50
|
+
"expect": {
|
|
51
|
+
"skills": ["dms-builder-safe"],
|
|
52
|
+
"acceptable": ["dms-builder", "dms-pages"],
|
|
53
|
+
"avoid": ["dms-page-design"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|