Skip to content

Console: the browser copies of favorites, recent items and last app, and the pinned list view, are not kept per organization — one person in two organizations sees and saves one organization's choices in the other #36244

Closed

Description

@os-project-manager

repo:objectstack#4 (personal-settings inventory thread) · os-project-manager · session_01FEkQ5nmcZiFktDAYk1ThTQ

Filing gate ③ · Source: maintainer · Leehom, 2026-11-22T03:12:56Z, on the personal-settings inventory (project thread): 「接受你的建议,开p2卡,派发处理」. The suggestion he accepted: one card that makes the two browser-side stores below carry the organization.

What happens

On the server a person's console state is per organization: sys_user_preference is unique on (user_id, key) per organization (ADR-0120 D1, #8323), and sys_personal_view rows sit behind the organization wall. Two browser-side stores do not follow that, so a person who belongs to two organizations and uses one browser gets one organization's choices in the other. Both readings are by code reading on main a5a5312f; neither was reproduced in a running console.

1. The browser copies of ui.favorites, ui.recent, ui.app.last and ui.flow.palette.recents are keyed by user only. scopedKey(base, userId) in ui/packages/app-shell/src/context/UserStateAdapters.tsx spells the key <base>:u:<userId>, and FavoritesProvider, RecentItemsProvider, LastAppProvider and FlowPaletteRecentsProvider all use it. Switching organization reloads the console (WorkspaceSwitcher.handleSwitch), and after the reload in organization B:

  • the first paint draws organization A's favorites, recent items and last app from the browser copy, until the server read answers;
  • FavoritesProvider's hydrate step merges every local nav-pin favorite the server row lacks into the list and pushes the result back (localNavExtras, pushBack), so A's pinned navigation items are written into B's ui.favorites row;
  • when the server read fails, A's list stays on screen, and the next change saves it into B's row.

2. The pinned list view is one browser slot per object, with no organization. LIST_PINNED_VIEW_PREFERENCE (list.view.pinned, ui/packages/app-shell/src/utils/workspacePreference.ts) is stored under os:pref:list.view.pinned@object:<object>. The value can be the id of a personal view (sys_personal_view), which exists in one organization only. After a switch the pin names a view the list does not offer, so the list opens its declared default; pinning a view in B then overwrites the pin the person set in A.

Done when

  • First, measure reach once, before any fix: one person with memberships in two organizations, one browser. Record what is shown and what is written to sys_user_preference in B after favoriting and pinning in A. If either mechanism does not reproduce, say so on the card instead of fixing it.
  • The browser copies of the four ui.* slots are kept per (user, organization). After a switch, B's first paint never shows A's list, and nothing from A is written to B's server row.
  • The pinned list view is kept per organization: a pin set in A is still there on return to A, and B holds its own.
  • A person in a single organization, and a deployment with no organization feature, lose nothing: the copy and the pin they have today keep working after the change. The developer proposes how an existing unscoped browser value is carried (for example adopted once by the first organization that reads it) and states it in the PR.
  • Pins, each with an ablation: favorites pinned in A are absent from B's first paint and from B's saved row; a pinned view in A survives a round trip through B; the single-organization case keeps its existing copy and pin.

Not in this card

  • Quiet hours per person across organizations (raised in the same inventory, not asked for).
  • The other os:pref:* workspace preferences (column widths, row height, tab order, sidebar): feat(console): keep list column widths, row height and tab order in this browser only #36133 keeps them per browser.
  • Any server object or packages/spec change. If one turns out to be needed, report the fork instead of widening.
  • Observation for the claimant, not a requirement: the os:pref:* slot carries no user either, so a pinned personal-view id can be read by a second account on the same browser (it then matches no view and falls back). Mention in Acceptance notes what the fix does about it.

reach: people who belong to two or more organizations and use one browser for both; read from code, to be measured once by the claimant (first bullet above).
Business reason: the maintainer's words above. A person working in two organizations should not find one organization's pinned menu items saved into the other, or lose their pinned view each time they switch.
Reader: a domain:ui lane (console shell and list page): ui/packages/app-shell/src/context/{UserStateAdapters,FavoritesProvider,RecentItemsProvider,LastAppProvider,FlowPaletteRecentsProvider}.tsx, ui/packages/app-shell/src/utils/workspacePreference.ts and the list page's pinned-view reader.
Dedupe: favorites organization localStorage (14, all QA run records and checklist cards, none on this), "list.view.pinned" organization (0), "ui.favorites" (7, all closed, none on this), "pinned view" organization in:title (0).
Grade: p2, set by the maintainer (Ruling-ref in the first comment).
Grading line: area:ux · Bug · one person's own state shown and saved under the wrong organization, no other person's data involved · multi-organization users on a shared browser · read

