Repository navigation
fix(app-shell): the dashboard's Add-widget menu and widget Type select offer every spec widget type, from one registry - #26967
Merged
Conversation
…derived from the spec The Add-widget menu (11 types) and the widget inspector's Type select (10 types) kept their own hand-written lists while ChartTypeSchema accepts 20, every one of which the dashboard draws. widget-types.ts now takes the offered set from ChartTypeSchema.options and keeps only per-type presentation, checked against ChartType with `satisfies`; the Type select derives its options from the same registry. The nine newly offered types get their names in the studio namespace (en + zh), and the widget dataset hint stops naming the removed inline object query. Claude-Session: https://claude.ai/code/session_01JQwxbafngYyQTJq78seG4v Co-authored-by: Claude <noreply@anthropic.com>
… and carries a lit control Claude-Session: https://claude.ai/code/session_01JQwxbafngYyQTJq78seG4v Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:仪表盘「添加组件」菜单和组件「类型」下拉改读同一个注册表,类型集合直接取 spec 的
|
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #26745
Clause-②: no
Metadata-protocol: none
维护者速读
ChartTypeSchema;两处都从 11/10 种变成 spec 的全部 20 种。补了新类型的中英文名称,并改写了指向不存在控件的数据集提示文案。previews/widget-types.ts的WIDGET_TYPE_IDS与WIDGET_TYPE_PRESENTATION(satisfies),然后DashboardWidgetInspector.tsx的WIDGET_TYPES,最后AddWidgetPicker.oneRegistry-26745.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/previews/AddWidgetPicker.oneRegistry-26745.test.tsx,预期 7 个测试全绿。What changes
Base
aa00362f.previews/widget-types.tsis the one registry. The offered set isWIDGET_TYPE_IDS = ChartTypeSchema.options, read from@objectstack/spec/uiat runtime (the module's consumers already load@objectstack/spec/ui), so the file restates no list of type names. What stays per type is presentation (Englishlabel, the two catalogue keys, category, icon) inWIDGET_TYPE_PRESENTATION, checked withsatisfies Record<ChartType, …>: a type the spec adds or retires failstscuntil its row is added or removed.WIDGET_TYPE_METAandWIDGETS_BY_CATEGORYkeep their shapes, soAddWidgetPicker,DashboardDefaultInspectorandDashboardPreviewread the registry unchanged.inspectors/DashboardWidgetInspector.tsx. The Type select's hand-keptWIDGET_TYPESlist (10 entries, noscatter) is replaced by a map overWIDGET_TYPE_IDS, labelled from the registry'sselectLabelKey. The docblock that said "A hand-written SUBSET is fine" now says the opposite.column,scatter(Type select only; the menu already had it),treemap,sankey,combo,gauge,solid-gauge,kpi,bullet,radar.listandcustomstay out: they are objectui-only families with noChartTypeSchemamember, so a widget authored with them cannot publish.studionamespace, en + zh).engine.inspector.widget.type.*for the ten types the Type select did not name;engine.widgetPicker.type.*for the nine the Add menu did not name. No row inmetadata-admin/i18n.tsis added or edited (the dispatch's shared-file rule while feat(ui): the rest of the Studio strings and the metadata preview panes move into the studio i18n namespace (#25922 slice S5) #26942 is open).engine.inspector.widget.datasetHintis reworded in en and zh: it no longer points at "the inline object query above", which the inspector has not drawn since ADR-0021, and describes the dataset, dimension and measure controls it does draw.PageComponentType(34 types) onaa00362f: the palette offers 26, and the 8 it does not offer are exactly the 8 entries ofPALETTE_EXCLUSIONS, each with a recorded reason. Per the dispatch, a block excluded with a recorded reason stays excluded:record:chatter: compatibility alias of the offeredrecord:discussion(maintainer ruling on objectui#5495).app:launcher,global:notifications: shell singletons, not page content.element:record_picker,element:text_input: render, but are field widgets, not page blocks.record:approvals,record:attachments,record:approval_decision: render; recorded as "not yet offered, offering it is a Studio decision". Left for that decision (see the report's open question).@object-ui/i18n;@object-ui/app-shellisprivate: true.Tests
previews/AddWidgetPicker.oneRegistry-26745.test.tsx, seven cases, each read off the rendered control:enumOptions);ChartTypeSchema's vocabulary, in the spec order;code);DashboardRenderer(viaDashboardPreview), with no "not supported yet" placeholder and no red unknown-component panel;heatmap, a family with no renderer;labelthe default title is written from.inspectorStrings.i18n-10804andinspectorStrings.i18n-10748used hand-kept type lists of their own; both now read the registry, so their per-type zh/en checks cover all 20 types.Ablations (both through
scripts/ablation-replace.mjs, restore verified blob == HEAD andgit diff HEADempty):Acceptance notes
metadata-admin/i18n.tsand move with app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922.gaugeinstead ofmetric, and the select listsbarfirst instead ofmetric.New TYPEfrom the Englishlabel, as before; the new types getNew column chart,New treemapand so on.Verification
All local runs are on head
65768a23(baseaa00362f).pnpm exec turbo run build --filter='@object-ui/app-shell^...' --concurrency=2: 63/63 tasks, lock VERDICT command-exit 0.packages/i18n/): 123 files, 1773 passed / 13 skipped, exit 0.pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run type-check: bothDone, exit 0.pnpm check:new-line-citations(run fromui/): 0 new citations, exit 0.dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.node scripts/check-sdui-manifest.mjsis among them (exit 0).Derived gates, exit codes recorded before any pipe
CI families are read from this PR's check-runs; none was re-run locally beyond the derived list.
Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses (CI).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbafngYyQTJq78seG4v
Generated by Claude Code