Repository navigation
feat(console): edit a dashboard on its own page, and mark the page filters a card does not follow - #36405
Conversation
dashboardFiltersNotApplied asks the binding buildWidgetScopedFilter asks, so a card's not-applied mark and the card's query read one resolver. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
…lters a card does not follow An admin who may design the dashboard's package gets Edit in the page header. The edit state opens the stored document with the cards in design mode (drag, corner resize by grid tracks, click to select), Studio's own dashboard panels at the right, Add card, Add filter, Discard and Save. Save stages the draft and publishes that one item through the confirmed- save door, into the owning package or the app's customization package, and refuses over a pending Studio draft. Every card names the page filters that do not reach it, read through the same binding its query is built from. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
…in-page edit tests Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
…as main has it Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
…d-save door unchanged Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
…e Edit button's read too Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) on head Owed
Checklist (all pass)
Nits (not blocking)
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Inputs read: card #36372 body and its four comments (notice, triage, claim, os-dev-report), the PR #36405 body, its 30-file list, the net diff against main (merge base ① Derived judgments
SQL push-down: the diff adds no data query, no id materialisation and no in-app join. The mark is computed from the dashboard's own metadata. Nothing to push down. ② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…refuses where Studio's Customize would
Edit on an installed app's dashboard asked the ensure door at open, which
creates the app's customization package on first use, so Edit then Discard
left a new package behind. Opening now only reads: the pair is looked up in
the package list (listedCustomizationPairOf), and the ensure door is asked at
Save, the edit's first write. The edit state is also refused up front where
Studio's Customize is: the ensure door walled for this caller, and a base
listing no version to declare the override at (unless the item already
declares one).
Two things a live run showed: the not-filtered mark named the built-in date
filter by its reserved name ("dateRange") instead of "Date range", and the
edit state drew the stored document without the served _packageId, so its
cards' dataset queries no longer named the dashboard's package as their
reader. Both fixed and pinned.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH L1 delta ACCEPT on head What the REWORK owed, and where it is now
Delta code, read in full (one commit, 22 files, +349/−95)
Sentences
Mechanical reads
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review against the FAIL record 7078097551 at ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T12:09Z): head |
…e, as in Studio (#36373) #36405 hosts DashboardWidgetInspector on the dashboard page. Wrap its edit panel in ServedWidgetTextContext, pairing the page's served dashboard with the stored document the edit opened, so the title box shows the session's language and an edit lands in that language's entry. Pinned through the real DashboardView (ablation: provider value null, the case goes red). Claude-Session: https://claude.ai/code/session_01QsR2jUP9hxdL4RzdzTs9eK Co-authored-by: Claude <noreply@anthropic.com>
… opening the report editor keeps the page in the session language (objectstack-ai#36420) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jUP9hxdL4RzdzTs9eK Fixes objectstack-ai#36373 Clause-②: yes (widening) — the report and widget panels accept an edit of a translated name or title in the session's language, stored as the inline locale map `{ default: SOURCE, LANG: EDIT }` that `I18nLabel` already allows; for an item with a packaged base the server no longer lets the base's translation replace that entry on report `label`/`description` and widget `title`. Nothing is removed or renamed. Metadata-protocol: semantic — `translateReport` and `translateDashboard` now treat a report `label`/`description` or a widget `title` as changed when its inline locale-map entry for the requested locale (the entry the panel writes: exact tag, then the locale's own script, else base tag or a sibling region; never `default`) differs from the packaged base's own, so the base's translation no longer replaces it; a translation the paired `.custom` package ships still answers first (ruling record 6631250894), and with none the entry is served; dataset members (`translateDataset`, ADR-0149) are unchanged Skills-docs: none — no `skills/` file names these panels, their wording or the report/widget label precedence (`git grep` over `skills/` for `translateReport`, `translateDashboard`, `inline locale map`, `ReportDefaultInspector`, `DashboardWidgetInspector`: 0 hits). ## 维护者速读 - **改了什么**:运行界面报表的「编辑」面板、仪表盘卡片属性栏、Studio 里同一套面板,一律显示字段/指标/数据来源的标签(悬停才看到内部名);用词改成「数据来源」「分组」「指标 · 合计」「跟着页面顶部的筛选变」,图表类型是中文名加图标;数据来源下面是一句人话。名称、标题框显示当前语言的文字,改动只写当前语言(`{ default: 原文, zh-CN: 新文字 }`);对已安装应用的报表/仪表盘,服务端不再用应用包的翻译盖掉这一条(定制包自己带的翻译仍然优先)。另修:打开编辑面板时页面标题和副标题不再变成英文。 - **为什么改**:维护者要求对照 Attio 把面板换成业务用词;中文管理员原来看到 `total_amount`、`bar`、「维度」「度量」「受治理…RLS」,页面标题一开编辑就变英文。 - **风险与回滚**:服务端 `i18n-resolver.ts` 改了报表名称/描述和卡片标题的取值顺序(只在有打包基线、且内联条目与基线不同的时候才生效;三仓源码普查 0 个内联 map;部署里已存的定制行若带这种 map,该语言会改读定制自己的文字);数据集成员不变。回滚即 revert 本 PR。 - **先看**:`servedLabel.ts`(显示与写回规则)、`i18n-resolver.ts` 的 `slotRead` / `inlineEntryFor`、`ReportView.tsx` 的 `previewWithServedText`,以及 PR 里的前后截图说明。 ## What changes **Wording and names (both panels).** `ReportDefaultInspector` (runtime 「编辑」 and Studio) and `DashboardWidgetInspector` (Studio's widget property bar, which objectstack-ai#36372 reuses at runtime): - The data-source picker lists each dataset by its label alone (`datasetLabelOptions`); the machine name is the option's `title`. No `(name)`, no description. - Bound measure and dimension rows, the add-member popover and the chart-axis selects show labels; the machine name moves to a `title` (`nameOnHover` on `FieldListRow`, `AddFieldPopover` and `InspectorComboField`). A measure reads `LABEL · AGGREGATE`, the aggregate in words from the new `engine.inspector.report.aggregate.*` keys (「金额 · 合计」, "Amount · Sum"). - Catalogue wording (`studio/{en,zh}.ts`): 数据来源 / Data source, 分组 / Group by, 指标 / Metrics, 列分组 / Group columns by, 横轴(分组)/ 纵轴(指标), 不显示图表(只看表格); the widget's section heading is 数据 / Data; the filter section is 跟着页面顶部的筛选变 / Follows the filters at the top of the page; the data-source hint is one plain sentence (no 受治理 or RLS), on the report panel too (`report-dataset-hint`). - The chart-type select shows each type's catalogue name and its icon (`InspectorSelectField` options take an `icon`). - A filter binding row names the filter: its label, 时间 / Date for the date range, else the label of the dimension whose column (`columnIdentity()`) it filters; the empty field face reads 默认(LABEL) or 默认字段. - The report form rows below the curated fields (`metadata-form-zh-cn.ts`, the zh-CN overlay this console renders the bundled report form with) use the same words; those leaves are marked ⟨36373⟩. **Current-language name and title.** `servedLabel.ts`: the name box (report) and title box (widget) show the served translation while the buffer still equals the published value it was translated from; an edit writes the session language's entry only (`writtenLabel`). The report's served text reaches the panel through the new `ServedReportTextContext`, provided by `ReportView` (paired at editor open) and `StudioDesignSurface`; the widget's through the existing `ServedWidgetTextContext`, now also wrapped around Studio's selection inspector and, after objectstack-ai#36405, around the dashboard page's edit panel (`DashboardEditPanel` pairs the page's served dashboard with the stored document the edit opened; `useDashboardInPageEdit` keeps that opened document as `published`). **Heading fix.** `ReportView` drew the authored edit buffer (objectstack#35008) as the page, so opening the editor turned 「各阶段商机」 into "Opportunities by Stage". `previewWithServedText` now draws the served value of every translated key (`title`, `label`, `description`, `blocks`) the edit has not changed. **Server precedence (spec).** `packages/spec/src/system/i18n-resolver.ts`: `valueOverridesPackagedBase` (a re-authored string, as before) and `inlineEntryOverridesPackagedBase` (an inline map whose entry for the requested locale differs from the base's) decide what `slotRead` hands the lookup. `translateReport` (label, description) and `translateDashboard` (widget title) read through `slotRead`: a re-authored string reads the pair's translations along the locale chain, as before (`catalogFor(catalogs, true)`); a slot changed through its map entry reads the pair's translation for the requested language only (the same tag, case aside, or another spelling of the same platform-table tag: a `zh-CN` request reads a row under `zh-Hans`, `ja-JP` one under `ja`; no fallback chain, no base-language or regional-variant step), so rank 1 of ruling record 6631250894 (the paired `.custom` package's translation) still answers first for that locale, the base's translation never, and with no pair answer for that locale the map is served and the reader picks its entry (L2 7079950960 S3 and 7080413623 S4, seat ruling: way 1, the requested language). `inlineEntryFor` picks the entry the panel's writer (`localeWriteKey`) replaces: exact tag, then, where the platform table splits the language by script, only an entry of the locale's own script (bare base, then sibling), else the bare base, then the first sibling. ⛔ never `default`. The jsdoc of `labelCatalogs`, `translateReport` and `translateDashboard` names the rule; `inlineEntryOverridesPackagedBase` says why it is a separate twin of `valueOverridesPackagedBase` (the exported `scalarOverridesPackagedBase` and the object fold stay string-only). Docs: `content/docs/protocol/kernel/i18n-standard.mdx` (the precedence), `content/docs/ui/reports.mdx` (new "Editing a report beside it"), `content/docs/ui/dashboards.mdx` (filter bindings wording). ## Tests - New `packages/spec/src/system/i18n-report.test.ts` describe (14 cases): zh entry served; the en `default` byte-identical; ja still reads its bundle text (ステージ別商談); a base-tag `zh` entry answers `zh-CN`; control, a map equal to the base's map reads the bundle; control, no base reads the bundle (the panel gap below); the widget title follows the same rule; scope control, a dataset member's map still loses to the bundle (ADR-0149). L2 rework: with `pairBundle`, the pair's translation answers ahead of the zh entry on a report label and on a widget title, and a pair with no entry for the slot leaves the map (the base's translation never answers); a `zh-TW` request over `{ default, zh }` reads its Traditional bundle text; a `zh-TW` request over `{ default, zh, zh-HK }` gates on the `zh-HK` entry `resolveI18nLabel` shows; a bare-`zh` session reads the `zh-CN` entry its own edit replaced. L2 S3: a pair translation for `en` down a `fallbackChain` does not outrank the `zh-CN` entry (report and widget title), a `zh-TW` pair does not answer a `zh-CN` request over the `zh-CN` entry, and a re-authored plain string still reads the pair along the chain (control). L2 S4: a `zh-CN` request reads a pair row stored under `zh-Hans`, the `zh-Hans` mirror over `zh-CN`, and `ja-JP` over `ja`; the `zh-TW` pin stays the control. 19 cases in the describe. - New `servedLabel.test.ts` (11 cases): show/write rules, the `{ default, zh-CN }` write with the source byte-identical, a map keeps every other language, clears, a second edit. - New `panelBusinessWording-36373.test.tsx` (8 cases), on the HotCRM `opportunity_metrics` shape: the zh panel reads 数据来源 商机指标, 金额 · 合计, 平均赢单概率 · 平均, 分组 阶段, 柱状图 and the served 各阶段商机; a sweep of both panels' visible text finds none of `total_amount`, `avg_probability`, `account_industry`, `opportunity_metrics`, `stage`, `bar`, `RLS`, 维度, 度量, 受治理 (and on the widget `dateRange`, `owner_id`, `lead_source`); machine names are present as `title`; the chart-type options are Chinese names, each with an `svg`; en reads English labels with no machine name; an edit of the served name sends `{ default: SOURCE, 'zh-CN': EDIT }`. The sweep caught the residual report form rows still saying 维度/度量, fixed here. - New `ReportView.headingStaysServed-36373.test.tsx` (3 cases) on the real `ReportView` and `ReportConfigPanel`: heading and subtitle stay served with the editor open; an edited key shows the edit; the panel receives the served/authored pair. - `DashboardView.inPageEdit-36372.test.tsx`: new case, through the real `DashboardView`: the card panel on the dashboard page reads the served title beside the stored one (`Total (served) ← Total (stored)`); ablation (provider value `null`) → that case red, 10 others green. - Moved to the new wording: `ReportDefaultInspector.test.tsx`, `DashboardWidgetInspector.test.tsx`, `datasetPickers.authorText-11161.test.tsx` (restated for objectstack-ai#36373), `InterfacesPillar.componentListServedTitles-12688.test.tsx` (the Title box now reads the served title), `InterfacesPillar.heldWidget-11910.test.tsx`, `InterfacesPillar.reportHeld-27785.test.tsx`, `StudioDesignSurface.heldWidgetPublish-11910.test.tsx`. - Ablations (`scripts/ablation-replace.mjs`, restored blob == HEAD each time): precedence reverted (`return false`) → 3 of 24 spec cases red (zh entry, base tag, widget title); `previewWithServedText` replaced by the raw buffer → 2 of 3 heading cases red (the context case is a separate seam). L2 rework: `i18n-resolver.ts` swapped back to `e2d307a1`'s → 4 of 30 red (pair on report, pair on widget, zh-TW over `{ default, zh }`, bare zh over `zh-CN`); restored, 30/30. S3: `i18n-resolver.ts` swapped back to `0df531f9`'s → 3 of 34 red (fallback chain on report and widget, `zh-TW` variant); restored, 34/34. S4: `i18n-resolver.ts` swapped back to `8ad569b7`'s → the S4 case red; restored, 35/35. ## Acceptance notes - **Stored shape.** An edit typed over a translation of a plain-string label stores `{ default: SOURCE, LANG: EDIT }`. Pinned: after a zh edit the English `default` is byte-identical; a third locale (ja) still reads its bundle translation; the precedence between bundle and inline map is named and pinned (below). - **Precedence.** For report `label`/`description` and widget `title`, on an item with a packaged base whose inline entry for the requested locale differs from the base's: 1. a translation the paired `.custom` package ships; 2. the entry; never the base's translation (ruling record 6631250894's order, kept). A map equal to the package's own map changes nothing (control pin); an item with no packaged base reads the bundle as before (control pin). - **Owed, not in this PR (L2 S2).** With no packaged base (a report or dashboard no code package ships), the panel still stores `{ default: SOURCE, LANG: EDIT }`, the server still serves the bundle where it has an entry for that language, and the box shows that translation again after save, with no message. The same holds for an override once the pair carries a translation for that locale. `servedLabel.ts` now states this. Carried by objectstack-ai#36481 (write the translation row, or say so in the panel). - **ADR-0149.** Its bundle-wins clause is scoped to dataset members; `translateDataset` is untouched, and a pin shows a dataset member's inline map still loses to the bundle. `check-prior-rulings` over the precedence terms: 0 hits; `docs/adr` has no other ruling on report/widget label precedence. - **Census** of inline locale maps on report `label`/`description` and widget `title`: objectstack `67132dd7` (2 report files, 6 dashboard files) 0; hotcrm `689166c` (5, 7) 0; gallery `782d801` (1, 1) 0. The only map in those files is a dashboard `globalFilters` label in hotcrm `activity.dashboard.ts`, not a covered prop. No packaged source changes reading; the census cannot see override rows stored in a deployment, where a row carrying such a map now reads its own entry in that locale (the change the semantic line names). - **Supersedes on these two panels only:** objectui#11161's `LABEL (name)` and objectui#12303's trailing machine name. Other dataset pickers (the spec-form `ref:dataset` widget, view and page pickers) are unchanged. - **Not changed:** the panels' structure and items; the report `description` field (it stays in the form rows below and edits the authored text); Studio's dataset designer. The en form rows below the curated fields still read the spec's English (`Dataset binding`, "Values are the dataset’s measures…"): the console deliberately carries no `en` overlay, and rewording the spec form ripples into ten generated locale bundles — a follow-up if wanted. The platform's own zh-CN `metadata-forms` bundle (the generic server-rendered form) keeps 数据集/维度/度量 for the same reason. - 「查看明细」 is objectstack-ai#36256 and is not rebuilt here. ## Live run (L1-e REWORK) At head `c6ab9f25`, a fresh local backend (`objectstack dev --seed-admin`, file DB, the worktree's CLI and freshly built `@objectstack/spec`) ran HotCRM `689166c` (a scratch copy with `initialStates` added to its twelve state-machine validations, because the current author-time rules refuse the copy without them; no HotCRM file changed). The console ran from this branch's sources (`ui/apps/console` Vite against it), driven by Playwright as the seeded admin in a `zh-CN` and an `en-US` browser. | Acceptance | Reading | |---|---| | Open 各阶段商机, press 编辑: heading and subtitle | Before: 「各阶段商机」 / 「按阶段分组汇总商机」. With the panel open: the same. en: "Opportunities by Stage" / "Summary of opportunities grouped by stage", both states. | | Panel words (zh-CN) | 数据来源 商机指标; 报表从这里取数;每个人只能看到自己有权限的记录。; 指标 总金额 · 合计、平均赢单概率 · 平均; 分组 阶段; 图表类型 柱状图; 横轴(分组)阶段; 纵轴(指标)总金额 · 合计. HotCRM labels the measure 「总金额」, so the panel reads that, not 「金额」. Name box 各阶段商机. | | Forbidden-word sweep of the panel's visible text | zh-CN and en-US: none of `total_amount`, `avg_probability`, `opportunity_metrics`, `stage` (en: as a word), `bar`, `RLS`, 维度, 度量, 受治理. Machine names are on `title` only: `total_amount`, `avg_probability`, `stage`. | | Chart types | zh: 不显示图表(只看表格), 柱状图, 柱形图, 折线图, 面积图, 饼图, 环形图, each chart with its icon. en: No chart (table only), Bar Chart, Column Chart, … | | English | Opportunity Metrics, Total Amount · Sum, Avg Probability · Average, Group by Stage, Bar Chart; no machine name. | | Studio, same report | `/studio/app.objectstack.hotcrm/interfaces?surface=report:opportunities_by_stage`: the same words, name box 各阶段商机, sweep clean (zh and en). | | Studio, same dataset's widget | 销售业绩 (`sales_dashboard`) → 阶段管道分布: 数据 · 数据来源 商机指标, 卡片从这里取数…, 分组 阶段, 指标 总金额 · 合计, 跟着页面顶部的筛选变 with 时间 「默认(预计成交日)」, 销售代表 「默认(负责人)」, 商机类型; title box 阶段管道分布. en: Data source "Opportunity Metrics", "Total Amount · Sum", "Follows the filters at the top of the page", Date / Sales Rep / Deal Type. Sweep clean (also `owner_id`, `close_date`, `dateRange`). | | Untranslated self-built report | A dataset `my_deal_figures` (label 我的成交数据, dimension 销售阶段(自建), measure 合同额) and a report `my_deal_report` (我的成交报表) created over REST in `app.objectstack.hotcrm.custom`, no bundle entries. zh-CN panel: 数据来源 我的成交数据, 指标 合同额 · 合计, 分组 销售阶段(自建); en-US: the same author text with "· Sum". Machine names `contract_value`, `phase` on `title` only. | | Round trip: edit the name in zh-CN, Save, reload | Runtime 「编辑」 → Save on this package report is refused before this PR's code is reached: `PUT /api/v1/meta/report/opportunities_by_stage?mode=draft` → **403 NOT_OVERRIDABLE** ("ships in 'app.objectstack.hotcrm': save it into 'app.objectstack.hotcrm.custom'"); the panel stays open and dirty, as objectui#11583 has it (finding below). So the round trip ran through Studio's 定制: `POST /packages/app.objectstack.hotcrm/ensure-customization` (201), then `PUT …/opportunities_by_stage?mode=draft&package=app.objectstack.hotcrm.custom` with body `"label":{"default":"Opportunities by Stage","zh-CN":"各阶段商机(本公司)"}` and `"overrides":{"package":"app.objectstack.hotcrm","basedOn":"6.5.0"}` (200), then 发布 → `POST /packages/app.objectstack.hotcrm.custom/publish-drafts` (200, 1 published). After a reload: zh-CN heading 「各阶段商机(本公司)」, name box 各阶段商机(本公司); en-US heading and box "Opportunities by Stage"; `GET /meta/report/…?locale=zh-CN` and `?locale=en` serve the stored map `{"default":"Opportunities by Stage","zh-CN":"各阶段商机(本公司)"}`; `?locale=ja-JP` serves the bundle's 「ステージ別商談」. | Findings from the run, not fixed here (for the seat): 1. Runtime 「编辑」 → Save on a report an installed package ships is refused 403 NOT_OVERRIDABLE: `ReportView`'s save names no package and declares no override. Not touched by this diff (the save path is unchanged); objectstack-ai#36405 gives the dashboard page this route (ensure door + `overrides`), the report page has none. Carried by objectstack-ai#36374 (item 8, 保存后对所有人生效). 2. The report form's 描述 box shows the English source ("Summary of opportunities grouped by stage") while the subtitle beside it reads 「按阶段分组汇总商机」. The card's current-language rule covers the name box; the description stays in the form rows (stated under "Not changed"). Carried by objectstack-ai#36374 (item 2, 说明可直接改). 3. Studio's canvas strip reads 「已选中:Pipeline by Stage」 in a zh-CN session (`selection.label` in `StudioDesignSurface`): outside the panels, same class. Carried by objectstack-ai#36480. 4. English form rows (Dataset binding, "semantic-layer dataset", dimensions/measures) stay out, per the seat; carried by objectstack-ai#36447. ## Verification <details><summary>Tests</summary> Readings at the merged head `20c4ea00` unless named. S4 at `85e6baf9`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2768 passed (`i18n-report.test.ts` 35/35); `tsc` and `eslint` exit 0; `overlap-check` clean. S3 at `8ad569b7`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2767 passed (`i18n-report.test.ts` 34/34); `tsc --noEmit -p packages/spec` exit 0; `eslint` on the two spec files exit 0; `overlap-check` clean against main and objectstack-ai#36383. At `0df531f9` (main `8a741abd` with objectstack-ai#36405 merged in): `@object-ui/app-shell` `type-check` exit 0 (after rebuilding its dependencies, 68/68 turbo tasks); one locked `vitest run` of 266 app-shell files (every Dashboard*/ReportView*/ReportConfigPanel* view test, every inspector test, the moved Studio tests, the runtime-metadata persistence test): 266 files, 3371 passed, 1 skipped; `check:test-source-alias` OK; core `column-identity.ratchet` 7/7. L2 rework at `c6ab9f25`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2763 passed (`i18n-report.test.ts` 30/30); `tsc --noEmit -p packages/spec` exit 0; `eslint` on the two spec files exit 0. - ui: one locked `vitest run` of 117 files (every app-shell, i18n and console test that names a changed module, the moved tests and the four new files): 117 files, 1141 passed, 7 skipped. - spec: `vitest run src/system/`: 76 files, 2642 passed (`i18n-report.test.ts` 24/24). - `@object-ui/app-shell` `type-check` (`tsc --noEmit` and `tsc -p tsconfig.test.json`): exit 0. - `eslint` on the touched ui files: 0 errors (warnings only in `StudioDesignSurface.tsx`, none on changed lines). - Full `pnpm build --concurrency=2` after the merge: 120/120 tasks. - Ablations: see Tests above. </details> <details><summary>Gates</summary> - `dispatch-gates --commands` at the merged head `20c4ea00`: 112 families. `dispatch-gates --ran` with recorded exit codes: 112 derived, 112 run, 0 NOT-MEASURED, every family exit 0. - The first sweep (pre-merge) found one real red, fixed in this PR: `check:test-source-alias` asked the edited tests that reach `import('@objectstack/lint' | '@objectstack/formula')` to pay that load at collection (module-top side-effect imports). Its other exit-3 rows were prerequisites (a shallow-clone fixture commit; built output), cleared by fetching the fixture and a full `pnpm build --concurrency=2` (120/120 tasks), then green. - `overlap-check`: VERDICT clean exit 0 against `origin/main` `97b9d1e6` and objectstack-ai#36383 (shares `i18n-standard.mdx`, merges cleanly). At `c6ab9f25`: clean against `origin/main` `6a35635a` and objectstack-ai#36383. At `0df531f9`: clean against `origin/main` `7ae5e074`, objectstack-ai#36461 (shares `DashboardView.tsx`, `ReportView.tsx`) and objectstack-ai#36383. - CI at the final head `e2d307a1`: 70 check-runs, 61 success and 9 skipped, none failed. The first CI run, at `20c4ea00`, went red on Test UI 9/16. The core `column-identity.ratchet` refused a new `name`/`field` dual read in the widget panel's filter-label lookup (`dimensionLabelOf`), which now reads the dimension's column through `columnIdentity()`. Locally, the ratchet, the five affected ui files (62 tests) and the app-shell type-check pass, and `overlap-check` is clean. - Changed lines vs `origin/main`: under the 3000 threshold (30 files). </details> <details><summary>Screenshots</summary> Live shots (2× scale) from the run below, in the project's shared files under `repo-objectstack-7/card-36373/`; they cannot be uploaded to GitHub from the cloud seat. They replace the harness shots, which are deleted. - `live-report-panel-zh-CN.png`: runtime 「编辑」 on 各阶段商机 after the round trip: heading 「各阶段商机(本公司)」 and subtitle 「按阶段分组汇总商机」 with the panel open, 数据来源 商机指标, 指标 总金额 · 合计 / 平均赢单概率 · 平均, 分组 阶段, 柱状图. - `live-report-panel-en-US.png`: the same report in English: "Opportunities by Stage", Data source "Opportunity Metrics", "Total Amount · Sum", Group by "Stage", "Bar Chart". - `live-report-charttypes-zh-CN.png`: the chart-type list, Chinese names with icons. - `live-studio-report-zh-CN.png`, `live-studio-widget-zh-CN.png`, `live-studio-widget-en-US.png`: Studio's report panel and the 销售业绩 dashboard's 阶段管道分布 widget panel. - `live-selfbuilt-report-panel-zh-CN.png`: an untranslated report created over REST. - `live-roundtrip-publish-dialog.png`: Studio's publish dialog for the customized name. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jUP9hxdL4RzdzTs9eK <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jUP9hxdL4RzdzTs9eK --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ard list, and a report's chart marks drill (objectstack-ai#36461) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbD5gxSWeWGswbZYVzNvtqNM)_ Part of objectstack-ai#36256 Fixes objectstack-ai#36550 This PR lands the drill dialog. One piece stays open on the card, carried by objectstack-ai#36507: a labelled chip for a relationship-path condition (plugin-list `readViewConditions` / `viewChipText`, nested-relation form). Clause-②: yes (widening) — additive members only, among them the new `PageRegionPostureReset` export of `@object-ui/components`; nothing is removed or renamed Metadata-protocol: none ## 维护者速读 - 用户在仪表盘或报表上点一个数字(柱子、扇区、折线点、指标卡、汇总行),原来从右侧滑出一个整高抽屉,现在在页面中央弹出一个约七成宽、六成半高的窗口,背后不变暗,里面就是对象列表页那张标准列表。 - 为什么做:这是仪表盘下钻体验改进的那张卡,维护者已批准的八点要求——条件变成可改可删的筛选标签、默认只显示名称和分组、度量字段、点名称进完整记录页并能上下翻、窗口里的操作都不保存。 - 出错会怎样:最坏是下钻窗口里列出的记录或默认列不对、或记录页的翻页顺序不对;什么都不写入,关掉窗口即复原,回退本合并即回到旧抽屉。 - 要你做什么:无。 ## What changes - **Centred dialog (items 1, 7).** On a desktop, a dashboard or dataset-report drill now opens a non-modal Radix dialog sized `w-[70vw] h-[65vh]`, using the shared dialog surface (objectstack-ai#35980). Because it is non-modal, Radix draws no overlay: nothing behind it is dimmed or blurred. The header keeps the title and 「Open in list」, which is unchanged. On a phone (`useIsMobile`) the side drawer stays, with the same list inside. - **The body is the standard list (item 5).** The new `DrillRecordList` mounts the registry's `list-view` (the block the object list page uses) through `SchemaRenderer`, bound with `dataSource: { object }`. It is read-only: `userActions` turns off inline edit, add record, row colour and grouping; `showViewSwitcher={false}`; and the dialog never receives a save-view, add, bulk, edit, delete, sort-change or filter-change callback. When `list-view` is not registered, the drill falls back to the dashboard's data table, and its rows no longer open a stacked record panel. - **Conditions as the list's own chips (item 3).** The new `drillConditions.ts` splits the composed drill filter (widget filter, global filters, clicked bucket, measure scope) into the list's `initialFilters` rows, which are ordinary chips that can be edited and removed. Anything a chip row cannot say (a relationship path, `$or`, an unknown operator) stays the list's base `filter`, ANDed. A filter that is not the object form is lowered first. Examples are a page block's authored rule array `[{ field, operator, value }]` and an AST node. The lowering goes through the drill's own composition, `composeDrillFilter` in `@object-ui/core` (`mergeFilterNodes`, then the spec's `parseFilterAST`), and is not a new normaliser. A shape that cannot be lowered stays the list's base `filter` exactly as it arrived: one the conversion refuses (`FilterOperatorError`), and a non-empty one it answers nothing for (an array that is neither rules nor AST, a rule with a blank or missing field, a valid rule beside such an element). A string or number filter, which no list can read, lists nothing: the drawer shows its existing 「can't be listed from here」 notice and sends no read. No condition is ever dropped, and no drill reads every record. A condition stated twice is drawn once. On date fields, `$lt` and `$gt` are written as the list's own `before` and `after`, which lower to the same less-than and greater-than comparisons. - **Default columns (item 4).** The defaults are the object's name field, then the grouped fields, then the range fields, then the measured fields. A relationship-path dimension or range field (`crm_account.industry`) shows its lookup field (`crm_account`) instead. The grid has no dotted-column support, so the lookup column (the account's name) stands in for the related value. This applies to the dashboard widget and the dataset report alike. The measured fields are read from the answer's `drillScopes` (`{field: {$null: false}}`). An authored `drillDown.columns` still wins. 「View settings → Add column」 adds any other field. Added columns and column calculations live only in the dialog's state. - **Record name opens its full page (item 6).** `DrillNavigationContext` gains an optional `openRecord(objectName, id, {siblings, total})`. The app-shell hook implements it by navigating to the record page with history state `from = {pathname, label, siblings, total}`, the same shape a list hands the page it opens. The record page's existing stepper then reads 「1 of 3 · Pipeline Dashboard」, walks the drill rows, and its way back is the dashboard or report. `RecordDetailView` is unchanged. - **Report chart marks drill (item 2).** `DatasetReportChart` passed no `onChartClick`. A bar now maps through `findChartSeriesRow` to the summary line it stands for, and both go through one builder (`emitBucketDrill`), so the bar and its line open the same records with the same default `fields`. `drilldown: false` still offers no click. - **A host with no record page (page blocks).** The `object-metric` and `object-pivot` page blocks mount the drill without a `DrillNavigationProvider`, so there is no `openRecord`. There, a drilled row opens its record in a dialog (`RecordDetailDrawer`, `target: 'dialog'`), from both the standard list and the data-table fallback. Dashboard and report hosts are unchanged and open the record page. - The data-table fallback behaves exactly as on `main`. - The standard list reads only the fields it lists (`$select`). So its record dialog draws those fields, each with its value. It uses the authored `drillDown.columns` when given, as `ObjectDataTable` does. It does not list every field of the object with the unread ones shown as empty. - Values stay masked while the field types are unknown, through the drawer's `objectTypesPending` guard, as in the data table. - **Inside a page, the standard list too (objectstack-ai#36550).** React context crosses the dialog's portal, so a page block's drill list used to take the posture of the region holding the block. On a region half the page or wider that is the capped list: no toolbar, no chips, no pager, and a 「View all N」 link. That link went to the object's default list with no drill condition (L1-e measured it on HotCRM's 销售主页: 「查看全部 8 条」 landed on 10 open deals). `DrillRecordList` now clears the posture for its subtree with the new `PageRegionPostureReset` (`@object-ui/components`, next to `PageRegionPostureProvider`). The drill therefore draws the standard list everywhere, with its chips, record count and pager, and no 「View all」 link. The page's own list blocks keep their posture. - **Nothing is written (item 8).** No view, no preference and no record write comes from the dialog. Measured in the browser and pinned in a test (see below). - **Two `measuredFieldsOf` copies, on purpose.** One lives in plugin-dashboard `drillConditions.ts`, the other in plugin-report `DatasetReportRenderer.tsx`, and no shared helper was added to `@object-ui/core`. Their predicates differ. The dashboard copy reads a measure scope that is already one record list, and takes a field only when its whole condition is `{$null: false}`. The report copy reads the answer's `drillScopes` per line, and takes every `$null: false` field it finds. A scope that adds other conditions on the same field gets a column in the report but not in the dashboard. This is a known edge. - **New optional members:** `DrillNavigationValue.openRecord`, the `DrillRecordOrigin` type (`@object-ui/react`), `DrillDownDrawerProps.defaultColumns` and `DatasetDrillArgs.fields`. **New export:** `PageRegionPostureReset` (`@object-ui/components`, a `patch` entry (Metadata-protocol: none)). ## Tests <details><summary>Unit and integration runs (head 0290ee5)</summary> All runs below are under `scripts/pm/os-verify-lock.sh`, on head `0290ee50d3`. - Drill suites, run from `ui/` with `pnpm exec vitest run --maxWorkers=2`, covering: - plugin-dashboard: drillConditions, DrillDownDialog, DrillDownDrawer*, DatasetWidget* - plugin-report: all tests - app-shell: useOpenRecordList*, drillDialogStandardList-36256, ReportView*, DashboardView* Result: `Test Files 103 passed (103)` · `Tests 919 passed | 7 skipped (926)` · vitest exit 0. - `pnpm --dir ui exec vitest run scripts/` (derived): `Test Files 172 passed | 2 skipped (174)` · `Tests 5127 passed | 2 skipped (5129)` · exit 0. - Reverse check on the rebuilt `.d.ts`: a probe passed `{ siblings: ['a'], bogus: 1 }` to `openRecord`. `tsc` turned red with `TS2353 ... 'bogus' does not exist in type 'DrillRecordOrigin'` (exit 2). The probe was then removed, and `git status` is clean. </details> <details><summary>Type-check (built closure)</summary> - Built `@objectstack/spec` first, then `pnpm --filter '@object-ui/app-shell^...' run build`. Both exit 0. - `type-check` (the script name was echoed) exits 0 for each of `@object-ui/react`, `@object-ui/plugin-dashboard`, `@object-ui/plugin-report` and `@object-ui/app-shell`. Each runs `tsc --noEmit` and then `tsc -p tsconfig.test.json`. - Derived gates: `dispatch-gates --ran` reads `38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero)`. - `check-platform-checklist --changed-from origin/main`: OK. - `overlap-check`: `VERDICT clean exit 0`. The check covers objectstack-ai#36405 and objectstack-ai#36420, and both merge cleanly. </details> <details><summary>CI fix round (head bd8af5c)</summary> Four reds on 0290ee5 and f8140a7, each reproduced locally and then shown green: - **Type Check UI** was failing `check:spec-symbols`: the drill's chip-split file declared a local type named like a spec export (`Scalar`, owned by `@objectstack/spec/data`). The fix inlines the union. The check exits 1 on the old tree and 0 on the fix, measured with `@objectstack/spec` built. The other steps of the same job (`check:action-forward-parity`, `check:designer-field-key-parity`, `check:icon-record-names`, `check:i18n-keys`, `check:i18n-drift`) exit 0, and `type-check` exits 0 for `@object-ui/plugin-dashboard` and `@object-ui/app-shell` on the merged head. - **Lint UI:** `react-hooks/globals` flagged the drill dialog test's stub, which wrote a module-level variable during render. The stub now reports its props through a `vi.fn` spy. `eslint` on the old file gives 1 error. `lint` exits 0 (0 errors) for `@object-ui/plugin-dashboard`, `@object-ui/plugin-report`, `@object-ui/react` and `@object-ui/app-shell`. - **Test UI (10/16)** was failing `components/src/__tests__/dialogViewportGutterCensus-12603.test.ts`. The dialog lifted the width cap (`sm:max-w-none`), which the census reads as a wide dialog with no viewport gutter. It now caps at `max-w-[70vw]`, so the size is unchanged (70vw by 65vh) and the dialog keeps its own margin. The census fails 2 tests on the old tree; on the fix, the census plus the drill dialog suites read 4 files and 22 tests passed. - **Test UI aggregate on 0290ee5:** its seven shards were cancelled mid-run, when the next push started the concurrency group's new run. None of them failed. - **Build and E2E UI** failed in `check:eager-closure` before any spec ran: a superseded `PER_CHUNK_GZIP_CEILINGS` (main moved it, and nothing had grown). Merging `origin/main` (37367f3) clears it, as the gate prescribes. Readings on the new head: - The sibling drill suites (all of plugin-dashboard, plugin-charts and plugin-report; app-shell drill*, ReportView*, DashboardView* and useOpenRecordList*; console drillDownReport*; types drill-down*): 382 files and 4043 tests passed. - After the merge: 28 files and 230 tests passed. - `vitest run scripts/`: 172 files passed. - `dispatch-gates --ran`: 38 derived, 38 run, 0 NOT-MEASURED. - `overlap-check`: clean. </details> <details><summary>Round 7 (no dropped filter, standard list inside a page)</summary> **M6, a non-empty filter the conversion answered nothing for.** `composeDrillFilter` answers `undefined` without throwing for an array that is neither rules nor AST, a rule with a blank or missing field, and a valid rule beside such an element. `drillListConditions` read that as no filter, so the drill listed every record. Now a non-empty input (anything but `undefined`, `null`, `[]` or `{}`) whose conversion comes back empty is kept as the list's base filter, the same as the throwing path. - Measured with the real plugin-list over `ValueDataSource`: each such array reaches the read as `$filter` (a server refuses it as malformed), and the open deal is never listed. - A string or a number cannot be kept that way. The list's own `toFilterNode` reads a non-object as no filter, so the read went out with no `$filter` and listed 3 of 3 rows. `DrillDownDrawer` now shows its existing `unavailable` notice for such a filter and mounts no list, so no read is sent. This adds no new copy. **objectstack-ai#36550, the page region's posture inside the drill.** `DrillRecordList` wraps its subtree in the new `PageRegionPostureReset`. As L1-e found, the capped list's 「View all N」 link inside the drill came from the host's `compactListDestination`: the object's default view, with no drill condition. That link is no longer drawn there. **Pins, red on 942e9c2's `drillConditions.ts`, `DrillDownDrawer.tsx` and `DrillRecordList.tsx`, then green.** Red: `12 failed | 15 passed (27)`. Green: `27 passed (27)`. Restored with `git checkout HEAD --`, then checked: `git diff HEAD` empty and the blob hashes match. - `drillConditions-36256.test.ts`: six inputs the conversion answers nothing for (an array of a bare object, a blank field, no field, a valid rule beside a malformed one, a string, a number) stay the base filter as they arrived. `undefined`, `null`, `[]` and `{}` are still no filter. N8: an `and` node lowers to chips; an `or` node, and a rule array's any-of group, go to the base filter as `$or`. The N8 cases are green on both sides, because they pin behaviour that already held. - `app-shell/.../pageBlockDrillFilter-36256.test.tsx`: the three arrays above, each with every read carrying `$filter` and the open deal not listed. The string and the number show the `unavailable` notice and send no read. - `app-shell/.../pageBlockDrillPosture-36550.test.tsx`: the real page renderer, `object-metric` and `list-view`, with the region widths stubbed. The drill in the `main` region (856 of 1200 px) shows the chip `filter-chip-stage`, 「2 records」, no capped table and no 「View all」 link. CONTROL: the page's own `list-view` block in the same region stays capped (3 capped rows and 「View all 3」). Red: no chip in the dialog. **Live re-check on HotCRM 销售主页.** Branch Console at de4dfdf456 over HotCRM `origin/main` (689166c). The same local-only `drillDown` was added to `kpi_revenue_won`; it was not committed and was reverted afterwards. - The tile reads 1,290,000. The drill dialog draws the standard list: the toolbar, the chip 「阶段:成交」, the columns 商机名称 / 所属客户 / 金额 / 预计成交日期, 8 rows and 「8 条记录」. - No 「查看全部」 link and no capped table inside the dialog. The page's own list blocks stay capped (3 capped tables on the page). - The 8 rows are exactly HotCRM's 8 `closed_won` opportunities out of 23. - The read: `/api/v1/data/crm_opportunity?populate=crm_account&top=25&select=id,name,crm_account,amount,close_date,stage&filter=["stage","=","closed_won"]`. - Shot: project files `repo-objectstack-7/card-36256/hotcrm-r7-sales-home-drill.png`. **Runs on de4dfdf456.** That tree was pushed as 8e8c3bf, which differs only in a reworded trailer. a9d781d then changes only the changeset's `@object-ui/components` grade from `minor` to `patch`, as the `Check Changeset` level axis requires under `Metadata-protocol: none` (run offline with this body as the event: exit 0). plugin-dashboard + plugin-report: 251 files, 2425 passed / 13 skipped. components: 505 files (1 skipped), 4914 passed / 24 skipped. app-shell drill and page-block suites plus plugin-list's three posture pins: 15 files, 168 passed. type-check exit 0 for components, plugin-dashboard, plugin-report and app-shell. lint 0 errors for components, plugin-dashboard and app-shell. `overlap-check`: `VERDICT clean exit 0`, with 0 open PR heads sharing a file, the components index included. </details> <details><summary>Round 6 (page-block drill filter)</summary> **The defect.** Found live by L1-e, on HotCRM's 销售主页 tile 总收入(全部期间). - The tile is an `object-metric` block whose `filter` is the spec's rule array, `[{ field: 'stage', operator: 'equals', value: 'closed_won' }]`. - The drill list split only an object-form filter, so it received neither chips nor a base filter. It listed all 23 opportunities where the tile counts 8. - **Main kept the filter.** On main the drill went to the data table, which handed the array to `$filter` as written. The adapter lowers it. - Measured on origin/main a3ee862 with the same object-metric fixture over an in-memory matcher. The read's `$filter` was `[{"field":"stage","operator":"equals","value":"closed_won"}]`, and the rows were the 2 won deals only. - So this PR introduced the regression, and round 6 fixes it. **Pins, each run red on b91ec49's `drillConditions.ts` and `DrillRecordList.tsx`, then green.** Red: `4 failed | 7 passed (11)`. Green: 11/11. - `plugin-dashboard/__tests__/pageBlockDrillFilter-36256.test.tsx`: - An `object-metric` block with the HotCRM rule array: the drill list gets the chip `stage equals closed_won`. Red: `expected { chips: [], base: undefined }`. - An `object-pivot` block with the same rule array: the drill list gets the block's condition and the clicked cell's. This one is green on both sides, because the pivot composes through `composeDrillFilter` before the drill. - `app-shell/src/views/pageBlockDrillFilter-36256.test.tsx`: the real `@object-ui/plugin-list` over `ValueDataSource`. The drill lists exactly the won records the tile sums, never the open one, and its read's `$filter` carries `closed_won`. Red: the open deal was listed. - `drillConditions-36256.test.ts`: - A rule array lowers to a chip, and so does an AST node. - A shape the spec refuses (`[['stage', 'in', 'won']]`) stays the base filter exactly as it arrived. **Live re-check on HotCRM.** Branch Console, HotCRM `origin/main` on 18.6.0. A local-only `drillDown` (`{ enabled: true, target: 'dialog', columns: ['name','crm_account','amount','close_date'] }`) was added to `kpi_revenue_won`; it was not committed and was reverted afterwards. - The tile reads 1,290,000, and the drill lists 8 rows. - Those rows are exactly HotCRM's 8 `closed_won` opportunities (out of 23), each with stage `closed_won`. - The read: `/api/v1/data/crm_opportunity?populate=crm_account&top=25&select=id,name,crm_account,amount,close_date,stage&filter=["stage","=","closed_won"]`. - Shot: project files `repo-objectstack-7/card-36256/hotcrm-r6-sales-home-drill.png`. </details> <details><summary>Round 5 (S3, S4, N4; head b91ec49)</summary> All runs are under `scripts/pm/os-verify-lock.sh`, from `ui/` with `pnpm exec vitest run --maxWorkers=2`. - **S3 pin** (`ObjectMetricWidget.drillOpensRecord-36256`, a new case). The list stub answers with the record projected to its listed columns, the way the list's `$select` read does. The object has 5 fields, and the drill lists 3. - Red: `DrillRecordList.tsx` at c59a3fc gives `1 failed | 2 passed (3)`, with `expected [ 'Name', 'Stage', 'Amount', …(2) ] to deeply equal [ 'Name', 'Stage', 'Amount' ]`. - Green: restored with `git checkout HEAD --` and `git diff HEAD` empty, giving 3/3. - **S4.** - The `openRecord` jsdoc now reads "Absent ⇒ the drill opens the record in a dialog." - DELIBERATE CORRECTION of `.changeset/36256-drill-dialog-standard-list.md`. Its last sentence now reads: "A renderer without `@object-ui/plugin-list` registered lists the drilled records in the dashboard's data table. A host that gives no `openRecord` (a page block's metric or pivot) opens the drilled record in a dialog, from either body." - **N4.** `range.field` takes its first segment in both `DatasetWidget` and `emitBucketDrill`. Other readings on b91ec49: - plugin-dashboard + plugin-report in full: `Test Files 250 passed (250)` · `Tests 2411 passed | 13 skipped (2424)` · exit 0. - `type-check` exits 0 for plugin-dashboard, plugin-report and react, after the closure build. `lint` gives 0 errors for all three. - `vitest run scripts/`: 172 files passed. - `dispatch-gates --ran`: 38 derived, 38 run, 0 NOT-MEASURED. - `overlap-check`: clean. </details> <details><summary>Round 4 (head 5af2f6e)</summary> All runs are under `scripts/pm/os-verify-lock.sh`, from `ui/` with `pnpm exec vitest run --maxWorkers=2`. - Red, then green, with the round-4 source reverted to the round-3 head (0a48051) and then restored (byte-compared with `cmp`, and the marker `grep -c` read 0 then 1): - The path-column pins: red 2 failed / 2 passed (4), green 4/4. Covers `DatasetWidget` and `DatasetReportRenderer.chartMarkDrill-36256`. - The S1, S2 and N2 pins: red 3 failed / 9 passed (12), green 12/12. - The red reasons: `expected [ 'amount' ] to deeply equal [ 'crm_account', 'amount' ]`, and `Unable to find [data-testid="record-detail-body"]` (twice). - The N2 phone pin, by mutation through `scripts/ablation-replace.mjs` (`&& !phone` removed): `1 failed | 6 passed (7)`. The restore was verified as blob equal to HEAD with an empty `git diff HEAD`. - The full plugin-dashboard + plugin-report run: `Test Files 250 passed (250)` · `Tests 2410 passed | 13 skipped (2423)` · exit 0. - The app-shell drill suites (9 files): 132/132. - `type-check` (the script name was echoed, and it chains `tsc -p tsconfig.test.json`) exits 0 for `@object-ui/plugin-dashboard` and `@object-ui/plugin-report`, after building the `^...` closure. - `lint` exits 0 for both, with 0 errors. </details> New card-named tests: - `plugin-dashboard/src/__tests__/drillConditions-36256.test.ts`: chip rows versus the base filter, de-duplication, date bound wording, and measured fields. - `plugin-dashboard/src/__tests__/DrillDownDialog-36256.test.tsx`: - The dialog is centred and sized, with no overlay. - The list schema is read-only. - The chips, the default columns, and that added columns and calculations stay in local state. - The record name calls `openRecord` with the shown rows and closes the drill. - Phone keeps the drawer: `useIsMobile` is mocked true, and a mutation of the phone branch turns it red. Without `list-view` registered, no panel is stacked. - `app-shell/src/views/drillDialogStandardList-36256.test.tsx`: the real `@object-ui/plugin-list`. The chips are removable, and a removal re-reads without the condition. There are zero `create/update/delete/bulk` calls, no non-GET fetch and no `localStorage.setItem`. Columns lead with Name, then the drilled fields. - `app-shell/src/views/useOpenRecordList.drillRecordPage-36256.test.tsx`: `openRecord` drives `useRecordPageReturn`, giving the stepper 2 of 3, next to 3 of 3, and back to the dashboard URL including its query. - `plugin-report/src/__tests__/DatasetReportRenderer.chartMarkDrill-36256.test.tsx`: a bar and its summary line emit the same `objectFilter` and `fields`. `drilldown: false` offers no click. A `crm_account.industry` line drills on the nested condition with fields `['crm_account', 'amount']`. - `plugin-dashboard/src/__tests__/DatasetWidget.drillDialog-36256.test.tsx`: `DatasetWidget` itself opens the dialog (`target="dialog"`, `open`), with these default columns: - A chart mark (`onSegmentClick`): the grouped field, then the range field, then `measuredFieldsOf(scope)`, which gives `['stage', 'close_date', 'amount']`. - A metric tile: `measuredFieldsOf(readMeasureDrillScope(...))`, which gives `['amount']`. - A `crm_account.industry` slice: `['crm_account', 'amount']`. - `plugin-dashboard/src/__tests__/ObjectMetricWidget.drillOpensRecord-36256.test.tsx`: an `object-metric` block with no provider opens the drilled record in a dialog, from the standard list and from the data-table fallback. Changed tests: - `DrillDownDrawer.chain.test.tsx` is split by host: with a record page, the fallback rows are inert; with no record page, they stay drill-to-record. - `summarySubtotals-27975` now expects `fields: ['owner_id']` on the subtotal drill. ## Acceptance notes **HotCRM walk (round 4).** Branch Console at 5af2f6e's source, against HotCRM booted from the published 18.6.0 packages. Desktop at 1440×1000, zh-CN. The executive dashboard (高管总览) and the 各阶段商机 report. - **行业收入分布, slice 科技.** The dialog opens with 3 records. The columns are 商机名称, 所属客户 and 金额, so the lookup column stands in for the industry. The industry condition is a locked chip reading 「所属客户:= [object Object]」. That is the remainder carried by objectstack-ai#36507. It does not read "View filter".  - **收入趋势, month 2026年8月.** 1 record. The chips are the 12-month window plus the bucket: 预计成交日期 ≥ 2026-08-01 and 早于 2026-09-01. The columns are 商机名称, 预计成交日期 and 金额. - **年度累计收入 tile (1,290,000).** 8 records. The chips are 阶段:成交, the date bounds and 金额. The columns are 商机名称 and 金额. - **各阶段商机 report.** The 谈判 bar and its summary cell 1,294,000 open the same 2 records, with identical names in the same order: Wayne Enterprise License and Vertex Enterprise Rollout. The chips and the columns (商机名称, 阶段, 金额) are the same for both. - **Global filter.** - Set to 上季度, the only date-bound widget (阶段管道分布) is empty in HotCRM's data. Its query asks for close_date 2026-07-01..2026-09-30 and returns `[]`, so there is no mark to drill.  - The count match therefore uses 今年 instead, the nearest range that has data. The 需求分析 bar reads 93,000 in the chart's answer. The dialog carries the date condition as chips (预计成交日期 ≥ 2026-01-01 and ≤ 2026-12-31) and lists 1 record, whose amount sums to 93,000.  - **Record name.** Clicking Wayne Enterprise License opens its record page, reading 「第 1 条,共 2 条 · 各阶段商机」.  - More shots: [month](https://raw.githubusercontent.com/objectstack-ai/objectstack/5290b53bed7b42c0dbbd1a3c1dc23b4a36d4c512/hotcrm-revenue-month.png) · [YTD tile](https://raw.githubusercontent.com/objectstack-ai/objectstack/5290b53bed7b42c0dbbd1a3c1dc23b4a36d4c512/hotcrm-ytd-tile.png) · [report bar](https://raw.githubusercontent.com/objectstack-ai/objectstack/5290b53bed7b42c0dbbd1a3c1dc23b4a36d4c512/hotcrm-stage-bar.png) · [report cell](https://raw.githubusercontent.com/objectstack-ai/objectstack/5290b53bed7b42c0dbbd1a3c1dc23b4a36d4c512/hotcrm-stage-cell.png). The images live on the `claude/issue-36256-shots` branch, which holds no code. - **Writes:** none from the dialog. The only non-GET requests were `PATCH sys_user_preference` (the dashboard's recent-visit entry) and the record page's own `POST .../page` read. Browser walk on `examples/app-crm` (Pipeline dashboard), desktop at 1440×900. The screenshots are in the project files under `repo-objectstack-7/card-36256/`: - `1-bar-dialog.png`: the bar 「Closed Won」. The dialog box measured 1008×585 px, which is exactly 70% × 65%. The overlay count is 0. Chips: Expected Close ≥ / ≤ (from the widget), Stage: Closed Won, Expected Close before 2027-01-01. Columns: Opportunity Name, Stage, Expected Close. 3 records. - `2-donut-dialog.png`: the donut slice 「Prospecting」. Chips: Stage is none of Closed Won, Closed Lost; Deal Value is_not_null; Stage: Prospecting. Columns: Name, Stage, Deal Value. - `3-line-dialog.png`: a line point 「2026-10」. Chips: the 12-month window plus the month bucket. - `4-kpi-dialog.png`: the tile 「Won This Quarter」. Columns: Name, Deal Value. - `5-chip-removed.png`: Stage: Closed Won removed. The list re-read and showed 6 records. Closing and reopening restores the original chips. - `6-added-column.png`: View settings → Add column → Deal Value is added as a 4th column. - `7-record-page-1-of-3.png` and `8-record-page-2-of-3.png`: clicking a record name opens its full page reading 「1 of 3 · Pipeline Dashboard」, with no dialog left open. Next goes to 「2 of 3」. 「Pipeline Dashboard」 returns to the dashboard URL. - `9-phone-drawer.png`: at 390 px wide the drawer keeps the phone list, with a filter badge of 5 and 3 records. - **Writes:** - During the open, sort, add-column, chip-removal and close/reopen phases, zero non-GET `/api/` requests were captured, apart from the dataset reads. - The single `PATCH sys_user_preference` seen was the dashboard's own recent-visit entry (`type: dashboard`), fired on page load. A second one came from the record page's recent-visit entry. Neither comes from the dialog. - **Known edges, each with its carrier:** - Raw operator ids on chips. HotCRM measured 「金额:is_not_null」 on every drill whose measure scope is `$null: false`, and 「阶段:not_equals 失败」 on the report drill (from `$ne`). The cause is plugin-list `quickOperatorLabel`, which has no words for `not_equals`, `greater_than`, `less_than`, `is_null` or `is_not_null` and prints the stored id. The drill does not swap in a near-synonym. Carrier: objectstack-ai#36462. - A string or number drill filter lists nothing, with the drawer's existing `unavailable` notice and no read (a deviation from the round-7 recipe, accepted by the seat): no list can carry such a filter, and the list's own `toFilterNode` would read it as no filter and list every record. - The relationship-path chip. A slice grouped by `crm_account.industry` lists the right records, but its locked chip reads 「所属客户:= [object Object]」 (see the industry shot above). Carrier: objectstack-ai#36507. - Other conditions a chip row cannot say also stay in the locked base filter, worded by the list. Measured with the real plugin-list: an `$or` reads 「View filter」, while an operator the rows have no id for (`$startsWith`) reads 「Owner: startswith A」. - A long chip row is cut at the dialog's right edge; the list's own chip bar decides this. - The line bucket title shows the raw key (「2026-10」), as before. - The drill's matched total does not reach the record page (found in round 7). Carrier: objectstack-ai#36554. `ListViewBlock` hands `ListView` its own `onTotalChange={reportTabCount}` after spreading the props, so the drill's `onTotalChange` is replaced (by `undefined` outside a `page:tabs` panel). Measured with the real list over a source answering `total: 40` for 2 rows: `openRecord` received `{ siblings: ['d1','d2'] }` and no `total`. So the stepper's M is the rows on screen, not the match count, once a drill holds more rows than one page. A fix needs a plugin-list edit, which is outside this PR. By the same code read, not measured: a drill opened from inside a `page:tabs` panel would report its count to that tab's badge. - **Dataset-report chart mark:** app-crm ships no dataset report, so it was not walked there. It is now walked on HotCRM's 各阶段商机 report (above), and it is also covered by the plugin-report test. - Desktop and phone viewports were measured. Tablet was not. - **Deviations:** - `ui/packages/react/src/context/DrillNavigationContext.tsx` (the optional `openRecord` member) is outside the declared file surface. - The claim was amended to `Clause-②: yes (widening)` on the built `.d.ts` closure reading (the four new optional members above); the declaration line above and the changeset follow it. - `pnpm dev:crm` refused on `check-dev-prereqs` (missing dists), so the walk ran `objectstack dev` directly in `examples/app-crm`. - The inline HotCRM shots are served from a separate code-free branch, `claude/issue-36256-shots`. It holds one orphan commit with 8 PNGs and went up in the same `git push` as this branch. GitHub has no other host for an agent-written body's images. ## Verification Read first: 1. `ui/packages/plugin-dashboard/src/drillConditions.ts`: the filter-to-chip split. If a condition is dropped or mis-worded, the list shows the wrong records. 2. `ui/packages/plugin-dashboard/src/DrillRecordList.tsx`: the read-only schema and the `openRecord` set. 3. `ui/packages/plugin-report/src/DatasetReportRenderer.tsx`: `emitBucketDrill`, now shared by the summary line and the chart mark. Two-minute check: run `pnpm dev:crm`, open Analytics → Pipeline and click the 「Closed Won」 bar. Expect a centred dialog with nothing dimmed behind it, the Stage: Closed Won chip, and 3 records. Click 「Initech — Pilot」 and expect the record page to read 「1 of 3 · Pipeline Dashboard」. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jREBdDtYvSLn38xUCg <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jREBdDtYvSLn38xUCg --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Steedos · project thread
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUeSU9HhKxjcVsyprx
Fixes #36372
Clause-②: yes (widening) — one new exported core function (
dashboardFiltersNotApplied), two new optionalDashboardRendererprops (onWidgetResize,onAddFilter), and new@object-ui/i18nkeys (dashboard.inPageEdit.*,dashboard.filters.notApplied,dashboard.filters.addFilter); nothing removed or renamedMetadata-protocol: none
维护者速读
What changes
Edit state on the dashboard page (
DashboardView+ newDashboardInPageEditor.tsx). A workspace admin who may author metadata, on a package Studio lists (useStudioEntryGate, the gate of the app → Studio entries; writable or read-only, never a kernel package), gets an Edit button in the page header (fromsmup: the edit state needs its side panel). Edit opens the dashboard as stored — the layered read'seffectivein the package a save would land in (a customization pair that is not listed yet, or does not hold it yet, opens its base's) — never the served, translated copy. Opening writes nothing: it reads the package list and the item only. In the edit state:DashboardWidgetInspectorfor a selected card (its data, the "follow page filters" switches, Remove) andDashboardDefaultInspectorotherwise (label, cards, filters, layout);Save (
saveDashboardInPlace) is the confirmed-save door of #35955 (ruling 7058616478): the body is staged as the item's draft under the first-write pin and that one item is published in the same act — no package-wide publish-drafts. Where it lands is read at open byresolveDashboardEditTarget(package list only): the owning package when the list carries it writable, else the app's customization package, whose id is taken from the list when it is already listed (listedCustomizationPairOf, the read Studio makes of a pair). At Save, and only there,ensureDashboardSaveTargetasks the ensure door for the pair (it creates<base>.customon first use, as Studio's first saved customization does), and the body declaresoverrides: { package, basedOn }(overrideDraftBody, the body Studio's Customize writes; ADR-0146 D2/D3). So an installed app's dashboard is edited too, through the same doors Studio uses. The edit state is refused up front where Studio's Customize is: the ensure door walled for this caller (useCustomizeDoorWalled, toast "only the platform operator can customize an installed app's dashboard") and a base listing no version to declare the override at when the item declares none yet (Studio'snoVersion). Over a draft already pending there, the edit state is not entered, and a save that races one writes nothing ('pending-draft'): a Studio draft is never published on its saver's behalf. Discard drops the buffer and writes nothing. After a save the bundle re-read keeps the shown dashboard standing, so the page does not flash its skeleton. The edit state draws the stored document with the served_packageIdbeside it, so its cards' dataset queries keep naming the dashboard's package (callerPackage, ADR-0150 D3) as in view mode; a save drops_keys.The not-filtered mark (
plugin-dashboard). Every card, in every mode, names the page filters that do not reach it ("Not filtered by Region and Owner"; zh 「不跟随『区域和负责人』筛选」): a filter it opts out of (filterBindings[name]: false) or one whosetargetWidgetsleaves it out (an explicit string binding wins overtargetWidgets). The built-in date filter is named as the bar names it ("Date range"), never by its reserved name. The list is the new coredashboardFiltersNotApplied(widget, defs), which asksresolveBoundField— the bindingbuildWidgetScopedFilterbuilds the card's query from — so the mark and the data cannot disagree. A card every filter reaches carries none.Renderer design mode gains two opt-in affordances:
onWidgetResize(widgetId, { w, h })draws the corner handle (snaps as the pointer crosses half a track; arrow keys step by one; width clamped to the grid's columns; not drawn on a phone), andonAddFilter()draws "Add filter" in the filter bar (the bar is drawn for it even before any filter exists). Studio's canvas passes neither, so it is unchanged.Persistence seam.
saveAndPublishRuntimeMetadataitself is unchanged:saveDashboardInPlacehands it a client that names the target package on the three writes it makes (draft, publish, discard of a refused publish).Studio is not touched; panel wording is #36373's (not touched here).
ADR: this realises the in-app half of the ADR-0146 D1 amendment row "ADR-0146 D1, "Studio owns all metadata"" that seat 7 filed on the weekly ADR card #36086 (epic #36359); no
docs/adredit here. Persistence stays on the ADR-0034 runtime metadata seam (draft + per-item publish through/meta).Tests
ui/packages/core/src/utils/__tests__/dashboard-filters.test.ts—dashboardFiltersNotAppliedagrees withbuildWidgetScopedFilterfor default, opted-out, rebound,targetWidgets-listed and explicit-over-list widgets.ui/packages/plugin-dashboard/src/__tests__/DashboardRenderer.filters.test.tsx— the mark is on the opted-out card and only it, a rebound card has none, atargetWidgets-excluded card has it, an opted-out built-in date filter reads "Not filtered by Date range"; each case reads the query'sruntimeFilterbeside the mark.ui/packages/plugin-dashboard/src/__tests__/DashboardRenderer.designMode.test.tsx— the corner handle only withonWidgetResizein design mode, keyboard resize, no card selection from the handle; "Add filter" only in design mode, drawn before any filter exists.ui/packages/plugin-dashboard/src/designAffordances.test.ts—resizedSpansnapping and clamps.ui/packages/app-shell/src/views/runtime-metadata-persistence.test.ts— edit target read from the list only (writable package; read-only package with no pair listed: none named, ensure not called; a listed pair named for reading; unbound; refusal), the ensure door asked at save (pair withbasedOn; refusal and non-writable pair throw), the save body, the target package named on draft/publish/discard, pending-draft writes nothing.ui/packages/app-shell/src/views/DashboardInPageEditor.test.ts— opening (owner's layeredeffective; an installed app with no pair yet opens its base's reading no pair and with no ensure door at all; a listed pair that does not hold it opens its base's; refused when walled and when no version is listed, but not for an item that already declares its override; refused over a pending draft without reading; refusals), add card, resize keeps unnamed coordinates.ui/packages/app-shell/src/views/DashboardView.inPageEdit-36372.test.tsx— through the realDashboardViewand renderer: no Edit button behind the gate; Edit opens the stored document in design mode with badge and panel; resize + Save stages and publishes in the owning package and leaves the edit state; an installed package asks the ensure door at Save only and saves intocrm.customdeclaring the override; Edit then Discard on an installed app calls the ensure door zero times and writes nothing; a walled door refuses with its reason; a dataset card in the edit state still queries withcallerPackage(ablated: red without the fix); a pending draft refuses; Discard writes nothing.Acceptance notes
Live run (L1-e's REWORK) on head
f0750e0dd: a fresh local showcase backend (objectstack dev --seed-admin, file DB) and the console from source (ui/apps/consoleVite against it), driven by Playwright as the seeded admin. The writable leg uses a package created over REST (com.example.livedash, depending oncom.example.showcase) holding an app and a four-card dashboard with one card opted out of the date range; the installed leg uses showcase's ownshowcase_ops_dashboard(com.example.showcase, listed read-only, version 0.1.0).w3 → 6), added a Metric card (given its dataset and measure in the panel; Save without them is refused by the server, 422widgets.N.dataset, shown in the "could not be saved" toast with that reason), removed "Tasks by Status" through the panel. Writes on Edit: none. Writes on Save: exactlyPUT /api/v1/meta/dashboard/livedash_board?mode=draft&package=com.example.livedash(200,state=draft) thenPOST …/livedash_board/publish?package=com.example.livedash(200). No/packages/:id/publish-drafts.w_priority, w_tasks, w_all_time (w 6), widget_1; the page draws that order, the widened card, the added "Open tasks (added live)" and no "Tasks by Status".["com.example.showcase"](no.customcreated); the page shows the original titles.<base>.customPOST /api/v1/packages/com.example.showcase/ensure-customization,PUT …/showcase_ops_dashboard?mode=draft&package=com.example.showcase.customwithoverrides: { package: "com.example.showcase", basedOn: "0.1.0" }(server: "Saved customization overlay"),POST …/publish?package=com.example.showcase.custom. After a reload the page shows "Total Budget (customized live)". Studio's Interfaces (/studio/com.example.showcase/interfaces?surface=dashboard:showcase_ops_dashboard) shows the same title, the "Overrides ObjectStack Showcase" badge and "Only customizations (1)".filterBindings: { dateRange: false }) reads "Not filtered by Date range"; no other card is marked. Last 90 days: follows 10, all-time 10; Yesterday: follows 1, all-time 10 (unchanged).filterBindings; draft + per-item publish only. After a reload: no mark on any card; Yesterday: follows 1, all-time 1 (now follows).The live run found two defects, fixed in
f0750e0ddand pinned: the mark named the built-in date filter by its reserved name ("dateRange"), and the edit state's dataset queries dropped?callerPackage=(the stored document carries no_packageId).Screenshots (live run, 2× scale) are in the project's shared files, under
repo-objectstack-7/shots/36372/; they cannot be uploaded to GitHub from the cloud seat, as on #36397. They replace the harness shots.live-en-edit-writable.png— edit state on the writable dashboard: Editing badge, hint, Add card / Discard / Save, dashed cards, the widened card selected with its panel, the marked card.live-en-view-marked-card.png— view mode with "Not filtered by Date range" on the opted-out card, under "Yesterday".live-en-edit-installed.png,live-zh-edit-installed.png— edit state on the installed showcase dashboard (zh: 「编辑中」「保存后所有人立刻看到」, five cards marked 「不跟随「Task Status」筛选」).live-en-after-reload-writable.png,live-en-after-reload-installed.png,live-en-studio-interfaces.png,live-en-view-after-switch-on.png— the after-reload and Studio readings above.Known gap (not in this card): leaving the page in the edit state with unsaved changes drops them without asking. #36362's unsaved-edits seam (
useRegisterUnsavedEdits) is the place to register it, in a later card.Undo, a business user's own copy, a new dashboard, chart drawing and drill-down are out of scope, per the card.
Verification
f0750e0dd: type check@object-ui/app-shelland@object-ui/plugin-dashboardgreen;packages/plugin-dashboard/src, the dashboard view / editor / persistence files,coredashboard-filters andAppContent.dashboardRouteReads-28784— 223 files, 2213 tests green;packages/i18n/src/__tests__106 files green;check-i18n-en-drift,check-i18n-call-site-keys,check-i18n-dead-keysgreen.overlap-check: clean against main and 7 open PRs (fix(console): Shared in Add view only for administrators who can write it, and published at once (#36409) #36398 included).3e7995a73(before this round):node scripts/pm/dispatch-gates.mjs --commands, 72 derived families all run and accounted (--ran); four first-pass reds re-run exit 0 (comment-mask sweep reading a deleted harness file,vitest run scripts/killed for memory,check:skill-examplesprerequisite,check:test-source-aliasfixed in the tests). This round's diff (app-shell editor, two i18n keys in every locale, the mark's label, docs) is left to CI's gates.https://claude.ai/code/session_01QsR2jUeSU9HhKxjcVsyprx
🤖 Generated with Claude Code