Repository navigation
feat(console): create a dashboard from the design mode's Add menu item - #36606
Conversation
The picker's Dashboards list starts with New dashboard...: a name, then the dashboard is created empty in the package the menu is saved to, its entry takes the held place, every staged change is saved with it, and the new dashboard opens in its edit state. A refused menu save removes the dashboard again; cancel writes nothing. Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
…e and its landing Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
…-un7cwb # Conflicts: # ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy Contract-review-claim: session_01ADHkmPiTdmLxHXBjakSvJy · head ab2257f · 2026-11-23T02:57Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy Contract reviewServed-tier: Face: declaration only ( ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy 席位核对ACCEPT — PR #36606 at head
|
…-un7cwb # Conflicts: # ui/packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx
…der rule A new dashboard's entry, held between two entries of a level that carries `order`, is saved numbered in that place, with every entry of the level renumbered in its shown place (objectstack#36591's rule, now applied by prepareAppMenuSave to the create-and-save path as well). Claude-Session: https://claude.ai/code/session_01ADHkmPiTdmLxHXBjakSvJy Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy Contract-review-claim: session_01ADHkmPiTdmLxHXBjakSvJy · head 313b6bf · 2026-11-23T07:46Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy Contract reviewServed-tier: Face: declaration only ( ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy 席位核对ACCEPT — delta · PR #36606 at head
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读
席位核对ACCEPT → PR #36606 comment 7094709368 (delta) ·
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45133910959 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Re-queue after triage of the queue red (run 45133910959, job 137556364792). The one failure is Head |
… page header drops Edit app and Open in Studio (objectstack-ai#36485) (objectstack-ai#36621) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi92ncfFpPUpTD8314otX5oaG)_ Fixes objectstack-ai#36485 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:系统管理员在任何应用里点左上角应用名,应用列表下面、和「添加应用」同一组多了「编辑应用」,点了直接进入设计模式;页头右上角不再有「编辑应用」和「在 Studio 中查看 某应用」两个按钮,只剩 AI 助手和帮助。自建应用和安装来的应用一样;侧栏收起时从左边缘滑出的菜单里也能点到;普通成员看不到,手机上没有入口。 - 为什么做:运行界面设计模式专题的一张子卡,按你「立卡」的那条建议,把设计入口集中到应用名菜单,页头只留每页自己的按钮。 - 出错会怎样:最坏是管理员在页头找不到「编辑应用」,要去应用名菜单里点;设计模式本身和保存都没改,撤回本 PR 即恢复原来的按钮。 - 要你做什么:无。 ## What changes - **App-name menu** (`SidebarAppMenu`): a new 「Edit app」 item (`sidebar-app-menu-edit-app`, the `topbar.editApp` key every locale already carries, no new i18n key) under the app list, in one group with 「Add app」 (one rule above the group, none between the two). Choosing it calls the shell's `useDesignMode().enter` for the app on screen: no navigation, no Studio. - **Who sees it — the header button's condition, carried over unchanged, no new judgement**: `useStudioEntryGate` (the gate `useAppStudioEntry` reads) answers non-null, i.e. `useWorkspaceAdminStatus().isAdmin` AND `useCanAuthorMetadata()` (the server-reported `manage_metadata` capability) AND the app's package is one `GET /api/v1/packages` lists (not a kernel package: Setup, Studio, Account get none); a read-only package (`posture: 'view'`) only where the customization door takes the caller (`!postureHasOrgWall(useTenancyPosture()) || user.isPlatformAdmin`), as objectstack-ai#36363 set it. It reads the app's own Studio path (`appStudioDesignPath`); the gate judges the package id only, so the answer is the one the header got on every route. - **While the mode is on** the item is not drawn (same as the header button was). **Where no shell holds the mode** it is not drawn either (the header used to fall back to a Studio link there; nothing in the console renders the sidebar outside `ConsoleLayout`'s provider). - **Collapsed sidebar**: the float from the left edge is the same panel with the same head, so the item is there too (pinned and browser-measured). - **Phone**: the sidebar head with the app menu is drawn from 768 px up only, so no entry, as before. - **Page header** (`ShellPageActions`): `EditAppButton` is deleted: no 「Edit app」 and no 「Open {app} in Studio」 in the group on any route. The group now reads no Studio gate at all (`useAppStudioEntry(false)`, app only, for the help menu's package). `useAppStudioEntry` stays: `AppHeader` (the top bar still drawn below 768 px and on docs pages) reads it. - **Installed apps today**: on `main` an installed (read-only) app already enters the mode (objectstack-ai#36363 landed), so in this PR an installed app's menu item behaves exactly as a self-built one's. Its one exception is the walled-deployment case above: there the item is absent (the header showed the eye into Studio; that eye is gone with the header buttons, so such a caller reaches Studio through the app switcher's row or Studio's landing). - **Onboarding**: there is no step pointing at 「Edit app」: `chrome/OnboardingWalkthrough.tsx` is a stub that renders nothing, and no other tour exists in the console. ## Tests <details><summary>Pins added or rewritten (vitest, root ui/)</summary> - `SidebarAppMenu-36112.test.tsx`, new top-level describe 「Edit app」 in the app menu enters the design mode: placement under the list with one rule before the group; choosing it turns the real `useDesignModeController` on and the item is gone while on; a read-only package's app has it and enters; walled + read-only gets none, walled + writable keeps it; controls: a member, an admin without `manage_metadata`, the Setup app (package not listed), no shell holding the mode. The package list is the stubbed `fetch`; the file-level `beforeEach` now stubs it for every test, since the menu reads the gate for admins. - `ShellPageActions-36111.test.tsx`: the group's order is comments then help; the old 「Edit app」 / eye / design-mode-button describes are replaced by one asserting neither entry (test id and accessible name) for writable and read-only packages, with and without a design-mode shell, walled, and for a member. - `UnifiedSidebar.hiddenCollapse-35062.test.tsx`, new top-level describe: sidebar collapsed at 1024 px, floated by a press on the left edge, the real Radix app menu opened from inside the float offers 「Edit app」, and choosing it turns the mode on. </details> <details><summary>Runs at f7d907a</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/layout/__tests__/` plus `ObjectView.shellPageActions-36111`, `RecordDetailView.topBar-27524`, `PageView.consoleHeader-36111` (lock VERDICT command-exit 0): Test Files 157 passed (157), Tests 1255 passed (1255). Run at 2b4666e plus the test edits; the float pin and typing commit followed, re-run: the two harness files 36/36. - `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit` and `tsconfig.test.json`): VERDICT command-exit 0. - eslint on the five changed source and test files: 0 errors. </details> <details><summary>Ablation (one-shot, not kept)</summary> - Menu item: `node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/layout/SidebarAppMenu.tsx --anchor '{enterDesignMode && EDIT_APP_ITEM_ELEMENT}' --delete -- vitest …` (anchor 1 → 0, blob 367de8d → 71946a69): 5 failed | 31 passed: every positive pin in both harnesses red, every control green; restored blob 367de8d = HEAD. - Header: `ShellPageActions.tsx` swapped for its base-commit text under an EXIT trap: 3 failed | 5 passed (the order pin and both no-entry pins red; the member control and the scope pins green); restored blob 2e64064 = HEAD, `git status` clean. </details> ## Acceptance notes - Browser, own stack (CRM example on its own port, `--fresh`; Console dev server pointed at it), 1440 px. HotCRM is not in this container: the CRM example's `com.example.crm` is a code package served read-only, so it stands in for the installed app; a writable app was made for the self-built case (`POST /api/v1/packages` `com.acme.mine` plus app `my_sales` saved into it). - Admin, read-only CRM app and writable My Sales app: header group children = help only, no 「in Studio」 text anywhere on the leads list, the accounts list and the pipeline dashboard; menu reads `CRM · Setup · (My Sales) · Edit app · Add app`; choosing 「Edit app」 draws the design-mode bar; reopening the menu in the mode shows no 「Edit app」; collapsed sidebar, floated from the edge: item present, choosing it draws the bar. - Member (created by the admin, no CRM permissions): menu reads `CRM`, no 「Edit app」. - 390 px: no app menu trigger and no 「Edit app」 anywhere. - Not measured in the browser: a report route and a custom page route (the CRM example has neither in its menu); the group is the same component on every route and `PageView.consoleHeader-36111` / `ObjectView.shellPageActions-36111` / `RecordDetailView.topBar-27524` stayed green. - Screenshots (before = the two files at the base commit, served by the same dev server), in `/mnt/project-files/objectstack-seat2/`: - header before / after: `36485-before-crm-readonly-header.png`, `36485-before-selfbuilt-writable-header.png` / `36485-after-crm-readonly-header.png`, `36485-after-selfbuilt-writable-header.png` - app menu before / after: `36485-before-crm-readonly-app-menu.png` / `36485-after-crm-readonly-app-menu.png`, `36485-after-selfbuilt-writable-app-menu.png` - in the mode: `36485-after-*-design-mode-on.png`, `36485-after-*-app-menu-in-mode.png`; float: `36485-after-*-float-app-menu.png`, `36485-after-*-float-design-mode-on.png`; member: `36485-after-member-app-menu.png` - The top bar still drawn from 640 to 767 px and on an app's docs pages keeps its Studio pencil / eye (`AppHeader`, outside this card's file surface): it opens Studio, not the mode. Left as is; named in the report for the seat. - `designMode.tsx`'s docblock still says the mode is entered from the page header's 「Edit app」 (`ShellPageActions`); the file is read-only here (open PR objectstack-ai#36606 edits it). `ui/packages/app-shell/README.md`'s "App → Studio reverse bridge" describes the top bar only and does not mention the mode's door; also outside the file surface. Both named in the report. - ADR-0146 D5 says the app bar entry draws as 「Open {app} in Studio」; the page header's copy of it is gone. The sentence goes to the seat's ADR-revision card, not this PR. ## Verification Read first: 1. `ui/packages/app-shell/src/layout/SidebarAppMenu.tsx`, `useEnterDesignMode`: the gate carried over from the header; the risk is a viewer who saw the header button and now sees no menu item, or the reverse. 2. `ui/packages/app-shell/src/layout/ShellPageActions.tsx`, `ShellPageActionsGroup`: the group no longer reads the gate. 3. `UnifiedSidebar.hiddenCollapse-35062.test.tsx`, the new last describe: the float path. Two-minute check: as an admin, open any app page at desktop width, click the app name at the top left: 「Edit app」 sits under the app list above 「Add app」; click it and the blue Design mode bar appears; the page header's top-right has only the AI and help buttons. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… the sidebar draws it (objectstack-ai#36622) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi92ncfFpPUpTD8314otX5oaG)_ Fixes objectstack-ai#36591 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员在运行界面的设计模式里调整菜单顺序(上移、下移、移到分组、在前后加一项、添加菜单项、拖动)并保存后,侧栏现在按设计模式里显示的顺序排列;以前在 AI 搭建、菜单项带排序号的应用里,保存成功却毫无变化,再进设计模式看到的顺序也和侧栏相反。 - 属于「运行界面的设计模式」专题,替用 AI 搭建应用、要在应用里直接调菜单的管理员解决「改了不生效、也不报错」的问题。 - 出错时,带排序号的应用保存菜单后侧栏顺序会和设计模式不一致;只影响菜单顺序,不丢菜单项,可以在设计模式里再调一次保存,或撤回本次合并恢复旧行为。 - 无。 ## What changes The sidebar sorts each level of an app's `navigation` by `order` (`byNavOrder` in `@object-ui/layout`: lower first, an absent `order` as 0, ties in array order). Design mode listed and saved the array as authored, so in an app whose entries carry `order` a move was saved and published and changed nothing on screen. Route taken (the claim's Route, the card's first option): **rewrite `order` on save, never drop it.** - **Display** — design mode seeds its menu with every level put in the sidebar's order (`inShownOrder` in `designModeMenuModel.ts`, which sorts each level through `inMenuOrder`, the app-shell statement of the sidebar's rule; no new comparator). The menu reads the same in and out of the mode. - **Save** — `saveAppMenu` puts the stored menu in that same shown order before the edits are replayed on it (`rebaseMenuEdits`), then rewrites `order` on the result (`withOrderRewritten`): each level in which **any** entry carries `order` has **every** entry numbered `0, 1, …` in the order design mode showed; group entries and each group's children are numbered per level. A level where no entry carries `order` is saved by array order and gains no key (HotCRM-shaped apps are unchanged). - **Why `0..n-1`**: it is the smallest rule that makes `byNavOrder` draw exactly the array order (no ties are possible inside a renumbered level), it covers the mixed level the card names, and it is idempotent: a second save of the same menu writes the same numbers. Dropping `order` was rejected because it deletes authored keys from AI-built apps. - **Why the stored menu is sorted first**: the edits are replayed by place ("after the entry before it"), and the stored array of an `order`-carrying app is not in shown order. Without the sort an entry added at the end of `[X(2), Y(1), Z(0)]` lands after `X` in the array and is numbered between `X` and `Y`. A stored entry the reader was never shown (pruned) keeps its shown place among the rest. - `rebaseMenuEdits` and `order`: the editor never writes `order`, so the served and edited copies of an entry always agree on it and it is never a patch key; the stored value travels with the entry and is then rewritten. Nothing is treated as a conflict and nothing is dropped. Pinned by "a move up is written as `order`; a rename beside it writes its label, and `order` is never read as an edit". ### Why objectstack-ai#36363's tests did not catch it Every fixture in the three objectstack-ai#36363 test files authored its menu **without `order`** (HotCRM-shaped), where array order is the sidebar order. The save pins read the written navigation's **array positions** (`navigation[1].children.map((c) => c.id)`), and nothing drew the saved menu through the sidebar's renderer. Its acceptance line "上移并保存:顺序变了;刷新后还在" was therefore true of every fixture and false of the AI-built app the coordinator saved. The new pins draw what the save wrote through the real `NavigationRenderer` and compare it with what design mode showed, over menus that carry `order`. ## Tests Read first (by risk): 1. `ui/packages/app-shell/src/layout/designModeMenuSave.ts` — the two lines around `rebaseMenuEdits`: the sort before the replay and the rewrite after the payload. 2. `ui/packages/app-shell/src/layout/designModeMenuModel.ts` — `inShownOrder` and `withOrderRewritten`. 3. `ui/packages/app-shell/src/layout/DesignModeMenu.tsx` — the `served` seed. New pins, each a top-level `describe` in the existing shared harness of its subject (no new test files): - `DesignModeMenu-36363.test.tsx` · "the design-mode menu in the sidebar order (objectstack#36591)" — real `DesignModeMenu` + mode save, the sidebar read from a rendered `NavigationRenderer` (no sort written in the test): ordered app reads the same in design mode and in the sidebar; Move up on Contacts then Save → sidebar reads Contacts, Customers, …, and the saved app re-opens design mode in that order; Add an item after + Move to group → the sidebar places both where design mode showed them; CONTROL: an app with no `order` saves a move by array order and gains no `order` key; a mixed level reads as design mode after one save. - `designModeMenuSave-36363.test.ts` · "the save writes the order the editor showed as `order` (objectstack#36591)" — added at the end, move up with a rename beside it, a pruned entry, and the no-`order` control. - `designModeMenuModel-36363.test.ts` · "a level in the sidebar order, and that order written back as `order` (objectstack#36591)". <details><summary>Runs (head f4425f4)</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/layout/` → `Test Files 155 passed (155)`, `Tests 1247 passed (1247)`; lock `VERDICT command-exit 0`. - The three touched files alone → `Test Files 3 passed (3)`, `Tests 75 passed (75)`. - `pnpm --filter @object-ui/app-shell type-check` (both `tsconfig.json` and `tsconfig.test.json`) → lock `VERDICT command-exit 0`, after rebuilding the dependency closure the `origin/main` merge moved (a first run against the pre-merge `dist` reported `RecordDetailView.tsx` TS2322 from main's merged change; gone after the rebuild). </details> <details><summary>Ablation — the order rewrite removed</summary> `node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/layout/designModeMenuSave.ts --anchor 'const nextNav = withOrderRewritten(navPayloadOf(rebased as unknown[]) as Menu);' --replacement 'const nextNav = navPayloadOf(rebased as unknown[]) as Menu; void withOrderRewritten;'` over the three files: - `ok mutation landed: anchor 1 -> 0, blob b319aa8 -> fd40d9929ee0` - `Test Files 2 failed | 1 passed (3)`, `Tests 6 failed | 69 passed (75)` — red: the three `order` save pins, and in the render harness Move up, Add after + Move to group, and the mixed level. The two CONTROL pins (no `order`) and the display pin stay green, as they should. - `ok restored: blob == HEAD (b319aa8) and git diff HEAD is empty`. </details> ## Acceptance notes - **Renumbering rewrites authored values.** Saving a menu whose level carries `order` writes consecutive numbers on every entry of that level (an authored `10, 20, 30` becomes `0, 1, 2`), even when the save only renamed an entry. The order drawn is unchanged; the values are not preserved. - **Another package's entries (`navigationContributions`) keep their own `order`.** They are not in the stored menu, so they are not renumbered. One that carries no `order` keeps its place (it sorts as 0 right after the app's first entry, as design mode now shows it); one that carries its own `order` can sit in a different place relative to the renumbered entries than design mode showed. No live app was found with such a contribution; noted, not filed. - **Two save rules for one key.** Studio's nav canvas (`AppNavCanvas` `moveItem`) writes `order` on the moved entry only; design mode now renumbers the level. Both draw the order their editor showed; they differ in how many keys a save writes. Observation only. - **Browser check: NOT MEASURED**, reason: the worktree has no built runtime or Console (`packages/console/dist` absent), and a full build plus a seeded backend on this shared 4-core box was not taken on for this card; the sidebar half is measured instead by rendering the real `NavigationRenderer` over the written navigation. - **Overlap**: `node scripts/pm/overlap-check.mjs` exits 1 against objectstack-ai#36606 (shares `DesignModeMenu.tsx`, `designModeMenuSave.ts`, conflicts in `DesignModeMenu-36363.test.tsx`); the seat sequenced this card first and objectstack-ai#36606 rebases on it. ## Verification Two minutes: `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx -t "sidebar order"` — expect 5 passed, among them "「Move up」 on Contacts, saved: the sidebar reads Contacts, Customers, …". Local gates: `node scripts/pm/dispatch-gates.mjs --commands` derived 38 commands for this diff; all 38 ran with exit 0 and `--ran` reconciles "38 run, 0 NOT-MEASURED". The `ui/scripts` vitest family was run with `--maxWorkers=2` added (dispatch order). Families CI runs are read from this PR's check-runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
… write Field change values (objectstack-ai#36290 part 1) (objectstack-ai#36641) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NRmimMwnUgR1DbqgHtBWM3)_ Part of objectstack-ai#36290 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员在 Studio 的字段设置和字段设计器里,原来的「记录历史」开关换成「字段修改值」三选一(默认 / 开 / 关),对象设置的「功能开关」里新增「字段修改值」;普通用户无感。 - 属于记录页「字段修改前后值」专题,落实「默认显示、对象或单个字段可关」的裁决:以前 Studio 写的是不再起作用的旧开关,管理员在界面上关不掉前后值。 - 若出错,管理员可能看到「默认」标成开而动态里实际不显示前后值(或相反),或关掉后回不到默认;改动只在设置界面,可直接撤回。 - 要你做的:无。 ## What changes Card objectstack-ai#36290 part ① (PR 3 of 4; ruling 7076513167 point 1: "Old → new is shown by default on every object's record page; an object, or a single field, can turn it off."). PR 1 (objectstack-ai#36399) gave the runtime `fieldHistory` (field) and `enable.fieldHistory` (object); objectstack-ai#36580 gave the metadata form a three-way `field-history` widget. The Studio's own producers still wrote the old key. This PR moves all three named in the release comment. **Field inspector** (`ObjectFieldInspector.tsx`, Advanced section) - The "Track history" box (`value={!!def.trackHistory}`, `patchDef({ trackHistory: v || undefined })`) is gone. Measured reason: since PR 1 a field's `trackHistory: false` reads like absent and `true` does only what `fieldHistory: true` does for a media or JSON type (spec describe of `FieldSchema.trackHistory`), so a second box beside Field change values could only mislead. A stored `trackHistory` is never written or removed here; it is still read, because `resolveFieldHistory` reads it. - New row "Field change values": Default / On / Off over the field's `fieldHistory`. Default removes the key (`unsetDefKey`, not a patch to `undefined`); On / Off write `true` / `false`. - Default names what it resolves to through `resolveFieldHistory` from `@objectstack/spec/data`, the predicate the activity writer uses. Unlike the form widget, this rail holds the object document, so it passes the object: an object with `enable.fieldHistory: false` makes every field's Default read "Default (Off)", and a note under the row says the object's off wins. - The row sits inside the existing `DisplayPatchLock`, so on a read-only base field it is locked with the same reason as its neighbours (`fieldHistory` is not on `BASE_FIELD_DISPLAY_WHITELIST`). **Object settings** (`ObjectSettingsPanel.tsx`, Features card) - New row "Field change values" (`enable.fieldHistory`), next to "Field change history" (`enable.trackHistory`). Ticked unless the stored value is a literal `false`. Unticking writes `false`; ticking again REMOVES the key (unset already means on, so no `true` the author did not need). Sibling `enable` keys are kept, as for every other row. - The Field change history description no longer says "pair with per-field history tracking to pick which field diffs are summarized" (no longer true); it points to Field change values. **Field designer** (`plugin-designer` `FieldDesigner.tsx`, the drawer behind `MetadataFieldsPage` and the `field-designer` SDUI type) - The Advanced section's Track History switch wrote `trackHistory: data.trackHistory === true` on every save, create and edit. It is replaced by Field Change Values with the same three choices. The update path no longer names `trackHistory`: a stored value rides the `...editingField` spread, and a created field carries neither key at Default. - Default's label depends on the type, which the author can change in the same drawer, and a drawer select's options are static. So the choice is drawn as two rows under form-local names, one per resolved default, each shown by a `visibleWhen` built from `resolveFieldHistory` over `DESIGNER_FIELD_TYPES` (with the field's stored `trackHistory`). The save reads the row shown for the saved type, which is the one on screen at the click. Neither form-local name reaches the model. - `DesignerFieldDefinition` (`@object-ui/types`) and its zod mirror gain an optional `fieldHistory`. Both save paths carry it: `MetadataFieldsPage` (`toDesignerField` / `fromDesignerField`) and `MetadataService.toFieldPayload`. Default writes `fieldHistory: undefined`, which overrides the carried value and is dropped on the wire, so a stored key is removed. That is the converters' existing clear-by-absence rule. - It cannot import `fieldHistoryChoice.ts`, because app-shell depends on plugin-designer. What it shares is the rule (`resolveFieldHistory` from `@objectstack/spec/data`). Its own copy of the choice-to-value mapping is two lines. Its strings are the language-pack keys `appDesigner.fieldDesigner.fieldHistory`, `fieldHistoryDefault`, `fieldHistoryOn` and `fieldHistoryOff`, in all 11 locales and the designer's defaults table. They replace `appDesigner.fieldDesigner.trackHistory`. **Shared logic** (`metadata-admin/fieldHistoryChoice.ts`, new): the three choices, the value each writes and their wording, used by both the inspector row and the objectstack-ai#36580 `field-history` widget (refactored onto it; its behaviour and its 10 pins unchanged). The controls stay separate on purpose: the widget is a `WidgetProps` renderer that sees one form row and no object; the inspector row is an `InspectorSelectField` with the inspector's label and lock semantics and the whole object in hand. **Strings** (studio namespace, en + zh; the other locales fall back to en by that namespace's design): `designer.field.fieldHistory`, `designer.field.fieldHistoryObjectOff`, `engine.studio.settings.capFieldHistory`, `engine.studio.settings.capFieldHistoryDesc`; `engine.studio.settings.capTrackHistoryDesc` reworded; `designer.field.trackHistory` removed with its box. Not in this PR: record-page rows (part ②, landed as objectstack-ai#36613), the per-field history card (part ③). ## Tests - New `ObjectFieldInspector.fieldHistory-36290.test.tsx` (7): Default (On) for a one-line type; Default (Off) for image / json / password and Default (On) once `trackHistory: true`; Off writes `false`, On writes `true`; Default after Off removes the key; no Track history box, no `trackHistory` written, a stored one kept; the object's off makes Default (Off) and shows the note; control: no note otherwise. - New describe in `ObjectSettingsPanel.test.tsx` (4): checked for unset and `true`, unchecked only for `false`; untick writes `false` with siblings kept; re-tick removes the key with siblings kept; labelled by its own title. - New `FieldDesigner.fieldHistory-36290.test.tsx` (9), on the real `FieldDesigner` with a drawer double that captures its schema and calls its own `onSuccess`. The cases: two rows and no Track History row, with the labels; for every designer type exactly one row's `visibleWhen` evaluates true (through `evalFieldPredicate`, the form's own evaluator), and it is the one `resolveFieldHistory` names; a stored `trackHistory: true` moves a media type to the Default (On) row; an untouched edit writes neither key; Off writes `false`, On on a media type writes `true`; a stored `false` opens as Off and Default removes it; a stored `trackHistory` is kept; a type changed in the drawer saves what is on screen; a created field at Default carries neither key. - New `MetadataFieldsPage.fieldHistory-36290.test.tsx` (4), on PUT bytes through the real page and a real `MetadataClient`. A stored `fieldHistory: false` survives and no `trackHistory` is written; a stored `trackHistory: true` survives and gains no `fieldHistory`; a field with neither key gains neither; every PUT field parses through `FieldSchema`. - Extended: `MetadataService.fieldKeyCarryOver.test.ts` adds `fieldHistory` to its populated entry and its clearable keys; `designer-zod-arms-10859.test.ts` adds `fieldHistory` to the fully populated `field-designer` document. - Forced test changes: `ObjectFieldInspector.displayPatchReason-28986.test.tsx` names the Field change values combobox instead of the removed Track history checkbox among the locked controls; `ObjectSettingsPanel.businessWording-36512.test.tsx` lists `enable.fieldHistory` among the keys the tab writes. `ObjectFieldInspector.externalIdNotOffered-26674.test.tsx` and `ObjectFieldInspector.retiredIndexed.test.tsx` listed Track history among the Advanced siblings that still render; they name Field change values, and (being edited) now pay the formula and lint loads at module top, as `check:test-source-alias` requires. `FieldDesigner.externalIdNotOffered-26674.test.tsx` and `MetadataFieldsPage.externalIdRoundTrip-26674.test.tsx` used the Track History row as their positive control; they now use the Field Change Values row. ## Acceptance notes - The field designer's Default label follows the drawer's type and the object is not in hand, so an object with `enable.fieldHistory: false` is not reflected there, the same accepted bound as objectstack-ai#36580's widget. Neither `FieldDesigner` nor `MetadataFieldsPage` is mounted by the Console today; both are published exports, and `field-designer` is a registered SDUI type. - A stored field `trackHistory: true` on a media or JSON type makes Default read "Default (On)"; such a field can still be turned off with Off, but not returned to the type's off-by-default without editing the key in the form. That is the resolver's answer, not a UI choice. - `ui/AGENTS.md` objectstack-ai#2 (package README and `content/docs/frontend/` page) not edited: outside this part's file surface. - Screenshots NOT MEASURED (no Console build or backend run here). ## Verification Read first, by risk: 1. `ui/packages/plugin-designer/src/FieldDesigner.tsx`: the `fieldHistoryRows` memo (two rows, `visibleWhen` built from `resolveFieldHistory`) and `fieldHistoryFromForm`, which picks the row for the SAVED type on both save paths. 2. `ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx`: `patchEnable` with `unsetWhenOn` (re-ticking removes `enable.fieldHistory`, keeps siblings). 3. `ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx`: the Field change values row and the object-off note inside `DisplayPatchLock`. Two-minute check: open Studio, an object, Settings, Features: "Field change values" is ticked. Untick, save, and reopen the object JSON: it shows `enable.fieldHistory: false`. Tick again: the key is gone. Then open a field's Advanced section: "Field change values" reads "Default (Off)" with the note under it. <details><summary>Runs (local, head 3b5b130 after merging origin/main 9e2a4ac)</summary> - Builds under the verify lock: the `@objectstack/{spec,formula,lint,client,sdui-parser}` closure, and `@object-ui/app-shell^...` again after the merge (VERDICT command-exit 0 each). - `type-check` (tsc plus `tsconfig.test.json`) of `@object-ui/app-shell`, `@object-ui/i18n`, `@object-ui/types` and `@object-ui/plugin-designer`: all four Done, exit 0 (after the merge; plugin-designer again at 3b5b130). - Post-merge union at ffa608d: `vitest run packages/app-shell/src/views/metadata-admin/inspectors/ packages/app-shell/src/views/studio-design/ObjectSettingsPanel packages/app-shell/src/views/metadata-admin/FieldHistoryWidget-36482.test.tsx packages/app-shell/src/views/metadata-admin/SchemaForm packages/plugin-designer/ packages/types/ packages/app-shell/src/services/ packages/i18n/ packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx` gave Test Files 851 passed (851) and Tests 16838 passed, 14 skipped. 3b5b130 changes only the designer pin's types; that file re-run: 9/9. - Pre-merge union at 3fa510b (`metadata-admin/`, `studio-design/`, `i18n/`) gave Test Files 1232 passed and 2 failed (1234). The 2 were sibling pins still naming Track history, fixed in 58cef60. - Ablations, each through `scripts/ablation-replace.mjs` (anchor 1 to 0), restored with blob equal to HEAD and `git diff HEAD` empty: - The inspector writes `trackHistory` again: 2 of 7 new inspector pins red. - The settings switch writes `true` instead of removing the key: 1 of 14 red. - The designer's update path writes `trackHistory: data.trackHistory === true` in place of `fieldHistory`: 7 of 13 red across the two new designer files. - `dispatch-gates --commands` at 3b5b130 derived 42 families; all 42 ran locally with exit 0; `--ran` reconciliation gives "42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN". - `overlap-check` at 3b5b130: VERDICT clean exit 0 against origin/main d7411fa (three commits past the merged 9e2a4ac; `git merge-tree` is also clean) and objectstack-ai#36634, objectstack-ai#36629, objectstack-ai#36606, objectstack-ai#36587, objectstack-ai#36525. - ui extras: `check:new-line-citations` 0, `check:i18n-keys` 0, `check:i18n-drift` 0, `check:i18n-dead-keys` 0. eslint on the changed source and test files: 0 errors, and no warnings on added lines. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht --------- Co-authored-by: Claude <noreply@anthropic.com>
… of the object (objectstack-ai#36651) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ82MfFjFxvJRAyoku6XCvWt4)_ Fixes objectstack-ai#36648 Fixes objectstack-ai#36653 ## What changes - `StudioDesignSurface.tsx`, the Data pillar's object load: a re-read on the live-metadata pulse alone (`refreshOnly`) no longer clears the dirty flag, the kept CEL verdicts and the served verdict as its effect starts. It drops them when it installs, after the existing in-flight check (`refreshOnly && objBuffersHeldRef.current` ⇒ keep the buffer). A full load (another object, a publish, a reload) resets at the start as before. - New `DataPillar.pulseAfterSave-36648.test.tsx` (2 cases): types into the window deterministically (the hook wrapped to report its release; the keystroke runs in the microtask after it) and pins that the edit stays, that a valid one is sent by the next Save, and that an unparsable one is held. Both cases fail on `main` (`expected '' to be …`: the edit is gone) and pass here. - `DataPillar.panelGate.test.tsx` and `panelHold-27629` are untouched: nothing skipped, retried, narrowed or slowed. ## Why — root cause (product, pre-existing; not objectstack-ai#36636) The red in run 45133910959 is the **second** Save of the first case (`panelGate.test.tsx:166`): `findByTestId('studio-save')` ran its full 4 s and the button never came back after the case typed `record.status ==`. The button is drawn only while the page holds an edit, so the edit was gone. A Save's publish sends the live-metadata pulse. The pillar holds it while the buffer has work (`useMetadataRefreshNonce(objBuffersHeld)`) and releases it in an effect the moment the Save ends; the next render's load effect re-reads the object. That effect called `setDirty(false)` (and cleared the verdicts) **as it started**, before the in-flight check. A keystroke landing between the release and that effect therefore lost its dirty flag; the read, finding nothing held, installed the server's body over it; the edit and the Save button went with it. The window is one scheduler gap, which a loaded merge-queue runner can open between the case's Save and its next keystroke. For an author it is a keystroke right after pressing Save that silently disappears. Not objectstack-ai#36636: `StudioDesignSurface.tsx` and `useMetadataRefreshNonce.ts` are byte-identical between objectstack-ai#36636's parent `99ece3c4` and `main`; the window predates it. objectstack-ai#36636 changed only when Save reads `held`, before any write. ## Verification Loaded box: 4-core container, 4 busy-loop CPU stressors, `vitest run --maxWorkers=2`, 20 consecutive runs. | tree | files | runs | red | |:--|:--|:--|:--| | objectstack-ai#36636's parent `99ece3c4` | panelGate | 20 | 2: both `expected "vi.fn()" to not be called` (:167, :175), the objectstack-ai#36619 verdict race objectstack-ai#36636 fixed | | `main` `e9fa6b5d` | panelGate | 20 | 0 (the :166 timeout did not recur in 20; the deterministic case above reproduces it) | | this head `6e21473c` | panelGate + panelHold-27629 + pulseAfterSave-36648 | 20 | 0: 20 of 20 green in a row, all 10 cases each run | Also green locally: every studio-design test file that saves through the top bar, reads the pulse, or is a `DataPillar.*` suite (50 files, 259 tests). ## Also: the unit-project red that blocked this PR (objectstack-ai#36653) `Test UI (7/16)` went red on `romanizeHan.test.ts:24` (`expected ' weixiu zhongxin ' to be '维修中心'`), a file the fix above does not touch. Cause: test order, not product. The `unit` project runs files with `isolate: false`; `layout/__tests__/designModeMenuCreate-36364.test.ts` (landed 08:11Z with objectstack-ai#36606) calls `loadHanRomanizer()` in its `beforeAll`, so when it ran earlier in the same worker the shared `romanizeHan` module was already loaded and the "before the dictionary has loaded" cases read romanized text. - Reproduction: `vitest run --project unit --maxWorkers=1 designModeMenuCreate-36364.test.ts romanizeHan.test.ts` fails at `:24` with CI's exact message on `main` `3cf6a44b`. - Fix (separate commit, test only, no product code, no changeset): the before-load describe reads its own instance (`vi.resetModules()` + dynamic `import('./romanizeHan')`) and still pins "unchanged and pending until loaded"; a new case pins that the same instance stops being pending once it loads. Nothing skipped, retried or narrowed. - Counts: neighbour first, `--maxWorkers=1`, 4 busy-loop CPU stressors on a 4-core box, 20 consecutive runs: 20 of 20 green (red before). Alone: green. Clause-②: no Metadata-protocol: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbXCSJnUMMhWxyBmuqA <!-- signed: repo:objectstack#1 · os-warren · session_01JQwxbXCSJnUMMhWxyBmuqA --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Part of #36364
Clause-②: yes (widening) — new
@object-ui/i18nkeys (designMode.menu.*for the new picker row and name step,dashboard.noCards.*), in all 11 locales; no spec, schema or public export changeMetadata-protocol: none
repo:objectstack#2 · os-steve · session_01ADHkmPiTdmLxHXBjakSvJy
维护者速读
What changes
DesignModeMenu.tsx). It asks for a name only. 「Cancel」 (or closing the dialog) writes nothing and drops the held place.designModeMenuCreate.ts): every check of the menu save first (prepareAppMenuSave, split out ofsaveAppMenuunchanged in behaviour); the dashboard created empty ({ name, label, widgets: [] }) and published in the menu's own package (the app's package when listed writable, else its.custompair via the ensure door; ADR-0146 D2, Console: right after Add new view, the draft preview bar may read "no unpublished changes" while the new view's package-less draft is pending (measure first) #35624 ruling C) through the existing confirmed-save doorsaveDashboardInPlace; then the menu written and published with the new entry in the held place and every other staged menu edit (writeAppMenu). Where the menu cannot be saved, nothing is created: no package-less fallback.?package=, measured on a live server:Deleted dashboard ... it no longer exists). If that removal is refused too, the error says the dashboard was left.saveWith(key, change)(designMode.tsx): commit everything staged with one change in its key's place, never staging it on its own, so a failed create leaves no half-written entry staged for a later Save.GET /meta/dashboard/:name) so a create never publishes over an existing dashboard.designModeArrival.ts);DashboardView.tsxopens its 仪表盘在页面上编辑:管理员点「编辑」后拖动换位置、调大小、加卡片、改卡片;写明每张卡片跟不跟顶部筛选变;保存即生效 #36372 edit state on that landing once the Edit button is offered, and clears it.dataset+values, and the server's draft save refuses it too (INVALID_METADATA, measured), so a name-only report cannot be created. The seat's premise correction on the card (comment 7090058961) settles it: 「New report…」 opens the report builder (报表搭建页:右边五项(报表类型、数据来源、指标、分组、图表),选完数据来源立刻出图,缺什么就在图的位置提示 #36374) in a create mode and writes the report and its menu entry once a dataset and a measure are picked; that half follows after 报表搭建页:右边五项(报表类型、数据来源、指标、分组、图表),选完数据来源立刻出图,缺什么就在图的位置提示 #36374 merges.Branch name: this card thread's container pushes only to
claude/project-thread-un7cwb, so theclaude/issue-36364-*spelling the Duplicate Fix Guard looks for is not available; the card is #36364 (claim comment 7088329990).Overlap: touches
DashboardView.tsx, which draft PR #36461 also touches;overlap-checkreads both merging cleanly. This PR lands after #36461 per the claim.Tests
Unit and component tests (head 313b6bf)
Run from the repo root under
os-verify-lock; vitest rootui/.313b6bf8mergesorigin/main, bringing fix(app-shell): rename designModeMenu.ts so no layout file differs from DesignModeMenu.tsx only in case #36604 (thedesignModeMenu.tsrename todesignModeMenuModel.ts), fix(app-shell): a menu reordered in design mode is saved in the order the sidebar draws it #36622 (设计模式里「上移 / 下移」保存后应用里的菜单顺序不变:只调了数组先后,没改菜单项自带的排序号,而侧栏按排序号排 #36591's menuorderrule) and feat(plugin-dashboard): a drill opens a centred dialog over the standard list, and a report's chart marks drill #36461. The one conflict, inDesignModeMenu-36363.test.tsx, was resolved by keeping both sides: this card'sservermock, its reset and its describe, next to 设计模式里「上移 / 下移」保存后应用里的菜单顺序不变:只调了数组先后,没改菜单项自带的排序号,而侧栏按排序号排 #36591'sservedNavand its describe. Two imports were moved to the renamed module (designModeMenuCreate.tsand its test); no file names the old module any more. 设计模式里「上移 / 下移」保存后应用里的菜单顺序不变:只调了数组先后,没改菜单项自带的排序号,而侧栏按排序号排 #36591'sinShownOrder/withOrderRewrittenauto-merged intoprepareAppMenuSave, so the create path applies the same rule. It is pinned by a new test: the new entry, held between two entries of anorder-carrying level, is saved as[customer 0, nav_item_1 1, contact 2, opportunity 3].313b6bf8, after rebuilding the app-shell dependency closure (VERDICT command-exit 0):pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/layout/ packages/i18n/plus the 9packages/app-shell/src/views/DashboardView*.test.tsxfiles givesTest Files 271 passed (271),Tests 3301 passed | 13 skipped (3314),VERDICT command-exit 0. This covers the 4 card files and every layout/i18n/DashboardView test the merge touched.313b6bf8:designModeMenuCreate-36364.test.tsalone givesTests 14 passed (14).313b6bf8:pnpm --dir ui --filter @object-ui/app-shell --filter @object-ui/i18n run type-check(bothtsc --noEmitandtsconfig.test.json) givesVERDICT command-exit 0, 0error TS.ab2257f4: the i18n run plus the 4 card files gave 110 files and 2050 tests passing. At0647077c, a narrowed app-shell + i18n run found 3 failures caused by this change: zh-Hant was not regenerated, and the de quote count was 125 against 126. Both were fixed. The full app-shell suite is left to CI'sTestshards.designModeMenuCreate-36364.test.ts: 14 tests (13, plus theorderpin).DesignModeMenu-36363.test.tsx: 4 tests (the create row, Cancel writes nothing, the create-and-land flow, a refused menu).designMode-36362.test.tsx: 3 tests forsaveWith.DashboardView.inPageEdit-36372.test.tsx: 3 landing tests and 2 empty-state tests.Ablations (one-shot, not kept)
ablation-replace, anchor 1 to 0, restored blob equals HEAD): 3 tests red (a refused menu removes the dashboard it was made for…,…cannot be removed says the dashboard was left,a refused menu removes the new dashboard; the mode, the held place and the other staged edits stay).designModeMenuCreate-36364.test.ts, every "nothing is created" case among them. A first attempt of this leg was refused by the tool (the replacement contained its own anchor) and ran no tests; the second attempt is the reading above.Acceptance notes
designModeMenuCreate-36364.test.ts.Verification
Screenshots (live CRM example on a
--freshbackend, console dev server, zh-CN, deviceScaleFactor 2) are stored with the seat (objectstack-seat2/36364-shots/): design mode; picker 「仪表盘」 with 「新建仪表盘…」 first; the name step; the new 「回款分析」 in its edit state, in the held place under 数据分析; Cancel leaving nothing; the new dashboard in view mode (「还没有卡片」); Studio 「界面」 listing the same 回款分析 in the app's navigation. After the run: the dashboard is the only item ofcom.example.crm.custom, the app's stored menu holdsnav_item_1: hui_kuan_fenxiundergroup_analytics, no draft is pending, and the cancelled name has no item (404).Read first:
ui/packages/app-shell/src/layout/designModeMenuCreate.ts(the order and the removal),designMode.tsx(saveWith's drop rule after a commit),DashboardView.tsx(the landing effect).Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/designModeMenuCreate-36364.test.tsshows 14 passing.Derived gates (head ab2257f)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 41 commands from the tree at commit ab2257f. Each was run with stdin from /dev/null, and its exit code was captured before any pipe. The two heavy commands ran underos-verify-lock:pnpm --dir ui exec vitest run scripts/andpnpm check:type-check-debt.--ranreads:Run reconciliation — 41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN.objectstack-seat2/36364-gates-ran.txt).overlap-checkgaveVERDICT clean exit 0against origin/main and the open PR heads.313b6bf8,dispatch-gates --commandsderives the same 41 commands as atab2257f4. The merge brought no new gate family for the touched paths, so the run above was not repeated. At push,overlap-checkagainst origin/main is clean; it conflicts with open PR feat: an object's action layout per scope, pinned and more, set from the design mode (#36366) #36629 on the serial de quote-count pin, and whichever lands second rebumps it.Testshards,Test Core) are left to this PR's check-runs; none was rerun locally.Generated by Claude Code
🤖 Generated with Claude Code