Repository navigation
Commit 25b8ef3
feat(studio): the list-view panel edits a non-grid view's own settings (calendar, gallery, timeline, gantt, map, tree) (#27931)
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg4i9JiKjEjwtuVzd4gKy9hB)_
## 维护者速读
- 改了什么:Studio › 界面 ›
列表视图面板,新增「本类型设置」区:日历、画廊、时间线、甘特、地图、树形视图自身的设置(如日历的开始日期字段与标题字段)现在可在面板里改,字段按名称(label)挑选。
- 为什么改:「添加视图」建出非表格视图后,Studio 只能改看板卡片,其他类型建好就再也改不了自身设置。
- 风险与回滚:只动 Studio 面板与两条 i18n;表格与看板面板不变;整个 PR 回滚即恢复原状,无数据迁移。
- 先看:`ListViewTypeSection.tsx`(按 spec 块的 JSONSchema 交给通用 SchemaForm
渲染)、`ObjectListViewInspector.tsx` 中挂载这一区的那几行、新测试文件。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/ObjectListViewInspector.typeSettings-27895.test.tsx`,预期
9 passed。
- 需要你做的:无,席位落地。
Fixes #27895
Clause-②: no
Metadata-protocol: none
## What changes
- **New section, one per view type that has a block of its own.** On a
calendar, gallery, timeline, gantt, map or tree view, the list-view
panel shows "TYPE settings" above the columns. The section is the list
body's block of that type's name (`calendar`, `gallery`, …), rendered by
the generic `SchemaForm` from the spec's own JSONSchema for that block
(`getListVariantSchema().properties[type]`). Which settings a type has,
which are required and which enum values are allowed all come from the
spec; a key the spec adds to a block appears with no change here. There
is no per-type field list.
- **Fields are picked by label.** The form is given the panel's field
catalog, so every `*Field` setting is the field picker (label beside
machine name) and every `*Fields` setting the multi-field picker, by the
form's existing name convention.
- **Not in this section:** `grid` (no block), `kanban` (its card keeps
`KanbanCardSection`), and `chart` (its block binds an ADR-0021 dataset
and that dataset's measures, not the object's fields; see Acceptance
notes).
- **A field the block already names stays offered** in the panel's
pickers, as the columns, filter, sort and kanban card already do
(`fieldNamesHeldBy`).
- **Copilot marks:** a copilot or MCP change under the block puts the
draft chip on the section heading and counts toward the source line.
- **i18n (en, zh):** `engine.studio.inspector.listView.typeSettings`,
`…typeSettings.intro`, and the missing view type name
`engine.inspector.view.type.tree`.
## Tests
`ObjectListViewInspector.typeSettings-27895.test.tsx`: the real
`useObjectListViewDraft` hook and the real panel over a real
`MetadataClient`, whose transport parses every view PUT with the
installed spec's `view` schema and answers 422 on refusal.
- a calendar: start date and title picked by label; the saved draft
holds `{ startDateField: 'start_date', titleField: 'summary' }`, the
spec accepts it, and columns and type did not move;
- a gallery's cover field and a timeline's start date field, the same
way;
- the section draws every key the spec's calendar block declares, and no
other;
- opening a view writes nothing (the buffer stays clean, and a save
sends the block as stored, with no defaults filled in);
- a read-only package draws the settings disabled;
- controls: a grid has no section; a kanban keeps its card section and
gets no second one; a chart gets no section.
<details><summary>Ablation (one-time, not kept)</summary>
`node scripts/ablation-replace.mjs` replaced the line that resolves the
section's schema in `ObjectListViewInspector.tsx` with a constant
`null`: anchor 1 to 0, blob `dbd6ee1d` to `b3327689`. The suite went **6
failed, 3 passed** (the three controls). Restored: blob equals HEAD
`dbd6ee1d`, `git diff HEAD` empty.
</details>
## Acceptance notes
- **Chart is not covered.** A chart view's block is `{ chartType,
dataset, values, dimensions }`: an ADR-0021 dataset name and that
dataset's measure and dimension names. The generic form would draw them
as free text, not pickers, so the section leaves chart out by name. The
Create View dialog already has the dataset and measure pickers
(`useDatasetCatalog`, `useDatasetSemantics`). Filed by the seat as
#27933.
- **Setting labels are the spec's.** A setting's label is the form's
rendering of its key ("Start Date Field") and its help is the spec's
`.describe()` text, in English in every locale, as in the Console's own
view inspector, which renders the same blocks the same way. The section
heading and intro are translated.
- **A cleared required setting is held, not sent** (rework on
`d3a3888a`). The field picker still offers "None". Clearing a required
setting (a calendar's start date) keeps the block written, and
`listViewHeldEdit` asks the spec's `ListViewSchema` (`objectHeldInput`).
The list-view autosave then holds the edit, and the pillar shows the
held line ("Start Date Field needs a value…"), whose "Show me" focuses
that control. `confirmDropUnsavedWork` counts it before the pillar
leaves the leaf. A finished but wrong block is still sent, and its
refusal shows as before. Pinned by
`StudioDesignSurface.listViewTypeHeld-27895.test.tsx` (3/3, two
ablations). Side effect: an emptied block of a type with no required
setting is written as `{}` instead of being dropped; the spec accepts
it.
- No new endpoint, client or metadata key: the section writes
`config.TYPE` of the same view item through the panel's existing draft
door.
## Verification
Run on head `e8ddf333`; the rework's own readings (the new pin 3/3, 128
neighbouring files 1582 passed, type-check 0, dispatch-gates 34/34) are
on `d3a3888a`:
- `pnpm --dir ui exec vitest run` over the new file: 9 passed.
- `pnpm --dir ui exec vitest run` over every
`ObjectListViewInspector.*`, `InterfacesPillar.*`,
`StudioDesignSurface.listViewInspector-11823`,
`StudioDesignSurface.kanbanCardSelection-12725`,
`StudioDesignSurface.leafColumnSelection-12725` test and
`packages/i18n/`: 116 files, 1537 passed, 13 skipped.
- `pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run
type-check`: exit 0.
- `ui` i18n gates (`check-i18n-call-site-keys`, `check-i18n-dead-keys`,
`check-i18n-en-drift`) and `pnpm --dir ui check:new-line-citations`:
exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 34 derived commands,
each run and reconciled with `--ran`; the per-command exits are in the
report comment.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CYotPfA6zhPC8hhqkF)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 11137d4 commit 25b8ef3
8 files changed
Lines changed: 772 additions & 11 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views/studio-design
- i18n/src/namespaces/studio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
570 | 576 | | |
571 | 577 | | |
572 | 578 | | |
573 | | - | |
574 | | - | |
575 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
576 | 583 | | |
577 | 584 | | |
578 | 585 | | |
| |||
587 | 594 | | |
588 | 595 | | |
589 | 596 | | |
| 597 | + | |
590 | 598 | | |
591 | 599 | | |
592 | 600 | | |
| |||
659 | 667 | | |
660 | 668 | | |
661 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
662 | 682 | | |
663 | 683 | | |
664 | 684 | | |
| |||
902 | 922 | | |
903 | 923 | | |
904 | 924 | | |
905 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
906 | 928 | | |
907 | 929 | | |
908 | 930 | | |
| |||
1058 | 1080 | | |
1059 | 1081 | | |
1060 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1061 | 1086 | | |
1062 | 1087 | | |
1063 | 1088 | | |
1064 | 1089 | | |
1065 | 1090 | | |
1066 | 1091 | | |
| 1092 | + | |
1067 | 1093 | | |
1068 | 1094 | | |
1069 | 1095 | | |
| |||
1194 | 1220 | | |
1195 | 1221 | | |
1196 | 1222 | | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1197 | 1235 | | |
1198 | 1236 | | |
1199 | 1237 | | |
| |||
0 commit comments