Skip to content

fix(plugin-list): offer the In a queue toggle only when the organization has a queue - #28889

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-0ef0f7
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-0ef0f7

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #28428

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

维护者速读

What changes

  • @object-ui/permissions: PermissionContextValue gains one optional member, hasAnyQueue?: boolean. MePermissionsProvider sets it from the authenticated /auth/me/permissions answer (Session payload: the console learns once per session whether the caller's organization has at least one ownership queue (declared or sys_queue), with no widening of member read on sys_queue #28508). It is undefined with no answer: the anonymous answer, the role-based PermissionProvider, and no provider at all (usePermissions' no-provider literal). ServerReadScope and RecordFieldAccessScope spread their parent, so they forward it unchanged.
  • @object-ui/plugin-list: queueFilterOffered is now hasAnyQueue === true && objectHasOwnershipQueue(objectDef). The flag rides the permissions answer the console already holds, so opening a list reads no queue list and sends no new request.
  • Unknown flag = hidden (claim amendment 6567840348). Under the console, MePermissionsProvider renders its loading fallback until the payload arrives, so a list never sees a pending flag there. Elsewhere (no provider, the role-based provider, an anonymous session) nothing can show a queue exists, so the toggle stays hidden.
  • Turning the toggle on filters exactly as before. Nothing on the server changes.

Why

Route A ruling 6553134732 on #28428: offer the toggle when the object carries the queue field AND the session's has-queues boolean is true. In an organization with no queue, the toggle could only return an empty list.

Tests

  • ListView.queueSittingFilter-25769.test.tsx: the existing cases now mount under a session double (MePermissionsProvider with hasAnyQueue: true) and still pass. New cases: no queue gives no toggle even on an object with the injected column; one queue gives the toggle; an unknown answer (no provider, anonymous) gives no toggle; a list mount makes the same data-source calls with and without a queue, every find targets the listed object, and fetch is never called.
  • New hasAnyQueue-28428.test.tsx in @object-ui/permissions: the truth table (served true and false, anonymous, forwarded through ServerReadScope, role-based provider, no provider).
  • Ablations, each run through scripts/ablation-replace.mjs with the blob restored to HEAD afterwards:
    • Gate removed ((hasAnyQueue === true || true) && …): 2 red, "no queue" and "unknown answer".
    • Provider member removed (hasAnyQueue: undefined): 3 red, served true, served false, scope forwarding.

Acceptance notes

Measured on a production console build (turbo run build, pnpm console:build), pnpm dev:crm -- --fresh, admin, at head c0b35cd6:

State /auth/me/permissions hasAnyQueue crm_account list crm_contact list
app-crm as shipped (no queue) false no toggle no toggle
one sys_queue row inserted (201) true toggle shown toggle shown
row deleted again false no toggle no toggle
  • crm_account serves the injected queue column (system: true, hidden), so the old rule would have shown the toggle there.
  • Pressing the toggle with one queue sends GET /api/v1/data/crm_account?…&filter=["and",["owner_id","is_empty",true],["queue","is_not_empty",true]], the same filter as before.
  • Network: a list load made 31 or 32 API requests in both states, over two runs each. The distinct endpoint sets were identical. The one-request difference is a sys_user_preference PATCH that comes and goes with timing in either state. No request in any run named a queue.
  • Acceptance 1 says HotCRM too. HotCRM declares no queue (card reading), so it gets hasAnyQueue: false and the same result. It was not run here: it lives in another repository.
  • Screenshots are in the project files under issue-28428/.

Verification

Local runs at head c0b35cd
  • pnpm exec vitest run packages/plugin-list/ (from ui/): Test Files 179 passed, Tests 1727 passed.
  • pnpm exec vitest run packages/permissions/: Test Files 16 passed, Tests 172 passed.
  • pnpm --dir ui exec vitest run scripts/: Test Files 169 passed, 2 skipped; Tests 4900 passed, 2 skipped.
  • turbo run type-check --filter=@object-ui/plugin-list --filter=@object-ui/permissions: 51 of 51 tasks successful.
  • node scripts/pm/dispatch-gates.mjs --commands: 34 commands, all exit 0 (33 in one loop, plus the ui scripts/ suite above), including check-sdui-manifest.mjs, check-changeset-no-major.mjs --base origin/main, check-adr-0087-registration.mjs, check:published-files, check:nul-bytes.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (packages/spec not touched.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: not applicable.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 section is the Chinese summary the repo asks for).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jUddMTB1CyxjzoKGxi


Generated by Claude Code

…ion has a queue

The list toolbar now shows the toggle when the object carries the
platform's queue column AND the session's /auth/me/permissions answer
says hasAnyQueue. @object-ui/permissions hands that boolean on through
one optional PermissionContextValue member; an unknown answer hides the
toggle. No new request on list mount.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUddMTB1CyxjzoKGxi
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu

席位核对 · ACCEPT · 2026-11-02T03:43Z

Head-sha: c0b35cd687e04da325eac9b51136b71f5ee2a985

  • Shape:
    • The PR is a draft against main. Its first content line is Fixes #28428, and no other card sits beside a closing keyword.
    • 7 files, +235 / −11. No governed path: check-governed-merges --pr 28889 reports NOT governed.
    • Clause-②: yes (widening) and Metadata-protocol: none start their lines in the body and the changeset, as claimed (6567823409, amendment 6567840348). The changeset ships @object-ui/plugin-list and @object-ui/permissions as patch.
  • Read in the diff:
  • Gates (check-runs on this head): 44 success, 11 skipped, 0 failed or pending. mergeable_state is clean. Main's newer commits touch none of the diff's files.
  • Tests (dev): plugin-list 179 files / 1727 tests and permissions 16 files / 172 tests pass, and the ui scripts/ suite passes (169 passed, 2 skipped). There is a new truth-table test for hasAnyQueue. The existing queue-filter cases now mount under a session double. Two ablations went red (gate removed: 2 red; provider member removed: 3 red) and were restored. Type-check passes 51 of 51; derived gates pass 34 of 34.
  • Live (dev): on a console build with app-crm, no queue gives no toggle, one sys_queue row shows the toggle and it filters as before, and deleting the row hides it again. A list load makes 31 or 32 requests in both states, with identical endpoint sets and no queue URL.
  • Out of scope / NOT MEASURED: the seat ran no live session. HotCRM was not run (other repo).
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Fixes #28428 closes the card on merge.

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/m tooling

Projects

None yet

1 participant