Repository navigation
fix(plugin-list): withhold the In a queue toggle on a view whose filter pins owner_id - #34623
Conversation
…er pins owner_id Claude-Session: https://claude.ai/code/session_01WGufzgSfnXy1nRQDKzcsXw Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgSfnXy1nRQDKzcsXw Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 (seat 3, L1-a) · 2026-11-17T04:47ZL1: REWORK The code, tests and every acceptance item hold. The one must-fix is a published doc sentence this PR makes false; the PR body already names it and leaves it for the seat. It is one sentence, so it goes in this PR. Must-fix
Should-fixNone. Readings that hold
Notes
|
Claude-Session: https://claude.ai/code/session_01WGufzgSfnXy1nRQDKzcsXw Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 delta (seat 3, L1-a) · 2026-11-17T05:14ZL1: ACCEPT The one must-fix from 6938675239 is met. The delta is one commit, one line, in a file the amendment now covers. Must-fixNone. Should-fixNone. Delta readings
Every reading of 6938675239 other than the must-fix still holds at this head, since no code moved. Notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz Landing · area o3-C · head 30d102c
State: ready + auto-merge now; on MERGED, #34580 closes via |
Requested by Yibo Wang · project thread
Fixes #34580
Clause-②: no
Metadata-protocol: none
维护者速读
owner_id为equals某人、in一组人或is_not_empty)时不再显示;写在 OR 组里的负责人条件不算。开关隐藏期间不再往查询里加条件;若之前处于打开状态会被关掉,切回能显示它的视图时是关闭的。@object-ui/plugin-list的工具栏判断,不动元数据、契约和服务端;另把文档queues-and-assignment-rules.mdx里描述开关何时出现的一句改成两个条件都写明。最坏情况是某个视图上开关被多藏了一次(只在负责人确实被钉死时才藏)。回滚即 revert 本 PR。ui/packages/plugin-list/src/ListView.tsx的viewFilterRequiresOwner与它下面的conjunctsOf/requiresOwnerValue(哪些算「顶层 AND」、哪些运算符算「必须有值」);② 同文件queueFilterOffered处新加的viewPinsOwner与重置 effect;③ListView.harness.test.tsx新增的ListView.queueToggleOwnerPin-34580块。pnpm --dir ui exec vitest run packages/plugin-list/src/__tests__/ListView.harness.test.tsx -t 34580,预期 6 个测试全部通过。What changes
ui/packages/plugin-list/src/ListView.tsx:viewFilterRequiresOwner(viewFilter). It lowers the view's own filter through the sharedtoFilterNodeSafely(so a stored rule list, an AST and a MongoDB-style object answer alike), walks the conjuncts of the top-level AND (nestedandnodes and implicit-AND lists included,ornodes skipped), and answers true when one conjunct is onowner_id(SystemFieldName.OWNER_ID) with an operator that requires a value, folded by the spec'scanonicalAstOperator:=(any spelling:equals,eq,==) with a non-empty scalar comparand;inwith a list whose every member is a non-empty scalar;is_not_empty(any spelling; direction comes from the operator name, as the spec's lowering reads it).A filter the lowering refuses pins nothing here; the list already answers it with its load error.
queueFilterOfferedadds&& !viewPinsOwner, whereviewPinsOwner = viewFilterRequiresOwner(authoredFilter)(the resolved view filter the fetch, export and empty state already read). SinceappliedQueueSittingConditionsis gated onqueueFilterOffered, a withheld toggle contributes no condition.No new key, no server reading, no contract change.
Why
The toggle AND-s
owner_id is_emptyandqueue is_not_empty(QUEUE_SITTING_CONDITIONS). Beside a view filterowner_id equals {current_user_id}(HotCRM's "My Open Deals") the conjunction has no rows whatever the data, and the user reads the empty list as "nothing is waiting in a queue". Same rule as thehasAnyQueuegate: offer an affordance only where it can do something.Tests
Added as a top-level
describe('ListView.queueToggleOwnerPin-34580')inui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx, opening withrestoreAfterBlock(), among the blocks that register no stand-in renderer (AGENTS.md: a new pin for a component that already has a shared harness file goes into that file, ruling record 6583487846). The toggle's existing offer rules stay pinned inListView.queueSittingFilter-25769.test.tsx, untouched.viewFilterRequiresOwnerpins on equals / in / is_not_empty across a stored rule list, an AST triple, a nestedand, an implicit-AND list and a MongoDB-style object; it does not pin inside an OR group (stored{ or: [...] }and ASTor), onnot_equals,is_empty,= null, or aninlist holding null.owner_id equals {current_user_id}+stage not_in [...], resolved throughFilterScopeProvider): no toggle, and the query carries nois_empty.{ or: [...] }keeps the toggle.rerender: pressed on the unpinned view, then the pinned view shows no toggle and its query has nois_empty, then back on the unpinned view the toggle is shown witharia-pressed="false"and the query has no queue condition.Acceptance notes
ListViewper view (identityKeyin app-shell'sobjectViewListRenderer.tsx), so a view switch there already resets the toggle; the rerender pin covers hosts that hand one instance a newfilter.{ or: [rule] }is lowered bytoFilterNodeto the bare rule, so it pins: it is logically the same condition. Groups of two or more members do not pin.content/docs/automation/queues-and-assignment-rules.mdx, the sentence on when the In a queue toggle shows, now names both shipped conditions: the organization has at least one queue, and the view's own filter does not requireowner_idto hold a value. The file joined the claim surface by the seat's amendment 6938684810.144cdc25: the only client-visible queue signal is the organization-wide booleanhasAnyQueueonGET /auth/me/permissions(no names, no counts, nothing per object), and thequeuecolumn is injected on everyownership: 'user'object. So no per-object signal exists to read without a new server reading; it stays the maintainer's ruling the card raises.Verification
Round 1 readings below are against head
fc84516b(base144cdc25). Round 2 (79f051de) adds only the docs sentence; its gate run is the last block.Tests
Run from the repository root,
ui/as vitest root, atfc84516b; each underscripts/pm/os-verify-lock.sh.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-list/→Test Files 174 passed (174),Tests 1863 passed (1863), lockVERDICT command-exit 0.pnpm --dir ui exec vitest run --reporter=verbose packages/plugin-list/src/__tests__/ListView.harness.test.tsx -t 34580→ the sixListView.queueToggleOwnerPin-34580tests listed ✓,VERDICT command-exit 0.pnpm --filter @object-ui/plugin-list type-check(tsc --noEmit && tsc -p tsconfig.test.json) →VERDICT command-exit 0.npx eslint src/ListView.tsx src/__tests__/ListView.harness.test.tsx(from the package, as Lint UI runs it) → 0 errors (warnings only, allno-explicit-any, the harness's existing style).pnpm --dir ui run check:new-line-citations→0 new citation(s).npx turbo run build --filter='@object-ui/plugin-list^...' --concurrency=2→VERDICT command-exit 0.Ablation
Two mutations through
node scripts/ablation-replace.mjs(anchor hit 1 → 0, blob moved, restore proved by blob == HEAD and an emptygit diff HEAD), each runningpnpm --dir ui exec vitest run packages/plugin-list/src/__tests__/ListView.harness.test.tsx -t 34580. The subject is imported from source (../ListView), so no build sits between the mutation and the run.queueFilterOfferedwithout&& !viewPinsOwner→Tests 2 failed | 4 passed: "My Open Deals": no toggle… and switching views… went red.setSittingInQueueOnly(false)replaced byvoid 0→Tests 1 failed | 5 passed: only switching views… went red (the toggle came backaria-pressed="true").Both restored;
git diff HEADempty after each.Derived gates
node scripts/pm/dispatch-gates.mjs --commands(change set of 3 paths vs merge base144cdc254), each run atfc84516b, then--ran→38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED.node scripts/pm/check-governed-merges.mjs --branch HEAD→0 of 3 path(s) hit the register, NOT governed; size +218 / −4.Round 2 derived gates (79f051d)
After the docs commit the change set is 4 paths and
--commandsderives 70 families; all 70 were run at79f051de, each:: exit 0, and--ranreports 70 run, 0 NOT-MEASURED. The tree was 24 commits behindorigin/mainat derivation; per AGENTS.md section 10,mainwas not merged in (no conflict, no main-caused red).Human Minimum
packages/specholds no runtime logic. (packages/specuntouched.)pnpm lintpasses. (eslint on the two changed files: 0 errors.)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code