Skip to content

Commit d553449

Browse files
os-zhuangCopilot
andcommitted
docs(skills): English-only audit + cross-link compareTo/categoryGranularity
* skills/objectstack-ui/SKILL.md: drop Chinese 较上期/较去年/较前7天 examples from the compareTo metric paragraph (per English-only rule) and rephrase to describe the i18n labels generically. * skills/objectstack-query/SKILL.md: enrich the CRM Analytics Query Blueprint table — the 'KPI widgets' row now mentions compareTo, and the 'Time-series chart' row replaces the vague 'month bucketing' phrasing with an enumeration of the categoryGranularity options and the requirement to do bucketing server-side. * skills/objectstack-query/rules/aggregation.md: prefix the LAG/LEAD period-over-period example with a callout pointing dashboard authors to the higher-level compareTo widget field, so they don't reach for raw window functions when a one-line modifier exists. Audit scope: scanned all 41 skill .md files for stray non-English content and dashboard/chart/KPI references that should mention the new compareTo + categoryGranularity fields. objectstack-i18n keeps its Chinese / multi-locale strings — they are the documented translation bundle examples and are appropriate content for that skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f59a439 commit d553449

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

skills/objectstack-query/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ Use dashboards/reports metadata as the practical query pattern source:
528528

529529
| Query Need | CRM Reference | Pattern |
530530
|:--|:--|:--|
531-
| KPI widgets | `dashboards/sales.dashboard.ts` | Filtered aggregates (`sum`, `count`, `avg`) over `opportunity` |
532-
| Time-series chart | `dashboards/sales.dashboard.ts` | Date filters + month bucketing for trend analysis |
531+
| KPI widgets | `dashboards/sales.dashboard.ts` | Filtered aggregates (`sum`, `count`, `avg`) over `opportunity`. Add `compareTo: 'previousPeriod' \| 'previousYear'` on the widget for a one-line period-over-period delta. |
532+
| Time-series chart | `dashboards/sales.dashboard.ts` | Date filters + `categoryGranularity: 'day' \| 'week' \| 'month' \| 'quarter' \| 'year'` for server-side bucketing — never bucket by hand on the client. Pair with `compareTo` for an aligned YoY overlay. |
533533
| Matrix report | `reports/opportunity.report.ts` | `groupingsDown` + `groupingsAcross` + `dateGranularity: 'quarter'` |
534534
| Funnel summary | `reports/opportunity.report.ts` | Multi-level grouping (`owner -> stage`) + aggregated measures |
535535
| Operational filter | dashboard/report filters | Prefer declarative operators (`$ne`, `$nin`, `$gte`) over hardcoded SQL |

skills/objectstack-query/rules/aggregation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ Window functions compute values across row sets WITHOUT collapsing results.
177177

178178
### LAG / LEAD (Period-over-Period)
179179

180+
> **For dashboard widgets**, prefer the higher-level `compareTo:
181+
> 'previousPeriod' | 'previousYear' | { offset }` field on the widget
182+
> schema (see *objectstack-ui**Period-over-period — `compareTo`*).
183+
> The renderer issues the shifted query for you and aligns the result
184+
> bucket-for-bucket with `categoryGranularity`. Reach for the raw
185+
> `lag` / `lead` window functions below when you need the comparison
186+
> in a custom query result (reports, ad-hoc SQL, cube measures).
187+
180188
```typescript
181189
// Month-over-month comparison
182190
{

skills/objectstack-ui/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ no second `filter` is required.
494494

495495
* **Metric widgets** — the prior-period value renders as a small caption
496496
beneath the headline number, alongside a green/red delta arrow and an
497-
i18n label (`较上期` / `vs previous period`, `较去年` / `vs last year`,
498-
`较前7天` / `vs previous 7d`, etc.). Authors should *not* hand-author
499-
`options.trend` when `compareTo` is set; the renderer wins and overwrites
500-
it.
497+
i18n trend label resolved from the comparison kind (e.g. `vs previous
498+
period`, `vs previous year`, `vs previous 7d`). Authors should *not*
499+
hand-author `options.trend` when `compareTo` is set; the renderer wins
500+
and overwrites it.
501501
* **Cartesian charts** (`line` / `area` / `bar` / `horizontal-bar` /
502502
`scatter`) — the comparison series is appended after the primary series
503503
with `variant: 'comparison'` and styled as a muted overlay (`opacity: 0.5`

0 commit comments

Comments
 (0)