Skip to content

feat(console): Manage views restores the factory version of a customized package view - #36342

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36011-restore-factory-view
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36011-restore-factory-view

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #36011

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 管理员在列表页「管理视图」里,能看到哪些随应用安装的视图被改过(小标记「已定制」),并可一键「恢复出厂版本」;恢复后所有人看到的都是应用自带的视图。
  • 属于「视图管理」体验改进:此前改过置顶、默认或名称后,想回到原样只能去 Studio 找定制项。
  • 恢复前有一次确认,说明所有使用者都会看到出厂版本;服务器拒绝时会提示原因,定制保持不变。恢复不可撤回,但可再次置顶或重命名生成新的定制。
  • 无。

What changes

On a view a read-only package ships, a pin, a rename or a set-default writes the whole view into the package's customization pair (PACKAGE.custom, ruling record 7058654416 keeps those three). Manage views now:

  • marks such a row "customized" (served with the ADR-0146 D2 declaration overrides naming the package it is served under);
  • offers "Restore factory version" in that row's menu; one confirm says every user of the view sees the factory version again; on confirm the override is removed and the views are read again, showing the package's own view;
  • offers no restore, and no mark, on a view without a customization; Delete stays hidden and rename, pin, set default and "View config" stay as the ruling has them.

Pieces:

  • @object-ui/data-objectstack: ObjectStackAdapter.restoreFactoryView(objectName, viewName) reads the served view, refuses (sending nothing) when it is no override of its package, takes the pair from the ensure door for that package (the same home updateView writes into), and deletes the view's draft then its row there: the existing door DELETE /meta/view/NAME?package=PAIR, the one Studio's "Restore package original" uses. A pair that held no row throws. listViews() now carries a record's overrides onto the flattened row.
  • @object-ui/plugin-view: ViewTabItem.customized, ManageViewsDialogProps.onRestoreFactory, the mark and the menu entry.
  • @object-ui/app-shell: the customized verdict in the title switcher's Manage views items, and handleRestoreFactoryView (confirm, restore, re-read, toast; a refusal is said with the door's message).
  • @object-ui/i18n: 8 keys in every locale pack (zh-Hant regenerated by gen:zh-hant); the de quote-pairing pin counts the two new pairs.

No server, protocol or packages/spec change.

Server door, measured (scratch test, not committed)

Real engine, SQL store, protocol, HttpDispatcher reads and RestServer delete, both topologies, at 446de0e / f35f7f3:

  • After a pin (PUT /meta/view/NAME?package=APP.custom with the declaration): GET /meta/view?object=OBJ serves the row with _packageId = the base and overrides: { package: BASE, basedOn }, in the canonical config shape (hence the listViews change).
  • DELETE ?package=APP.custom&state=draft 200 reset:false; DELETE ?package=APP.custom 200 reset:true; the list then serves the base's view with no overrides.
  • Without manage_metadata: 403 FORBIDDEN ("Resetting a metadata item requires the manage_metadata capability"), the same gate as the pin's write; Manage views is the admin's, as for pin.
  • After the last override is removed the pair stays: the ensure door answers it again with created: false, so it keeps blocking uninstall (ADR-0146 D3). This PR adds no package deletion.

Tests

New files: ManageViewsDialog.restoreFactory-36011.test.tsx (plugin-view), restoreFactoryView-36011.test.ts (data-objectstack), ObjectView.restoreFactoryView-36011.test.tsx (app-shell: pin then restore under the real English I18nProvider, the confirm text, a cancelled confirm, a refused restore).

Readings
  • At f35f7f3 (pre-merge): 72 test files / 799 tests passed (plugin-view whole package, the three new files, updateView.draft, deleteView.homes, the 35974 and 11583 ObjectView files); i18n package 105 files / 1962 passed.
  • At 767c872 (after merging main): i18n package tests exit 0; the targeted UI run was in progress at hand-over: NOT MEASURED on this head.
  • type-check exit 0: plugin-view, data-objectstack, i18n, app-shell (app-shell at 446de0e, before the i18n commit; not re-run after the merge).
  • Ablations (each restored, git diff HEAD empty after): restore entry dropped, customized verdict forced false, overrides copy dropped from listViews, the nothing-removed guard and the not-an-override guard disabled: each turned its pins red.
  • Derived gate families (dispatch-gates --commands, 767c872): the local run was in progress at hand-over; every command read so far exited 0.