Activity

  1. added
    bug
    priority:p2
    on Nov 22, 2026
  2. os-project-manager commented on Nov 22, 2026

    @os-project-manager
    CollaboratorAuthor

    Ruling-ref: priority:p2 — Leehom, 2026-11-22T03:12:56Z, in this project's chat (message cmsg_01TenzsRopZj4jMbvjX8uz1XE8TqBDBK6A9sshraQqTxo6), verbatim: 「接受你的建议,开p2卡,派发处理」. The grade is the maintainer's; the inventory had proposed p3.

    Scope he accepted: the two browser-side stores in the card body. The quiet-hours option from the same inventory was not asked for and is not in this card. domain:* and the queue label are left to the seat that dispatches it (repo:objectstack#4).


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

    Queued for seat 4 · 2026-11-22T03:15Z · the maintainer asked for this card to be opened and dispatched (Ruling-ref 7073419991). It goes to seat 4's area a4-F (list page; the app-shell browser-copy keys come in the same claim). The area makes the claim with the full pre-claim checks. Adds domain:ui and pm:queue.

  4. added
    domain:ui
    pm:queue
    on Nov 22, 2026
  5. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m

    Claim: PM loop · area a4-F · 2026-11-22T03:16Z · maintainer-directed (Ruling-ref 7073419991)
    Session: session_01FEkQ5oY5WCqqqBMtn9qt7m
    Account: os-project-manager
    Branch: claude/issue-36244-org-scoped-browser-state
    Worktree: objectstack-issue-36244
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-F
    File surface: ui/packages/app-shell/src/context/ UserStateAdapters.tsx (scopedKey), FavoritesProvider.tsx, RecentItemsProvider.tsx, LastAppProvider.tsx, FlowPaletteRecentsProvider.tsx; ui/packages/app-shell/src/utils/workspacePreference.ts (list.view.pinned) and the list page's pinned-view reader; the sign-out / change-of-user purge only where the new keys must be named; tests; a changeset. No server object, no packages/spec (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: opus (default tier; dispatch-gates --tier: no path-derived mandate on ui/**), effort: high (seat area order a4-F, 03:16Z addition)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack ui/packages/app-shell browser copies of per-organization server state | the server rows are already per organization (ADR-0120 D1); the browser keys are not | people in two or more organizations on one browser; read from code, reach measured once by the dev before fixing (card Done-when 1)
    Ruling-ref: 7073419991
    Thread-read: 7073426987
    Premise: holds by code reading at origin/main a5a5312 — scopedKey (UserStateAdapters.tsx:151) keys by user only; FavoritesProvider hydrate merges localNavExtras and pushes back (around :391-398); LIST_PINNED_VIEW_PREFERENCE list.view.pinned (workspacePreference.ts:196) has no organization. Reach not reproduced yet: the dev measures it first and reports a mechanism that does not reproduce instead of fixing it.
    Pre-claim lane: repo:objectstack whole-repo lane; paths ui/packages/app-shell/** (domain:ui); seat queue note 7073426987.
    Pre-claim deps: none.
    Prior rulings read: grade p2 by the maintainer (7073419991); #36133 keeps other os:pref:* per browser (not touched); sign-out keep #36110 (open, not this card); ADR-0120 D1 (server rows per organization).
    Fold-or-serial: not folded; overlap with a4-H's #36112 PR B (sidebar/favorites) — overlap-check before each push, second lander merges main.
    Serial constraints cleared: none blocking at origin/main a5a5312

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: type set (Bug); the area, pm:dispatched and the maintainer-set p2 stand as filed (Ruling-ref in the first comment). rationale: area:ux · Bug · the browser copies of favourites, recent items, last app and the pinned list view are not kept per organization, so switching organizations shows the other organization's entries · size S.

  8. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m
    os-dev-report

    Last pushed sha f957b6e (PR #36341, draft). State: implementation and pins pushed; local tests, ablations and type-check are unverified (never got the verify lock before the handover), CI is the first reading.

    {
     "issue": 36244,
     "status": "rework",
     "branch": "claude/issue-36244-org-scoped-browser-state",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/36341",
     "session": "session_01FEkQ5oY5WCqqqBMtn9qt7m",
     "premise_still_valid": true,
     "summary": "Handover-mode stop at pushed head f957b6e1. Implemented: the four ui.* browser copies (favorites, recent items, last app, flow palette recents) keyed per (user, organization) via scopedKey(base,userId,orgId) with the organization read synchronously from ActiveOrganizationStorage (the X-Tenant-ID source, stored before the switch reload); the pinned list view moved to usePinnedListView with an org-carrying slot; one-time adoption of the pre-change user-only copy / per-object pin by the first organization that reads it; pins for all of it plus a sign-out purge pin. Reach measured before the fix (unit harness, base c30ce97c): both mechanisms reproduce. Left / unverified: the new and touched tests, the four ablations and the app-shell type-check never got a turn on the shared verify lock, so CI is their first reading.",
     "tests": "Reach measurement on base c30ce97c (temporary harness, not committed; os-verify-lock VERDICT command-exit 0, Tests 2 passed): B first paint [object:a_obj, nav:a_menu]; B server row after hydrate [nav:a_menu]; 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. NOT MEASURED: the committed pins (FavoritesProvider, RecentItemsProvider, FlowPaletteRecentsProvider, LastAppProvider, pinnedListView-36244, signOutPurge, ObjectView pin suites, consoleUserPreferenceBudget) and four ablations (A1 scopedKey ignores org, A2 no adoption, A3 pin slot ignores org, A4 no pin adoption), reason: every lock attempt ended VERDICT queue-timeout (exit 99) before the handover order; scripted in step.sh, never ran.",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at f957b6e1: 38 commands; 36 of 37 non-vitest families exit 0 (exit captured before any pipe); pnpm check:type-check-debt exit 3 PREREQUISITE NOT MET (closure build never got the lock) = NOT MEASURED; pnpm --dir ui exec vitest run scripts/ not run (lock). --ran reconciliation not run. CI check-runs on PR 36341: in_progress at report time (not awaited per handover order). overlap-check before push: VERDICT clean exit 0.",
     "dogfood_battery": "n/a — no ! in the PR title and Clause-② no without a (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, run 44993924123) and this os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/36244/comments); plus git push (not REST)",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: the os-verify-lock queue held this run's every acquisition past its 540s budget for about 80 minutes (holders were sibling dispatches' verify scripts of 7 to 21 minutes); a slot resumed after a 99 re-entered behind later arrivals more than once"
     ],
     "deviations": "Commit trailer Co-authored-by: Claude (model-free) per AGENTS.md, conflicting with the harness reminder naming a model; PR opened without assignees per the dispatch order, conflicting with os-dev rule 2 (claim Account on pr_create); measurement used a unit harness, not a running two-membership console (Zone 2 item 1 allows it).",
     "files_changed": 15,
     "net_added_lines": 539
    }
  9. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

    Handover to repo:objectstack#7 · 2026-11-22T06:50Z

    Release: handed over to repo:objectstack#7 by the maintainer's word (Leehom 2026-11-22T06:32Z 「后续任务通过信箱交接给座位7」, then 「其他交接给座位7,现在就开始交接」). Handover sheet: mailbox #36199 comment 7075457123 (stop point and what is owed for this card).
    Resume-from: claude/issue-36244-org-scoped-browser-state@f957b6e18d8d8fd7c0316402a44e662c573dfb4b

  10. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 22, 2026
  11. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

    Claim: PM loop · area f7-shell · 2026-11-22T07:28Z · handed card, resumed from seat 4's Resume-from (handover sheet 7075457123)
    Session: session_01QsR2jV3scu6UYPb42n5okQ
    Account: zhuangjianguo
    Branch: claude/issue-36244-org-scoped-browser-state
    Worktree: objectstack-issue-36244
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: f7-shell
    File surface: unchanged from seat 4's claim 7073440292: ui/packages/app-shell/src/context/ (UserStateAdapters.tsx scopedKey, FavoritesProvider.tsx, RecentItemsProvider.tsx, LastAppProvider.tsx, FlowPaletteRecentsProvider.tsx), ui/packages/app-shell/src/utils/workspacePreference.ts and the list page's pinned-view reader, the sign-out / change-of-user purge only where the new keys must be named, tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: opus (default tier; dispatch-gates --tier at 2b57044: no path-derived mandate on ui/**), effort: high (M card)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack ui/packages/app-shell browser copies of per-organization server state | the server rows are already per organization (ADR-0120 D1); the browser keys are not | people in two or more organizations on one browser; reach reproduced by seat 4's dev in a unit harness (report 7075363715)
    Ruling-ref: 7073419991
    Thread-read: 7075558982
    Premise: holds (seat 4's dev reproduced both mechanisms on base c30ce97, report 7075363715)
    Pre-claim lane: repo:objectstack whole-repo lane, area f7-shell (seat 7 lease, #35557); paths ui/packages/app-shell/** (domain:ui).
    Pre-claim deps: none.
    Prior rulings read: grade p2 by the maintainer (7073419991); #36133 keeps other os:pref:* per browser (not touched); sign-out keep #36110 (open, not this card, waits on #35955 PR3); ADR-0120 D1.
    Fold-or-serial: not folded; #36110 (sign-out purge keep list) shares the purge file and is not takeable yet.
    Serial constraints cleared: overlap-check --branch=origin/claude/issue-36244-org-scoped-browser-state at main 2b57044: VERDICT clean exit 0 (#36343, #36342 share ObjectView.tsx, merge cleanly).
    Resume-from: claude/issue-36244-org-scoped-browser-state@f957b6e18d8d8fd7c0316402a44e662c573dfb4b

  12. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  13. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ
    os-dev-report

    Head af1438f on PR #36341 (draft). All checks green on this head; pins and four ablations measured locally.

    {
      "issue": 36244,
      "status": "done",
      "branch": "claude/issue-36244-org-scoped-browser-state",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36341",
      "head_sha": "af1438fdd9340946c7478bb2c10b6747f9e6e0f3",
      "session": "session_01QsR2jV3scu6UYPb42n5okQ",
      "premise_still_valid": true,
      "summary": "Resumed seat 4's branch at f957b6e1 (worktree from origin/claude/issue-36244-org-scoped-browser-state, no force-push), merged origin/main b3bcfefc once (it touched one comment line in workspacePreference.ts among this diff's files). Read the four red jobs' logs first: two causes. (1) Type Check UI and Lint UI (its build step) failed on pinnedListView.ts(35,18) TS2322: the org slot was built from objectPreferenceScope()'s union and could spell user@org:...; now spelled object:OBJECT@org:ORG directly. (2) Test UI (8/16) failed on the new FavoritesProvider per-organization pin (21 ids instead of 2): the earlier suite in the file leaves its list under the user-only key and org A adopted it as designed; the new suite's beforeEach now clears storage and resets the mocked user. No production behaviour changed; seat 4's change shape kept. PR body rewritten to this round's real readings via relay issue_patch.",
      "tests": "All at head af1438fd under os-verify-lock. Committed pins (FavoritesProvider, RecentItemsProvider, FlowPaletteRecentsProvider, LastAppProvider, signOutPurge, pinnedListView-36244): Test Files 6 passed (6), Tests 67 passed (67), VERDICT command-exit 0. Neighbours (ObjectView.personalViews-29635, ObjectView.titleViewSwitcher-27594, consoleListStateWall-12418, consoleUserPreferenceBudget): Test Files 4 passed (4), Tests 45 passed (45), VERDICT command-exit 0. app-shell pnpm run type-check (tsc --noEmit and tsc -p tsconfig.test.json, script name echoed): VERDICT command-exit 0, no error TS. Ablations via scripts/ablation-replace.mjs WRAP mode on the same 6 files (tests import src relatively, no dist leg): A1 scopedKey ignores org, blob 94bba20a->67dd65bb, Tests 8 failed | 59 passed; A2 no adoption, blob 94bba20a->e9c51a34, Tests 4 failed | 63 passed (first A2 attempt refused by the tool before running: replacement text already in anchor line, count did not rise; retried with a distinct replacement); A3 pin slot ignores org, blob b49631f8->af9680b7, Tests 2 failed | 65 passed; A4 no pin adoption, blob b49631f8->6f653efc, Tests 1 failed | 66 passed. Every restore: blob == HEAD and git diff HEAD empty; final hash-object of both files equals HEAD's.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at af1438fd: 38 commands. 36 of 37 non-vitest families exit 0 (exit captured before any pipe). pnpm check:type-check-debt exit 3 (its closure build hit VERDICT queue-timeout on the lock) = NOT MEASURED locally; CI 'Type Check · debt ledger' 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, #36343, #36342 merge cleanly). CI check-runs on af1438fd (re-read after the body edit re-ran the body-reading checks): 56 total, 41 success, 15 skipped, 0 failed, including 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 (all success).",
      "dogfood_battery": "n/a — no ! in the PR title and Clause-② no without a (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — relay issue_patch PATCH body of PR 36341 (run 45005437011, read-back 9113 bytes sent = stored, identical); this os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/36244/comments). Plus one git push (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [],
      "deviations": "Commit trailers model-free (Co-authored-by: Claude) per AGENTS.md, against the harness reminder naming a model; the merge commit was amended locally before push to carry the same trailer pair. PR 36341 carries no assignee (round-1 pr_create set none); not changed here since rule 2 leaves PR state set by another actor alone and no assignee write is in this dispatch's budget; the seat may add zhuangjianguo. Full app-shell package test not run locally (targeted pins + neighbours only); CI Test UI shards are the full reading, all success.",
      "files_changed": 15,
      "line_budget": "+613 / -71 vs origin/main (15 files); round 2 adds 5 lines net over f957b6e1 plus the main merge"
    }
  14. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

    Close-out · area f7-shell · 2026-11-22T12:19Z

  15. removed
    pm:dispatched
    on Nov 22, 2026
  16. added a commit that references this issue on Nov 22, 2026
    a57efde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions