Repository navigation
fix(console): keep the browser copies of favorites, recents, last app and the pinned list view per organization - #36341
Conversation
… and the pinned list view per organization (WIP) Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Stop point · area a4-F · 2026-11-22T06:38Z · seat handover (maintainer 06:31Z: no rework this shift; the successor continues) |
Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
…orites pins The pinned-view scope is spelled as an object scope so it type-checks against WorkspacePreferenceScope, and the per-organization favorites suite clears the copy the suite above leaves under the user-only key. Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Final head for L1 · area f7-shell · 2026-11-22T09:05Z
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT · head 维护者速读
席位核对
|
Claude-Session: https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Landing · area f7-shell · 2026-11-22T09:42Z
State: ready + auto-merge into the merge queue. |
Requested by Steedos · project thread
Fixes #36244
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
scopedKey(base, userId, orgId?)(UserStateAdapters) spellsBASE:u:USER:o:ORGwhen 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.ActiveOrganizationStorage's id, read synchronously (useOrganizationScope): the same id the console stamps on thesys_user_preferencereads asX-Tenant-ID, and the oneswitchOrganizationstores before the switch reloads the console, so the first paint after a switch reads the new organization's copy.FavoritesProvider,RecentItemsProvider,LastAppProvider,FlowPaletteRecentsProviderread 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.list.view.pinned) is read throughusePinnedListView(new,views/pinnedListView.ts), whose slot isos:pref:list.view.pinned@object:OBJECT@org:ORG. Only this preference is keyed this way; theos:prefmechanism and every other workspace preference are unchanged.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.purgeSignedOutUserClientState,@object-ui/auth); the new keys are not on the keep list, so they are swept exactly as today's are. A pin insignOutPurge.test.tsxholds that for all five new spellings.Type Check UI/Lint UI(build) /Test UI (8/16)onf957b6e1had two causes, both read from the job logs before the fix. (1)pinnedListView.ts(35,18): error TS2322— the org slot was built fromobjectPreferenceScope()'s union and could spelluser@org:…; it is now spelledobject:OBJECT@org:ORGdirectly. (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'sbeforeEachnow clears storage and resets the mocked user. No production behaviour changed in round 2.origin/mainwas merged once (b3bcfefc); it touched only one comment line inworkspacePreference.tsamong 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 oneui.favoritesrow per stamped organization, favorite + nav pin in A, switch (remount) to B. On basec30ce97c: 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 keyos:pref:list.view.pinned@object:crm_lead. Both mechanisms reproduce.All readings below are on head
af1438fd, underscripts/pm/os-verify-lock.sh.Committed pins — 6 files, 67 tests, green
cd ui && pnpm exec vitest run --maxWorkers=2FavoritesProvider, 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-shellpnpm run type-check(bothtsc --noEmitandtsc -p tsconfig.test.json):VERDICT command-exit 0, noerror TS.Four ablations — each red on its own pins, each restored to the HEAD blob
Mutations through
scripts/ablation-replace.mjs(WRAP mode: anchor must hit once, blob must change, restore proven by blob == HEAD and emptygit diff HEAD). Same 6-file run each time; tests importsrcrelatively, so nodist/leg applies.scopedKeyignores the organization (UserStateAdapters.tsx, blob94bba20a → 67dd65bb):Tests 8 failed | 59 passed— the per-organization and the adoption pins of all four providers.if (own !== null || !userId || !orgId) return own;→ unconditional return; blob94bba20a → 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.pinnedListView.ts, blobb49631f8 → af9680b7):Tests 2 failed | 65 passed— the round-trip pin and the single-organization pin.b49631f8 → 6f653efc):Tests 1 failed | 66 passed— the single-organization pin.After the script: both files' blob equals
HEAD's (94bba20a…,b49631f8…),git statusclean on both.Acceptance notes
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 (allos:pref:*included), so a second account does not read the first's pin.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).Gates
Local,
dispatch-gates --commands --repo objectstack-ai/objectstackataf1438fd: 38 commands; 36 of the 37 non-vitest families exit 0 (exit captured before any pipe).pnpm check:type-check-debtexit 3 — its closure build queued past the lock budget (VERDICT queue-timeout), NOT MEASURED locally; CI'sType Check · debt ledgeris 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:: exitcodes):38 derived famil(ies) accounted for — 37 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).overlap-checkbefore push:VERDICT clean exit 0(main and #36343, #36342 merge cleanly).CI on
af1438fd: 52 check-runs, 39 success, 13 skipped, 0 failed — among themLint & 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.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