Skip to content

feat(console): the approvals queue steps from request to request and opens the next one after a decision - #34624

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-2ojt62
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-2ojt62

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #34586

Clause-②: yes (widening) — one new export, approvalQueueState, from @object-ui/app-shell (workspace-private: "private": true, not published; the console is its one consumer), and two new approvalsInbox keys in the @object-ui/i18n locale packs (openNextAfterDecision, queueDone; TranslationKeys grows); nothing removed or renamed
Metadata-protocol: none

维护者速读

  • 改了什么:从「待我审批」打开一条请求时,把当前筛选和排序下的待审列表一起带过去;请求页右上角出现计数(「1 / 3」,读屏和悬停提示为「第 1 条,共 3 条」)、上一条 / 下一条和 J / K,面包屑能回到收件箱;新增「处理后打开下一条」开关(默认开,按浏览器记住),通过、驳回、退回、转交等让请求离开「我的待审」之后自动打开下一条,最后一条处理完回到列表并提示已处理完。
  • 为什么改:维护者 11-17 走查:「审批页通常要看完整记录,如何让操作更方便」;原来处理完一条要自己回列表再点下一条。
  • 风险与回滚:只改控制台前端(收件箱打开请求的方式、请求页顶栏加一个开关、一处已有导航函数抽出复用),不动审批权限、规则和服务端接口;从通知、直接链接、「我提交的」「全部」打开的请求不受影响。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/approval-decision/approvalQueueAdvance.tsx(何时自动前进:请求在本页重新读取后状态离开 pending 或 viewer.can_act 变 false)、ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx 的 openRequest、ui/packages/app-shell/src/views/RecordDetailView.tsx 两处顶栏 toggles。
  • 两分钟验证:cd ui && pnpm exec vitest run apps/console/src/pages/system/ApprovalsInboxPage.queueStepper-34586.test.tsx packages/app-shell/src/views/approval-decision/approvalQueueAdvance-34586.test.tsx,预期 2 个文件 17 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

The queue travels with the request. The inbox's openRequest now navigates, from the pending tab only, with approvalQueueState({ pathname, label }, filteredRows ids): the from shape every list hands a record page it opens (from.pathname, from.label, from.siblings) plus one marker key, approvalQueue: true. The rows are filteredRows, the list exactly as it is drawn (search, process, object and status filters, and the sort). The "Submitted by me" and "All" tabs list requests the reader is not deciding, so they hand no queue.

The counter and next / previous are the record page's own. RecordDetailView already draws the counter, ↓ ↑ and j / k over from.siblings (useRecordPageReturn in recordDrawerStack.tsx), and its crumb already returns to from.pathname by from.label. Nothing new draws them; the inbox now feeds them. The visible face is the house counter 1 / 3; the accessible name and tooltip are detail.recordOfScope (1 of 3 in Approvals Inbox; zh-CN 「第 1 条,共 3 条」 is detail.recordOf).

Open next after deciding (approval-decision/approvalQueueAdvance.tsx, new). useApprovalQueueAdvance(requestId, row) runs on a sys_approval_request page (not in a pane) and watches the row the page shows. When the same request goes from "in the reader's queue" (status: 'pending' and viewer.can_act true; status alone when the row has no viewer) to out of it, and the switch is on, it replaces the page with the next request (the one after it, else the one before it) and drops the decided id from from.siblings, so the counter reads 1 of 2. With none left it replaces the page with the list and toasts approvalsInbox.queueDone. The change is observed on the page's own re-read: ApprovalDecisionPanel already announces the request changed after a declared action succeeds (notifyDataChanged), and the page re-reads it through ApprovalRecordReads. So an action that leaves the request waiting on the reader (request info, remind) moves nothing, and a request first shown already decided moves nothing.

The switch, 「处理后打开下一条」, is drawn in the page's top bar after the counter, on the desktop and the phone bar, only on a page opened from the queue. Its value is a reader preference in the console's one preference store: APPROVAL_QUEUE_OPEN_NEXT_PREFERENCE (workspacePreference.ts, user scope, on / off, default on, per browser, never metadata).

Small reuse edits. recordDrawerStack.tsx exports readFromSiblings (unchanged) and a new siblingRecordStep(location, fromId, toId): the route, search and state the counter's ↓ ↑ already computed inline, extracted so the queue's step lands exactly where ↓ would. The counter's own go now calls it; behaviour is unchanged. @object-ui/app-shell exports approvalQueueState.