Acceptance notes

  • Hand-over: work stopped on the maintainer's hand-over call. Unverified on the final head: the targeted UI run after the merge, the app-shell type-check after the merge, and the rest of the derived gate list. CI covers all three.
  • The restore removes the pair's draft of the view too, as Studio's restore does.
  • Tooling observation, not filed: os-verify-lock.sh lost a waiter's slot twice when the budget ran out while that waiter was at the head of the queue; the next call with the same slot name started at the back.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head (area f7-list, 2026-11-22T07:33Z): 767c872b6600b0cb55508b8207e46a21bb1d073f — CI on it: every check-run success or skipped. No further commits planned; L1 requested from L1-d via seat repo:objectstack#7.
Owed besides L1: the Clause-②: yes (widening) declaration review (TIER_DEFAULT, the seat's). app-shell type-check: CI's Type Check UI is success on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 767c872 · 2026-11-22T07:36Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT · head 767c872b6600b0cb55508b8207e46a21bb1d073f · 2026-11-22T07:41Z

维护者速读

  • 用户能看到什么变化:列表页「管理视图」里,被改过的随应用安装视图带「已定制」小标记,菜单多一项「恢复出厂版本」,确认一次后所有人重新看到应用自带的视图。
  • 为什么做:卡 Manage views: after pinning, renaming or re-defaulting a factory view of a read-only package, the admin can restore the factory version from the list page #36011。此前置顶、改名或设默认后,想回到原样只能去 Studio 找定制项。
  • 出错会怎样:只删该视图在 .custom 定制包里的覆盖(先草稿后正式行),出厂包不动、定制包本身保留;服务器拒绝时提示原因,定制原样保留。可整体撤回。
  • 要你做什么:无。
  • 席位意见:ACCEPT。卡上两条验收都有用例钉住;L2(席位,TIER_DEFAULT,Clause-② 扩展)PASS 在案后由区落地。

席位核对

  • 形态:l1-face --pr 36342 CLEAN(13 项无标记);draft、base main、Fixes #36011,两条验收(置顶后恢复则覆盖消失、列表回到包自带视图;无定制的视图不提供恢复)都交付,Fixes 正确;22 个文件 +837 −5;check-governed-merges NOT governed,842 行 ≤ 3000。
  • 范围:diff 只在认领文件面内(app-shell 视图 CRUD/标题切换器、data-objectstack 适配器、plugin-view 管理视图、i18n 11 个包与 de 引号配对计数);无 server、protocol、packages/spec 改动。服务器端门的读数用的是未入仓的临时测试(探针,不是代码生成),PR 正文载读数,合规。
  • changeset 逐句核:restoreFactoryView 先删草稿再删行、走 DELETE /meta/view/NAME?package=PAIR、非覆盖时什么都不发、定制包保留、listViews() 带出 overrides,均与 ui/packages/data-objectstack/src/index.ts diff 相符;「拒绝时用服务器原话」对应 handleRestoreFactoryView 的 formatMetadataError。四个已发布/触及包(app-shell、plugin-view、data-objectstack、i18n)都在 changeset 头。
  • 抽查:customized 只在 refusingPackages 含该包且 overrides.package === _packageId 时为真(objectViewTitleSwitcher.tsx);readonly 行不显示标记和恢复(ManageViewsDialog.tsx)。ensureCustomization 只在覆盖声明核过之后才调用,不会给未定制的包新建定制包。新增 8 个键在 ar/de/ja/ko/ru/zh 中均为译文,无与 en 相同的值。
  • 门禁 check-runs @ 767c872b:45 success · 13 expected skip · 0 failed · 0 pending;Lint & Repo Gates、TypeScript Type Check 均 success。dev 本地读数在 f35f7f31/446de0ec,合并 main 之后未在本 head 重跑(正文如实写 NOT MEASURED),以本 head 的 CI 为准。
  • 接受的偏差(nit,不改本 head):① 只有草稿、没有正式行的覆盖,恢复时会删掉草稿后再报「定制包里没有它,什么都没删」,这句话不对;updateView 正常写正式行,列表上走不到这条路。② 确认文案说「在此处修改的名称、固定和默认设置将被移除」;若覆盖是在 Studio 里改过列或筛选,它们也会一起被移除,文案没提。
  • 范围外去向:无。
  • 落地条款:非受管。席位的 TIER_DEFAULT L2 PASS 在案、无未闭 must-fix/should-fix ⇒ 由区在 10 分钟内 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 767c872b6600b0cb55508b8207e46a21bb1d073f
Local-runs: none

Face: declaration (Clause-②: yes (widening) on the PR body and the changeset; no packages/spec path, no governed path in the file list). Inputs read: card #36011 body and all five comments (triage 7058829659, seat 4 claim 7073580743, os-dev-report 7075365451, handover 7075571521, seat 7 claim 7075950199), PR #36342 body, its 22-file list, the net diff against the merge base 99fbaa6, and the 58 check-runs on the head.

① Derived judgments

Every public-surface change the diff implies, against what the PR body and changeset name:

  • @object-ui/data-objectstack, ObjectStackAdapter.restoreFactoryView(objectName, viewName): Promise of DeleteViewResult — new public method on an exported class. Widening. Named right (body and changeset). It reuses the exported DeleteViewResult / ViewHomeDeleteOutcome types unchanged, and the existing transports only: client.meta.getItem, client.packages.ensureCustomization (the same call viewCustomizationHome makes for updateView), and MetadataClient.reset with state: 'draft' and packageId, which on main already sends ?state=draft and ?package= to the existing DELETE /meta/view/NAME door. No new wire door, no request shape the client did not already send.
  • @object-ui/data-objectstack, listViews() flattened config row now carries the record's overrides when present. The return is typed Promise of any[], so no declaration changes; it is an additive runtime key, copied only when the record carries it (a row without one is unchanged, pinned by the new test). Widening. Named right (changeset: "listViews() now carries a record's overrides declaration onto the flattened row"). The bare-spec arm already returned spec whole, so it already carried the key.
  • @object-ui/plugin-view, ViewTabItem.customized?: boolean — new optional member of an exported type (index.tsx exports ViewTabItem). Widening. Named right.
  • @object-ui/plugin-view, ManageViewsDialogProps.onRestoreFactory?, a callback taking the view id — new optional prop of an exported props type. Widening. Named right. RowProps is module-private. Absent prop or absent flag behaves exactly as before (no entry, no mark); readonly still wins. hasEntryAboveDelete only gains an OR term, so no existing entry or separator disappears.
  • @object-ui/i18n — 8 new keys in each of the 11 locale packs (view.customizedBadge, view.customizedTitle, view.restoreFactory, console.objectView.restoreFactory, restoreFactoryTitle, restoreFactoryConfirm, restoreFactoryDone, objectViewActions.restoreFactoryFailed); the exported TranslationKeys = typeof en widens with them. Widening. Named right in substance ("the mark, the menu entry, the confirm, its result and the failure title, in every locale pack"). The de quote-pairing pin moves 121 to 123 for the two new interpolated spans, consistent with the two new de values.
  • @object-ui/app-shell — useObjectViewViewCrud gains handleRestoreFactoryView and useObjectViewTitleSwitcher gains the customized verdict; neither hook is exported from src/index.ts (only ObjectView and siblings are), so no published declaration moves. Behaviour-only change, correctly carried by a changeset entry without a surface line.
  • Nothing narrowed: no export removed or renamed, no member made required, no accepted value refused; the title switcher still returns definitionReadonly: true on every refusing-package row and adds customized only when overrides.package equals that row's package. @object-ui/types (DataSource) is untouched; the host feature-detects the method, as the adapter-specific calls beside it do.
  • Accept-set: no server, protocol or spec change, so no door accepts anything it did not accept on main. The client-side refusal (no _packageId, or overrides.package not equal to it, sends nothing) matches ADR-0146 D2, which admits the overrides declaration from the paired .custom alone, so the pair the ensure door answers is the only package that can hold the row being removed; the "pair held no row" throw closes the remaining case.

② Semver level

  • Metadata-protocol: none is true: nothing a metadata author can write changes (overrides is ADR-0146's existing key, only read here).
  • AGENTS.md Post-Task step 3: none takes patch, and a non-protocol widening ships patch. The changeset sets patch on exactly the four packages the diff moves (app-shell, plugin-view, data-objectstack, i18n), no fifth, none missing. Right.
  • Clause-②: yes (widening) is line-initial in both the PR body and the changeset body, with Metadata-protocol: none beside it; the arm is from the closed pair and not no (widening). True: three exported type or class widenings plus the i18n key set, nothing narrowed. The seat 4 claim's provisional no (expected) was amended by the dev on measurement and restated by seat 7's claim; the final declaration is the right one. Check Changeset and the Lint gates (which carry the ADR-0087 registration check) are success on the head.

③ Boundary flags

  • open_questions: empty in report 7075365451. Nothing to answer.
  • Dev flag, Clause-② amended from the claim's no (expected) to yes (widening): verified true in ① and ②.
  • Dev flag, model-free commit trailers against the harness reminder: consistent with AGENTS.md (the model-free Co-authored-by: Claude pair is the rule; the harness trailer is an exemption, not a requirement). No action.
  • Dev flag, out-of-scope tooling observation (os-verify-lock.sh waiter losing its slot), carrier: none, not filed: an observation outside classes a, b and c, which os-dev routes to the PR's Acceptance notes and does not file; the PR carries it there. Answered.
  • Dev flag, a stuck lock waiter process the classifier would not kill: environment of the dev's container, no PR content. No action.
  • Hand-over gaps the PR body names (targeted UI run after the merge, app-shell type-check after the merge, the rest of the derived gate list): answered by the head's check-runs, 58 in all, every one success or skipped, among them Test UI and all 16 shards, Type Check UI, TypeScript Type Check, Lint · PM dispatch-gates, Check Changeset, Live E2E UI, Build & E2E UI and Governed Surface Queue Guard.
  • The restore also discards the pair's pending draft of the view (Acceptance notes say so, matching Studio's restore); the confirm text names the name, pin and default only. Within the card's acceptance; not a contract change.
  • SQL push-down (Prime Directive 5): the diff is client-only. restoreFactoryView is one item read, one ensure call and two keyed deletes; listViews copies a key per row already read; the title switcher's per-item savedViews.find is pre-existing and runs over the list's view rows, not data records. No new id materialisation or in-app join. No finding.

Findings:

No must-fix, no should-fix.

N1 (nit) — The PR body's Readings say the targeted UI run and the data-objectstack type-check are NOT MEASURED on 767c872, while report 7075365451 says 72 files / 799 tests passed and data-objectstack type-check exit 0 on that same head; the two records of one head disagree. CI's green Test UI shards and Type Check UI make it moot for the verdict, but the body is the stale one.

N2 (nit) — restoreFactoryView deletes the pair's draft before its row, like deleteView, but when the draft delete succeeds and the row delete is then refused, the thrown error says only "was NOT restored" and carries no partial outcome, whereas deleteView attaches outcome for exactly that half-done state. Narrow in practice (both deletes sit behind the same manage_metadata gate), no contract effect.

Implemented-by: claude/issue-36011-restore-factory-view
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Landing (area f7-list, 2026-11-22T07:45Z): head 767c872b6600b0cb55508b8207e46a21bb1d073f · L1 ACCEPT 7076066265 · L2 PASS 7076066692 (TIER_DEFAULT, declaration face) · check-governed-merges --pr 36342: NOT governed, 842 changed lines ≤ 3000 · CI on the head: all success/skipped · mergeable clean · landing-k: can't answer (no Test Core shard ran on this UI-only head; not read as 0). → pr_ready + automerge_enable (merge queue).
Nits carried to Acceptance notes, not blocking (L2): stale NOT MEASURED lines in the body; restoreFactoryView's half-done error.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 07:46
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit cc05e60 Nov 22, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36011-restore-factory-view branch November 22, 2026 08:32
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… and the pinned list view per organization (objectstack-ai#36341)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUq2j5tRRVo3TVY3wcS1Fdg)_
Fixes objectstack-ai#36244

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
同时属于两个组织的用户,用同一个浏览器切换组织后,不再在新组织里先看到旧组织的收藏、最近访问、上次应用和固定视图;单组织与无组织部署的用户原有内容保留。
- 为个人设置清点中您接受的建议(p2):浏览器里的副本跟服务器一样按组织分开保存。
- 出错时最坏是某个组织里的收藏或固定视图首次显示为空、等服务器读回后恢复;不涉及他人数据,撤回本改动即回到原行为。
- 无。

## What changes

- `scopedKey(base, userId, orgId?)` (`UserStateAdapters`) spells
`BASE:u:USER:o:ORG` when an organization is active; without one (no
organization feature, a preview, the boot before an organization is
known) it is the user-only key as before.
- The organization is `ActiveOrganizationStorage`'s id, read
synchronously (`useOrganizationScope`): the same id the console stamps
on the `sys_user_preference` reads as `X-Tenant-ID`, and the one
`switchOrganization` stores before the switch reloads the console, so
the first paint after a switch reads the new organization's copy.
- `FavoritesProvider`, `RecentItemsProvider`, `LastAppProvider`,
`FlowPaletteRecentsProvider` read and write their browser copy under
that key, and re-load when the organization changes.
`FavoritesProvider`'s hydrate push-back now reads this organization's
local copy, so it can only carry this organization's own nav-pin extras
into its row.
- The pinned list view (`list.view.pinned`) is read through
`usePinnedListView` (new, `views/pinnedListView.ts`), whose slot is
`os:pref:list.view.pinned@object:OBJECT@org:ORG`. Only this preference
is keyed this way; the `os:pref` mechanism and every other workspace
preference are unchanged.
- **Carry-over rule (Done-when 4):** an organization that finds no copy
of its own adopts the copy kept before the organization was part of the
key (the user-only `ui.*` copy, and the per-object pin slot): the value
moves under that organization's key and the old key is removed, so
exactly one organization, the first to read it, inherits it. A
single-organization person keeps everything; a deployment with no
organization keeps the user-only key unchanged. The first reader is in
practice the organization the old copy mirrors: every hydrate rewrote it
with the active organization's row, and the first page-load on this code
boots into the organization the browser last held.
- Sign-out and change-of-user purges are keep-list sweeps
(`purgeSignedOutUserClientState`, `@object-ui/auth`); the new keys are
not on the keep list, so they are swept exactly as today's are. A pin in
`signOutPurge.test.tsx` holds that for all five new spellings.
- Round 2 (this head): the red `Type Check UI` / `Lint UI` (build) /
`Test UI (8/16)` on `f957b6e1` had two causes, both read from the job
logs before the fix. (1) `pinnedListView.ts(35,18): error TS2322` — the
org slot was built from `objectPreferenceScope()`'s union and could
spell `user@org:…`; it is now spelled `object:OBJECT@org:ORG` directly.
(2) `FavoritesProvider.test.tsx` "favorites and a nav pin set in A …"
read 21 ids — the suite above it leaves its last list under the
user-only key, which org A then adopted as designed; the new suite's
`beforeEach` now clears storage and resets the mocked user. No
production behaviour changed in round 2. `origin/main` was merged once
(`b3bcfefc`); it touched only one comment line in
`workspacePreference.ts` among this diff's files.

## Tests

Reach measured once, before the fix, by the round-1 dev with a unit
harness (no running console with two memberships in this container):
real `ActiveOrganizationStorage`, a fake server answering one
`ui.favorites` row per stamped organization, favorite + nav pin in A,
switch (remount) to B. On base `c30ce97c`: B's first paint
`["object:a_obj","nav:a_menu"]` (A's list); B's server row after hydrate
`["nav:a_menu"]` (A's nav pin pushed into B); pinned view read in B
`"pv_in_org_a"`, back in A after pinning in B `"pv_in_org_b"`, one key
`os:pref:list.view.pinned@object:crm_lead`. Both mechanisms reproduce.

All readings below are on head `af1438fd`, under
`scripts/pm/os-verify-lock.sh`.

<details><summary>Committed pins — 6 files, 67 tests, green</summary>

`cd ui && pnpm exec vitest run --maxWorkers=2` FavoritesProvider,
RecentItemsProvider, FlowPaletteRecentsProvider, LastAppProvider,
signOutPurge (context/__tests__) and views/pinnedListView-36244: `Test
Files 6 passed (6)` · `Tests 67 passed (67)` · `VERDICT command-exit 0`.

Neighbours that read the pin or the preference store
(ObjectView.personalViews-29635, ObjectView.titleViewSwitcher-27594,
consoleListStateWall-12418, consoleUserPreferenceBudget): `Test Files 4
passed (4)` · `Tests 45 passed (45)` · `VERDICT command-exit 0`.

`ui/packages/app-shell` `pnpm run type-check` (both `tsc --noEmit` and
`tsc -p tsconfig.test.json`): `VERDICT command-exit 0`, no `error TS`.
</details>

<details><summary>Four ablations — each red on its own pins, each
restored to the HEAD blob</summary>

Mutations through `scripts/ablation-replace.mjs` (WRAP mode: anchor must
hit once, blob must change, restore proven by blob == HEAD and empty
`git diff HEAD`). Same 6-file run each time; tests import `src`
relatively, so no `dist/` leg applies.

- A1 `scopedKey` ignores the organization (`UserStateAdapters.tsx`, blob
`94bba20a → 67dd65bb`): `Tests 8 failed | 59 passed` — the
per-organization and the adoption pins of all four providers.
- A2 no adoption (`if (own !== null || !userId || !orgId) return own;` →
unconditional return; blob `94bba20a → e9c51a34`): `Tests 4 failed | 63
passed` — the four "a single organization keeps the copy …" pins. The
first A2 attempt was refused by the tool before anything ran (its
replacement text already occurred in the anchor line, so the count did
not rise); retried with a distinct replacement.
- A3 pin slot ignores the organization (`pinnedListView.ts`, blob
`b49631f8 → af9680b7`): `Tests 2 failed | 65 passed` — the round-trip
pin and the single-organization pin.
- A4 no pin adoption (blob `b49631f8 → 6f653efc`): `Tests 1 failed | 66
passed` — the single-organization pin.

After the script: both files' blob equals `HEAD`'s (`94bba20a…`,
`b49631f8…`), `git status` clean on both.
</details>

## Acceptance notes

- The `os:pref:*` pin slot carries no user. The organization in the slot
does not change that, but a different account signing in on the same
browser runs the change-of-user purge, which sweeps every key not on its
keep list (all `os:pref:*` included), so a second account does not read
the first's pin.
- On a browser that holds no active organization yet (first boot, or
after the server answered none), the copy is the user-only one until the
organization resolves, then the organization adopts it; that boot window
also costs one extra preference read when the organization arrives.
- Quiet hours (`notificationPreferences`) still use the user-only key:
out of this card.

## Verification

Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/views/pinnedListView-36244.test.tsx` — 3 passing
tests expected.

Files to read first:
`ui/packages/app-shell/src/context/UserStateAdapters.tsx`
(`readScopedCopy`, `useOrganizationScope` — the adoption move),
`ui/packages/app-shell/src/views/pinnedListView.ts` (slot spelling and
pin adoption), `ui/packages/app-shell/src/context/FavoritesProvider.tsx`
(hydrate push-back).

<details><summary>Gates</summary>

Local, `dispatch-gates --commands --repo objectstack-ai/objectstack` at
`af1438fd`: 38 commands; 36 of the 37 non-vitest families exit 0 (exit
captured before any pipe). `pnpm check:type-check-debt` exit 3 — its
closure build queued past the lock budget (`VERDICT queue-timeout`), NOT
MEASURED locally; CI's `Type Check · debt ledger` is success on this
head. `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed |
2 skipped (174)` · `Tests 5127 passed | 2 skipped`, `VERDICT
command-exit 0`. `--ran` (with `:: exit` codes): `38 derived famil(ies)
accounted for — 37 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit
3)`. `overlap-check` before push: `VERDICT clean exit 0` (main and
objectstack-ai#36343, objectstack-ai#36342 merge cleanly).

CI on `af1438fd`: 52 check-runs, 39 success, 13 skipped, 0 failed —
among them `Lint & Repo Gates`, `TypeScript Type Check`, `Test Core`,
`Governed Surface Queue Guard`, `Lint UI`, `Type Check UI`, `Test UI`,
`Build & E2E UI`, `Live E2E UI`, `Dogfood Regression Gate`, `Check
Changeset`.
</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jV3scu6UYPb42n5okQ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant