Repository navigation
fix(console): Shared in Add view only for administrators who can write it, and published at once (#36409) - #36398
Conversation
Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
…once (#36371) Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
… load at collection (#36371) Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
…ps one line beside its six actions (#36371) A personal row's hidden actions keep their width, and Make shared is a sixth icon; at w-72 "My follow-ups" broke onto three lines in the live Console. Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
#36371) The census counts every view write under app-shell views; Unshare's delete surfaces its refusal through toast.error with formatMetadataError and takes the My views copy back, pinned by objectViewViewSharing.test.tsx. Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
…, publish-at-once and the gone-view notice (#36409) #36371 closed as not planned: sharing or unsharing an existing view is not wanted now. Its three measured faults are #36409: Shared offered to an organization administrator the server refuses, a view created Shared left an unpublished draft, and a gone view dropped in silence. This keeps those fixes and removes the row actions, their keys, tests, docs and census row; the dropdown width and the de quote-pair pin go back to main. Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) on head Owed
Read and accepted
A delta ACCEPT on the next head follows if it adds only the pins and the body line. |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Inputs read: card #36409 body and its three comments (claim 7077798297, triage 7078044064, os-dev-report 7078871713); card #36371 body and its comments, rulings 7076659420 and 7077377066 included; PR #36398 body and its one comment (the docs drift bot, no earlier review record); the net diff against main at merge base ff60149; the 74 check-runs on this head. Nothing was built, tested or re-run. The one local command beyond reading was a read-only ① Derived judgments
② Semver levelThe changeset ③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
… draft holds (#36409) saveAndPublishRuntimeMetadata with an app: a writable app package is named on the save, an installed one gets the pair the ensure door returns, an unresolvable one none; publish and the refused-publish discard name no package (ADR-0146 D8); a dashboard ignores the app. createShared over a pending draft says shareNameTaken and publishes, refreshes and opens nothing. Claude-Session: https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ Co-authored-by: Claude <noreply@anthropic.com>
… record from the query, and names what Enter does (objectstack-ai#36387) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUq2j5tRRVo3TVY3wcS1Fdg)_ Part of objectstack-ai#36286 — this PR is step 1 (to-do items 1 to 4); item 5, the "current page" group on the empty palette, is left for a second PR on the same card. repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Clause-②: yes (widening) — eight new published language-pack keys, in all eleven packs: console.commandPalette.create, createAs, previewEmpty, enterOpenRecord, enterCreate, enterSwitchApp, enterApplyTheme, enterOpen Metadata-protocol: none ## 维护者速读 - 在应用里打开搜索面板:搜到记录时右边显示选中记录的要点(标题和对象声明的关键字段),上下键跟着换;输入任意词,列表最后出现「新建『该词』为客户」等行,回车打开已填好名称的新建页;输入「新建」或对象名能找到「新建客户」这类入口;面板底部写明回车会做什么。 - 属于外壳体验对标 Attio 专题,落实维护者「立」的四条改进里的第 1 条(必做的前四项)。 - 出问题时用户最多看到预览或新建入口不对、点进一个空的新建页,不会改动任何数据,可以直接撤回。 - 请看下面的截图,确认右侧详情和新建行的样子是否符合预期。 ## What changes The ⌘K palette inside an app (`CommandPalette`, `ui/packages/app-shell/src/chrome/`) gains the card's items 1 to 4. Which records search finds and their order, the full search page, mobile and the AI entry are untouched. 1. **Record preview on the right** (`PalettePreviewPane.tsx`). While the query finds records, the palette widens (`sm:max-w-3xl`) and draws the selected hit read-only through the existing `RecordPreviewCard` (object label, title by the ADR-0079 ladder, the object's declared `highlightFields` through the record page's highlight strip, field-level security applied). The selection is cmdk's own, now controlled (`value` / `onValueChange`), so ArrowUp/ArrowDown move the preview. When a new set of hits lands, the selection moves to the first hit. The pane is a CSS container query on the palette frame: below a 45rem (720px) frame it is `display: none`, so a narrow window shows the results alone and nothing scrolls sideways. 2. **Create "words" as OBJECT** (`paletteCreate.ts`). Once something is typed, the last group, "Create", offers up to three of the app's navigation objects, the object of the page the palette was opened on first, then the navigation's order. Enter opens `/apps/APP/OBJECT/new?TITLEFIELD=words`, the create page that already reads its query string as the create prefill. An object is offered by the same verdict as the list's New: `resolveAffordance('listNew', …)` (bucket, `userActions.create`, effective API operations, create grant), then the create action's toolbar `visibleWhen` (fails closed) and `disabledWhen` bound with no record, as `objectViewToolbarAffordances` binds them. A "create as" row additionally needs the object's title field (`resolveNameField`) to be a `text`/`textarea` field, not `readonly`, that the member may write on create (`createFormFields`), so the words always land. 3. **New OBJECT** entries, in the same group: one per creatable object whose label ("New Customer", the list button's own `console.objectView.newObject` key), object label, machine name or the words "create new" match the query. An object whose New entry the query found gets no "create as" row (the query names the action, not a record). 4. **Enter hint** (`PaletteEnterHint.tsx`). A footer names what Enter does to the selected entry, read off the first word of its cmdk value: Open record (record, recent), Create, Switch app, Apply theme, or Open (every navigation entry). Eight new published `@object-ui/i18n` keys in all eleven packs, a widening of the language packs (Clause-② yes): `console.commandPalette.create`, `createAs`, `previewEmpty`, `enterOpenRecord`, `enterCreate`, `enterSwitchApp`, `enterApplyTheme`, `enterOpen` (zh-Hant regenerated by `gen:zh-hant`). No props or package exports change. README section of the palette updated. Changeset: `@object-ui/app-shell` + `@object-ui/i18n` patch. ### Screenshots (showcase app, 1440 wide, `zh-CN`; own `--fresh` backend + console dev server on this branch) Hit: "north" on the Accounts list, the first hit previewed, footer 「打开记录 ↵」  Miss: 「张三丰」, the page's object first, footer 「新建 ↵」  「新建」: the New entries (below the navigation pages the word also finds)  Enter on the miss row: the create page with the name filled  A 700px window: results alone, no preview, no sideways scroll (measured `scrollWidth - clientWidth` = 0)  English: [hit](https://github.com/objectstack-ai/objectstack/blob/00a0d416b65d2cf4c2fbb706adbe46270a083051/screens/36286/1-hit.png?raw=true) · [miss](https://github.com/objectstack-ai/objectstack/blob/00a0d416b65d2cf4c2fbb706adbe46270a083051/screens/36286/2-miss.png?raw=true). The images live on the orphan ref `claude/issue-36286-screenshots` (no code), so this PR's diff carries no binary. ## Read first (by risk) 1. `ui/packages/app-shell/src/chrome/CommandPalette.tsx` — the hunk that computes `createTargets` / `newRecordRows` / `createAsRows`, and the render-time block that moves the selection to the first record hit when `hitSignature` changes (state adjusted during render, not in an effect). 2. `ui/packages/app-shell/src/chrome/paletteCreate.ts` — `paletteMayCreate` (the New verdict) and `palettePrefillField`. 3. `ui/packages/app-shell/src/chrome/PalettePreviewPane.tsx` — the 150 ms settle before the by-id read. ## Tests New file `CommandPalette.previewCreate-36286.test.tsx` (15 tests) against the real `CommandPaletteProvider` over the `find` fanout and `findOne`: the preview draws title + declared key fields and Enter opens the record; ArrowDown moves the preview and only the settled records are read (`findOne` called for C1 then C2, nothing else); the container-query classes; no pane and no wide palette without a hit; create-as order (route object first, else navigation order), the invoice the member may not create never offered, Enter lands on `/apps/crm/customer_36286/new?name=Zhang+San`; the empty palette and a cleared query offer no create row; "new" finds one New entry per creatable object and no create-as row; an object's name finds its New entry; the footer per entry kind; `visibleWhen` / `disabledWhen` / title-field gates as units. <details><summary>Local runs at 862d69b</summary> - `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit` and `tsconfig.test.json`), then `vitest run packages/app-shell/src/chrome/` under the lock: `VERDICT command-exit 0`, Test Files 29 passed (29), Tests 173 passed (173). - `vitest run packages/i18n/`: Test Files 106 passed (106), Tests 1978 passed, 13 skipped. (First run had 3 reds, fixed in this branch: zh-Hant not regenerated, and the de quote-pair count pin 121 to 122 for the new `createAs` pair.) - Earlier on this branch: every `CommandPalette.*.test.tsx`, `paletteMatch.test.ts` and `views/record-preview/*.test.tsx` green (part of the 126-file run whose only reds were the two i18n files above). - `ui`: `check:i18n-keys`, `check:i18n-drift` (0 en values changed, 8 keys added), `check:i18n-dead-keys`: exit 0. - eslint `--no-inline-config` on the changed files: 0 errors; `CommandPalette.tsx` carries the same 10 warnings as on `main`. - Derived families run locally (exit 0): `check-adr-0087-registration`, `check-changeset-no-major`, `check-empty-changeset`, `check-closing-keyword-parity`, `check-sdui-manifest`, `check-comment-mask-corpus`, `check:nul-bytes`, `check:published-files`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:undeclared-dep-imports`, `check:adr-anchors`, `check:role-word`, `check:watch-hint-literal`, `check:type-check-coverage`. NOT MEASURED: `check:type-check-debt` (killed at its 300 s local timeout; CI's). - `overlap-check`: VERDICT clean, merges with origin/main and 6 open PRs sharing the locale packs. </details> ## Acceptance notes - **Create opens the create page, not the list's modal.** The palette navigates to `/apps/APP/OBJECT/new` (the route the bare data surface's New and a related list's New open; it reads the query string as prefill). The list page's New opens a modal through `AppContent`'s `handleEdit`, which is outside this claim's file surface; reaching it from the palette would mean a new prop wired there. Worth a decision if the modal is wanted. - **Key fields are the declared `highlightFields` only.** An object that declares none previews its title alone: that is `RecordPreviewCard`'s rule, from the record page's 「没声明就不挑」 ruling, not a new choice. The card's acceptance line (industry, phone, email) holds for an object that declares them. - **At most three "create as" rows** (`CREATE_AS_MAX`), a judgment to keep the list short in apps with many objects; every other creatable object is still one "New OBJECT" entry away by name. - **The Create group comes last**, so Enter on a query that finds anything opens that thing; with the English word "new", records whose status is "new" come first and the New entries sit below them (the 「新建」 screenshot shows the Chinese case). - **Home's palette** reads the host app's navigation, so it offers the same rows there; the Studio palette offers none (no records, no app). - **One extra read per previewed record**: the hit payload carries the row, but `RecordPreviewCard` reads by id with `$expand` on the reference fields it shows, so lookups render as names; holding an arrow key reads nothing until the selection rests 150 ms. - The showcase's account object is labelled "Account (Success Overlay)" by that example; the screenshots show it as served. - The de pack's quote-pair count pin moves 121 to 122; a sibling PR adding another „“ pair will need the same one-line bump on merge. - Item 5 of the card (the "current page" group on the empty palette) is not in this PR. <details><summary>Readings at head a17d2c7 (after the first-push verification above)</summary> - 50b1abd merged origin/main: the PR conflicted on the de quote-pair count pin (main's objectstack-ai#36011 added two pairs); the pin now reads 124. - 50b1abd went red in `Test UI (10/16)` on `dialogViewportGutterCensus-12603`: the palette's 768 px wide cap lacked the shared gutter. a17d2c7 reads `DIALOG_VIEWPORT_GUTTER` and lists the palette in `WIDE_SITES`. - Under the verify lock at a17d2c7: the gutter census plus `packages/app-shell/src/chrome/` gave `Test Files 30 passed (30)`, `Tests 180 passed (180)`; `pnpm --filter @object-ui/app-shell type-check` VERDICT command-exit 0 (after rebuilding `@object-ui/plugin-view`'s stale dist). - At 50b1abd: `packages/i18n/` plus the palette test gave `Test Files 107 passed (107)`, `Tests 1993 passed | 13 skipped`; `ui scripts/` gave `Test Files 172 passed | 2 skipped`, `Tests 5127 passed`. - CI on a17d2c7: 45 success, 13 skipped, 0 failed. - overlap-check at a17d2c7: exit 1 only against objectstack-ai#36398 on `de-quote-pairing-3876.test.ts` (the same count pin; the second lander bumps it by one). - Dev report: comment 7077770300 on objectstack-ai#36286. </details> ## Verification Two minutes: `cd examples/app-showcase && pnpm exec objectstack dev --seed-admin --fresh -p PORT`, then in `ui/apps/console` `DEV_PROXY_TARGET=http://localhost:PORT pnpm exec vite --port VPORT --strictPort`; sign in, open Accounts, press ⌘K, type `north`: Northwind is selected and the right pane shows Lifecycle / Industry / Annual Revenue; type `张三丰` and press Enter: the account create page opens with Account Name filled. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ)_ <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…lters a card does not follow (objectstack-ai#36405) <!-- 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_01QsR2jUeSU9HhKxjcVsyprx Fixes objectstack-ai#36372 Clause-②: yes (widening) — one new exported core function (`dashboardFiltersNotApplied`), two new optional `DashboardRenderer` props (`onWidgetResize`, `onAddFilter`), and new `@object-ui/i18n` keys (`dashboard.inPageEdit.*`, `dashboard.filters.notApplied`, `dashboard.filters.addFilter`); nothing removed or renamed Metadata-protocol: none ## 维护者速读 - 是什么:系统管理员在仪表盘页面上点「编辑」就能直接改:拖动和拉伸卡片、点卡片在右侧改属性、添加和删除卡片、添加和修改顶部筛选、设置每张卡片是否跟随页面筛选。「保存」后所有人立刻看到,不需要发布应用包;「放弃」丢掉全部改动。 - 为什么:以前改仪表盘必须进入工作室,管理员在看数据时发现问题要绕一大圈;现在在哪里看就在哪里改。 - 对已安装的应用:改动写进该应用的定制层(和工作室的「定制」写同一处),升级应用不会覆盖。点「编辑」本身什么都不写,定制层在第一次「保存」时才创建,所以「编辑」后「放弃」不留下任何东西。工作室不让定制的情况(本部署只有平台运营方能定制已安装应用、软件包列表没给出版本),页面也不进入编辑,并说明原因;如果工作室里已有这张仪表盘未发布的草稿,页面会提示先去工作室处理,不会替别人发布。 - 另外:每张卡片都会显示一个小标记,写明它不跟随哪些页面筛选(例如「不跟随『区域』筛选」),标记和卡片实际查到的数据用的是同一条判断,不会对不上。 ## What changes **Edit state on the dashboard page** (`DashboardView` + new `DashboardInPageEditor.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 (from `sm` up: the edit state needs its side panel). Edit opens the dashboard **as stored** — the layered read's `effective` in 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: - the header shows an **Editing** badge, the hint "Saved changes apply to everyone at once", and **Add card**, **Discard**, **Save** (Save is off until something changes); - every card draws dashed and is in the renderer's design mode: drag to move (the existing dnd-kit reorder), click to select, and a new corner handle resizes it by whole grid tracks; - the right panel is Studio's own dashboard panels, unchanged: `DashboardWidgetInspector` for a selected card (its data, the "follow page filters" switches, Remove) and `DashboardDefaultInspector` otherwise (label, cards, filters, layout); - **Add card** appends a card at the end (Studio's id and defaults) and selects it; **Add filter**, drawn at the end of the filter bar, opens the panel's Filters section. **Save** (`saveDashboardInPlace`) is the confirmed-save door of objectstack-ai#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 by `resolveDashboardEditTarget` (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, `ensureDashboardSaveTarget` asks the ensure door for the pair (it creates `<base>.custom` on first use, as Studio's first saved customization does), and the body declares `overrides: { 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's `noVersion`). 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 `_packageId` beside 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 whose `targetWidgets` leaves it out (an explicit string binding wins over `targetWidgets`). The built-in date filter is named as the bar names it ("Date range"), never by its reserved name. The list is the new core `dashboardFiltersNotApplied(widget, defs)`, which asks `resolveBoundField` — the binding `buildWidgetScopedFilter` builds 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), and `onAddFilter()` 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.** `saveAndPublishRuntimeMetadata` itself is unchanged: `saveDashboardInPlace` hands 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 objectstack-ai#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 objectstack-ai#36086 (epic objectstack-ai#36359); no `docs/adr` edit 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` — `dashboardFiltersNotApplied` agrees with `buildWidgetScopedFilter` for 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, a `targetWidgets`-excluded card has it, an opted-out built-in date filter reads "Not filtered by Date range"; each case reads the query's `runtimeFilter` beside the mark. - `ui/packages/plugin-dashboard/src/__tests__/DashboardRenderer.designMode.test.tsx` — the corner handle only with `onWidgetResize` in 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` — `resizedSpan` snapping 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 with `basedOn`; 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 layered `effective`; 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 real `DashboardView` and 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 into `crm.custom` declaring 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 with `callerPackage` (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/console` Vite against it), driven by Playwright as the seeded admin. The writable leg uses a package created over REST (`com.example.livedash`, depending on `com.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 own `showcase_ops_dashboard` (`com.example.showcase`, listed read-only, version 0.1.0). | Acceptance | Reading | |---|---| | Writable: drag, widen, add, delete, Save | Dragged "Priority Mix" to the front, widened "Tasks all time" by its corner (192 → 400 px, `w` 3 → 6), added a Metric card (given its dataset and measure in the panel; Save without them is refused by the server, 422 `widgets.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**: exactly `PUT /api/v1/meta/dashboard/livedash_board?mode=draft&package=com.example.livedash` (200, `state=draft`) then `POST …/livedash_board/publish?package=com.example.livedash` (200). No `/packages/:id/publish-drafts`. | | After a reload the layout holds | The served dashboard reads `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". | | Installed app: Edit then Discard | Writes on Edit: none; package list before and after Edit → change → Discard: `["com.example.showcase"]` (no `.custom` created); the page shows the original titles. | | Installed app: Save lands in `<base>.custom` | Writes on Save: `POST /api/v1/packages/com.example.showcase/ensure-customization`, `PUT …/showcase_ops_dashboard?mode=draft&package=com.example.showcase.custom` with `overrides: { 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)". | | Discard after a change | Covered in the installed leg above: the page is as before and nothing is written. | | Mark on an opted-out time-filter card | "Tasks all time" (`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). | | Its switch turned on and saved | The panel's dateRange "Apply" checkbox on that card, then Save: the body's card has no `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 `f0750e0dd` and 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 objectstack-ai#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. objectstack-ai#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 - At `f0750e0dd`: type check `@object-ui/app-shell` and `@object-ui/plugin-dashboard` green; `packages/plugin-dashboard/src`, the dashboard view / editor / persistence files, `core` dashboard-filters and `AppContent.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-keys` green. `overlap-check`: clean against main and 7 open PRs (objectstack-ai#36398 included). - At `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-examples` prerequisite, `check:test-source-alias` fixed 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](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jUeSU9HhKxjcVsyprx --> --------- Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) delta on head
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T12:57Z): head |
Requested by Steedos · project thread
Fixes #36409
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
#36371 closed as not planned: the rule it asked for already holds (correction 7077377066), and sharing or unsharing an existing view is not wanted now. Building it measured three real faults at
origin/main3faabd2, which #36409 files; this PR fixes those three and nothing else. The 「设为共享」 / 「取消共享」 row actions an earlier head carried are gone (code, keys, tests, docs).viewmetadata written throughPUT /api/v1/meta/view/:name; that door, the publish and the delete refuse any caller withoutmanage_metadata(metaSaveVerdict, ADR-0066 D1), answering403 FORBIDDEN. No server code changes; the refusal is pinned with the shipped permission sets (below).mayShareViews,objectViewViewSharing.ts): an administrator whose session holdsmanage_metadata(useCanAuthorMetadata). Add view used to askisAdminalone, which is true for an organization administrator, who does not hold the capability: they were offered Shared and the save answered403.saveAndPublishRuntimeMetadata, ruling record 7058616478, the maintainer's 「保存即生效」). That helper now saves a new view into the app's package when the caller passes the app, ascreateRuntimeMetadatadoes (objectstack#35624); existing callers pass none and are unchanged. A refused save publishes nothing.not_foundfor is told so once, and the list shows its default view, as it already did silently.useMetaItemRefusalgainsabsentfor that verdict.Two new
@object-ui/i18nkeys underview.switcher(shareNameTaken,viewGone) in every pack (zh-Hant regenerated), soClause-②: yes (widening).content/docs/ui/views.mdxgains a Shared views paragraph. No published skill describes this surface (git grepofskills/for My views / shared view: zero hits), so noSkills-docs:line is owed.Not done here: 「设为共享」 / 「取消共享」 on existing views (not now, per the maintainer), saving into a shared view (#35955 step 2), the Manage views page.
Tests
packages/rest/src/meta-write-door-capability-enumeration.test.ts, new describe#36409: with the systemPermissions the shipped sets grant (securityDefaultPermissionSets), a member (member_default) and an organization administrator (member_default+organization_admin) are refused the view's save, publish and delete403 FORBIDDENwith the protocol never reached; the control,admin_full_access, reaches all three.ui/packages/app-shell/src/views/objectViewViewSharing.test.tsx(new): who is offered Shared (an administrator holdingmanage_metadata; neither half alone); Create shared saves with the first-write pin and publishes, then opens the view; a refused save is said, reported unsaved, and publishes nothing; a name an unpublished draft already holds is said (shareNameTaken) and nothing is published, refreshed or opened.ui/packages/app-shell/src/views/runtime-metadata-persistence.saveAndPublishIntoApp-36409.test.ts(new, a realMetadataClientover the package doors' measured bodies): with an app, a writable app package is named on the save; an installed one gets the pair the ensure door returns; an unlisted one,packageId: nullor no app gets none; the publish and a refused publish's discard name no package (ADR-0146 D8); adashboardcall ignores the app and asks no package door.Readings at head b09dc55 (main ff60149 merged);
65544511adds the two pinsobjectViewViewSharing.test.tsx3/3;@object-ui/i18nwith the switcher, sharing, in-place-create and census tests: 110 files, 2,032 passed; everyObjectView*test withruntime-metadata-persistence, the census, the switcher, the sharing and in-place-create tests: 114 files, 1,021 passed.meta-write-door-capability-enumeration.test.ts: 72 passed.mayShareViewsreduced toreturn isAdmin;turns the organization-administrator test red (1 failed / 2 passed); restored, green.dispatch-gates.mjs --ran): 96 derived, 94 run, 2 NOT MEASURED, 0 unrun. NOT MEASURED (prerequisite exit 3), left to CI:check-plugin-teardown-shape --self-test(shallow-clone fixture) and speccheck:skill-examples(needs client-react declarations).ui vitest run scripts/, speccheck:docsandcheck:dts-closurewere red only until@objectstack/specwas rebuilt with declarations after the main merge, then green.check:dual-build-cjs-loadsstays red on this container's tree alone: 75 findings, each a.d.ts/.d.ctsof a package this PR does not touch (core, the drivers, …) never emitted here; CI's build is its reading.overlap-check.mjs: clean against main and every open PR head.65544511: the new package pins 5/5 and the sharing test 4/4;runtime-metadata-persistence*8 files, 63 passed. Ablations:saveAndPublishRuntimeMetadatareadingctx.appfor every type turns the dashboard pin red; resolving no package turns the four view pins red;publishNewignoring'pending-draft'turns theshareNameTakenpin red; each restored, green. The test-reading gate families (27) re-run at this tree: green but the one NOT MEASURED above.Acceptance notes
isAdminalone, so an organization administrator withoutmanage_metadatais still offered those and refused by the server. This PR narrows only the Shared choice Shared views: an org admin without manage_metadata is offered 「共享」 and refused; a view created Shared stays an unpublished draft #36409 names; console: Manage views, view settings and Create View are offered on isAdmin alone, so an org admin without manage_metadata meets a 403 #36448 carries the rest.403pin.de-quote-pairing-3876.test.ts) is no longer touched: the dropped German strings were the ones with quotes, so feat(console): the ⌘K palette previews the selected record, creates a record from the query, and names what Enter does #36387 owns that pin alone.Screenshots
Taken at
a0dfe1a4in a live Console (ui/apps/consoleVite againstexamples/app-showcaseobjectstack dev --seed-admin), 1400×900 at 2×, two accounts: the dev administratoradmin@objectos.aiand the seeded member personaauditor.demo@example.com, on Projects. That head still carried the dropped row actions; the shots below show only what this PR keeps, which the slimming did not change. The files are kept with the project, named here as they are attached there.a2-admin-addview-shared.png: administrator, Add view with My views / Shared, Shared chosen, the hint under it. Created, it opened at once asshowcase_project.key_projects.m1-member-menu.png,m2-member-addview.png: the member, opening that view by its address, finds it under Shared views straight away (no publish step), and Add view has no My views / Shared choice.m3-member-view-gone.png: the member reloads the address of a view that was removed: 「The view you opened is no longer available, so the list shows its default view.」 over All Projects.Verification
Two-minute check: as a platform administrator, open a list's view dropdown, Add view, choose Shared and create; sign in as a member and open the list: the view is under Shared views at once, and Add view offers no Shared choice.
Generated by Claude Code
🤖 Generated with Claude Code