Strings. approvalsInbox.openNextAfterDecision and approvalsInbox.queueDone in all 11 locales of @object-ui/i18n (the key-parity test needs all of them).

File surface. One changed file sits outside claim 6936650853's list: ui/packages/app-shell/src/index.ts (+3 lines, the approvalQueueState export the console imports); the seat's claim amendment adds it.

Not changed: approval permissions, rules and server endpoints; the decision bar's buttons (card #34361 owns their layout); the inbox's list rendering.

Tests

New files, named for the card:

  • ui/apps/console/src/pages/system/ApprovalsInboxPage.queueStepper-34586.test.tsx (6 tests) mounts the real inbox and the real RecordDetailView under ApprovalRecordReads, as the fix(pm): stop --report presenting command-exit as one certified population #12484 harness does. Acceptance 1 (first of three opens as 1 of 3 in Approvals Inbox, the crumb names the inbox, ↓ opens the second as 2 of 3), the set follows a search, acceptance 2 (approve the first, land on the second as 1 of 2; reject it, land on the third; approve the last, back on the inbox with the done toast), acceptance 3 (switch off, the page stays), acceptance 4 (direct link: no counter, no switch, a decision moves nothing), and a control that the "All" tab hands no queue. A decision is simulated as the panel's own after-decision step: the served row changes and notifyDataChanged announces it.
  • ui/packages/app-shell/src/views/approval-decision/approvalQueueAdvance-34586.test.tsx (11 tests): the state reader (a list's unmarked from is not the queue), nextInQueue, inReaderQueue, and the hook over a route: advance with the set shrunk, countersign (can_act false while still pending) advances, the last goes to the list with the toast, switch off stays and is kept for the next page, turning it back on after a decision moves nothing, request-info stays, an already-decided request stays, no queue state draws nothing.

Runs, from ui/, under scripts/pm/os-verify-lock.sh (shared box):

  • the two new files: console Tests 6 passed (6) on 36749a16 (the file is unchanged since), app-shell Tests 11 passed (11) on 885cedbf;
  • the affected set, 115 files that read the record top bar, useRecordPageReturn, recordDrawerStack, workspacePreference or the inbox and decision panel, plus all of packages/i18n/: Test Files 214 passed | 2 failed | 1 skipped (217) on 36749a16. Both reds were this branch's own and are fixed on 885cedbf: zh-Hant.ts is generated from zh-Hans.ts (pnpm --filter @object-ui/i18n gen:zh-hant, one word changed), and one new pin of mine asserted the wrong stored value. Re-run of those files plus the key-parity test: Test Files 3 passed (3), Tests 70 passed (70).
Ablations (each through scripts/ablation-replace.mjs, restored to the HEAD blob with git diff HEAD empty)
  1. Inbox hands no queue (tab === 'pending' replaced by false in openRequest): console file 4 failed | 2 passed; the two greens are acceptance 4 and the All-tab control, which pin the absence.
  2. Switch ignored (!openNext dropped from the advance guard): 2 failed | 14 passed across both files (the two switch-off pins).
  3. "Was in the queue" dropped (!before.queued removed): app-shell 1 failed | 10 passed (turning the switch back on after a decision it was off for moved the page).

Acceptance notes

  • The card asks for 「第 N 条,共 M 条」 on the page. The visible counter is the record page's house face N / M on every list-opened page; the sentence form is its accessible name and tooltip. Changing the visible face would change every record page, so it stays.
  • Each request opens under the app that owns its record (requestPagePath, objectstack#32667). Stepping keeps the app segment of the page it steps from, as the counter's ↓ does on any list.
  • When the reader decides the last request after skipping earlier ones with ↓, the page opens the one before it rather than returning to the list; the list is "done" only when the set is empty.
  • "Remembered per user" is the console's per-reader preference store, which is per browser (as every other reader preference in workspacePreference.ts), not a server-side setting: the order asks for a client-side preference only.

Verification

…opens the next one after a decision

From the inbox's pending tab a request opens with the queue as the list
shows it (filtered and sorted): the request page's top bar draws the
existing counter and next / previous over it, and a toggle (default on,
kept per reader) opens the next request once a decision takes the current
one out of the reader's queue, back to the list when none is left.

Claude-Session: https://claude.ai/code/session_01WGufzgwLxpT1AVJJAwAvyR
Co-authored-by: Claude <noreply@anthropic.com>
…ts memo depends on

Claude-Session: https://claude.ai/code/session_01WGufzgwLxpT1AVJJAwAvyR
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

席位核对 · L1 (seat 3, L1-a) · 2026-11-17T04:42Z

L1: REWORK
Head-sha: 144cc8f
Card: #34586 · claim 6936650853 + amendment 6937098211 · os-dev-report 6938082032 + addendum 6938151253

The code, tests and Clause-② reading all hold. The one must-fix is paper only: one changed file is outside the claim's file surface. It needs no push. Once the seat posts the claim amendment, I re-read and post the ACCEPT on this same head.

Must-fix (paper only, no code change)

  1. ui/packages/app-shell/src/index.ts is outside the claim's file surface. The claim (6936650853) lists ui/apps/console/src/pages/system/**, ui/packages/app-shell/src/views/approval-decision/**, RecordDetailView.tsx, recordDrawerStack.tsx, ui/packages/app-shell/src/utils/workspacePreference.ts, ui/packages/i18n/src/locales/* and root .changeset/. The amendment 6937098211 says "file surface stand[s]", and the addendum 6938151253 names the new export only as a Clause-② fact, not as a surface amendment. The diff adds export { approvalQueueState } to the package entry (+3 lines). Fix: the seat posts a claim amendment that adds ui/packages/app-shell/src/index.ts, and the PR body names it in one line. The head does not need to move.

Should-fix

None.

Readings that hold

Item Reading
PR shape Draft, base main, Fixes #34586; no other closing verb in the body. No !, no (narrowing): no dogfood battery owed. Branch carries a clean merge of main with #34621 (sibling card on ApprovalsInboxPage.tsx); mergeable_state clean.
Scope 20 files: the 19 besides index.ts are inside the claim surface. ApprovalDecisionPanel.tsx, listed in the surface, is untouched (the page's existing notifyDataChanged re-read carries the decision).
Clause-② / Metadata-protocol Body and changeset: Clause-②: yes (widening), Metadata-protocol: none, matching amendment 6937098211 plus addendum 6938151253. Widening reading at TIER_DEFAULT (seat routing: locale-keys-only widening is read here): the published face moves only in @object-ui/i18n. Two keys are added in all 11 locale files (openNextAfterDecision, queueDone). They are add-only, with nothing renamed or removed; each locale carries its own translation, and zh-Hant comes from gen:zh-hant. approvalQueueState is exported from @object-ui/app-shell, which is "private": true, so it is not a published accept set. Declaration accurate; no spec/schema or governed-rule face touched, so no further L2 is owed.
Changeset Names @object-ui/console and @object-ui/i18n (both not private). Sentences read against the diff:
• "from the 'My pending' tab … opens with the queue as the list shows it, filtered and sorted" = tab === 'pending' ? { state: approvalQueueState(…, filteredRows.map(id)) } : undefined.
• "counter 1 / 3 … next / previous and j / k, breadcrumb back to the inbox" = the existing useRecordPageReturn over from.siblings / from.pathname / from.label.
• "switch … on by default and remembered per browser" = APPROVAL_QUEUE_OPEN_NEXT_PREFERENCE, switchCodec, default 'on', kept in localStorage.
• "approved, rejected, sent back, reassigned, or approved for your countersign slot while others still decide … next request opens and the decided one leaves the count" = inReaderQueue (status leaves pending or viewer.can_act false), plus nextInQueue and remaining.
• "after the last one … returns to the inbox and says the list is done" = navigate(listPath, { replace: true }) plus toast.success(queueDone).
• "switch off: stays" and "an action that leaves the request waiting on you … does not move" = the !openNext and queued guards.
• "any other way … no counter and no switch" = readApprovalQueue requires approvalQueue: true.
All true. @object-ui/app-shell is not named; it is private, so this is not required.
Acceptance 1 (N of M, next) Met. The visible face is the house counter 1 / 3; the sentence 「第 1 条,共 3 条」 / "1 of 3 in Approvals Inbox" is its accessible name and tooltip. That is a declared deviation with a sound reason (changing the face changes every record page); the epic figures are sketches, not pixel specs.
Acceptance 2 (advance; done → list) Met; pinned in the console file (approve 1st → 2nd as 1 of 2, reject → 3rd, last → inbox plus toast) and the hook file (countersign can_act false still advances).
Acceptance 3 (switch off stays) Met; pinned, and the choice is kept for the next page.
Acceptance 4 (direct link) Met; no counter, no switch, a decision moves nothing (pinned), and there is an All-tab control.
Item 3 (J / K) The record page's existing j / k over from.siblings.
Refactor siblingRecordStep is the counter's inline ↓ ↑ body moved verbatim (same siblingRecordPath, the same RECORD_RELATED_ENLARGE_PARAM drop and the same withoutKeys(… PUSHED_STATE)); the counter's go now calls it. readFromSiblings only gains export. No behaviour change by reading.
TDZ check on moved openRequest It moved below filteredRows; inboxTitle (l.913) and location (l.912) are declared above it; TypeScript Type Check is green, so no use precedes it in a deps array.
Tests Real commands with output; 6 + 11 new pins; three ablations through ablation-replace.mjs, each restored to the HEAD blob, each turning the pins it targets red with the absence-pinning controls green.
Tier check-governed-merges --pr 34624: NOT governed, 0 of 20 paths, 833 lines. Tier S, lands through o3-A.
CI on this head 62 check-runs: all success or skipped. Test UI 16/16 shards plus the aggregate, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Lint & Repo Gates and TypeScript Type Check are all success. One PR-body guards run is cancelled because a body edit superseded it; its rerun on the same head (job 133814289454) is success.

Notes (no action for this PR)

  1. Edge: queue done can land on an already-decided request. If the reader decides a request with the switch off (it stays in from.siblings), then turns the switch on and works to the end of the queue, nextInQueue falls back to siblings[index - 1]. That can be the request decided earlier, so the page opens a decided request instead of returning to the list with the done toast. This is rare (it needs the switch toggled mid-queue) and harmless, because the page just shows the decided request. If wanted, a follow-up can drop ids decided on this page with the switch off too.
  2. Back after "queue done": navigate(listPath, { replace: true }) replaces the request page with the list, so the history reads list → list and one Back press lands on the same list. Cosmetic.
  3. Not measured: the phone top bar's room for the checkbox plus its label, 「处理后打开下一条」, next to the counter. There was no browser leg; the landing area may glance at 390 px if it boots the console.
  4. Two new react-refresh/only-export-components warnings on recordDrawerStack.tsx are declared in the body; the file already carries 14.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

席位核对 · L1 delta (seat 3, L1-a) · 2026-11-17T04:45Z

L1: ACCEPT
Head-sha: 144cc8f
Supersedes: REWORK 6938584691 (same head; its one must-fix was paper only)

Delta read

Item Reading
Must-fix 1 (file surface) Closed. Claim amendment 6938608313 on #34586 adds ui/packages/app-shell/src/index.ts (the approvalQueueState export from the workspace-private package) and restates Clause-②: yes (widening …) / Metadata-protocol: none, matching the PR body and changeset. The PR body's new "File surface" paragraph names the file and the amendment. All 20 changed files are now inside the claim surface.
Head Unchanged at 144cc8fa: every other reading in 6938584691 stands as written. That includes CI (62 check-runs, all success / skipped), Tier S (check-governed-merges: NOT governed, 833 lines), and the Clause-② widening read at TIER_DEFAULT, with no further L2 owed.
For landing mergeable_state read unstable just now, after the body edit: the PR-body guard run re-fires on a body edit. Re-read check-runs and mergeable_state on this head before pr_ready (true-green).

The non-blocking notes of 6938584691 stay notes; no follow-up card is asked for by L1. A later push owes a delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX

Landing · 2026-11-17T04:46Z · area o3-A lands for the #34586 card thread

Probe Reading
check-governed-merges.mjs --pr 34624 NOT governed · 833 changed lines (+803/−30) ≤ 3000 · Tier S
L1 + checks on head 144cc8fac4ebd042fe20ebe6e2f2490fb62fcefa L1-a ACCEPT 6938638882 (delta over 6938584691) · 66 check-runs: 48 success, 17 skipped, 1 cancelled (an earlier PR-body guards run, superseded by two success runs on this head) · mergeable_state clean · main 2 first-parent commits ahead of base, neither touching locales/en.ts or skills/**

State: pr_ready + automerge_enable now; #34586 closes on merge via Fixes. #34587 (same file) landed first as #34621.

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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

审批:待审请求之间加上一条 / 下一条,处理完一条自动打开下一条

2 participants