Skip to content

feat(app-shell): fold the approver's decision band on a record under approval - #34641

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34361-approver-band-fold
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34361-approver-band-fold

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

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

Fixes #34361

Clause-②: yes (widening — new @object-ui/i18n en keys only; no metadata/schema accept set)
Metadata-protocol: none

维护者速读

  • 改了什么:审批人打开审批中的记录时,原来平铺的 7 个审批按钮收成一条审批条:前面一行状态「待你审批 · 第 N 步 · 步骤名 · 提交人 X」,只露出「通过」「拒绝」两个按钮,转签 / 退回修改 / 退回补充 / 回复(审批人兼提交人还有撤回、催办)都放进一个「更多」菜单。业务记录页和审批请求页是同一条。记录自己标题栏的按钮不动。
  • 为什么改:裁决 A(6917968848)。客户反馈记录页上有「两层菜单」,分不清哪一排是自己要做的事。
  • 风险与回滚:只改按钮摆放,谁能审批、每个按钮的显示条件、对话框和发出的请求都不变;越权管理员的折叠(琥珀色菜单)和只是提交人的查看者都不变。回滚就是 revert 本 PR。
  • 先看:① ui/packages/app-shell/src/views/DeclaredActionsBar.tsx 里 decisionBand 那段(决定哪些按钮留在外面、何时收进菜单);② ui/packages/app-shell/src/utils/approvalDecisionFold.ts(按动作声明的 variant 判断,不按名字);③ 两个调用点各加了一个 foldDecisions。
  • 两分钟验证:以审批人身份打开一条审批中的业务记录(或它的审批请求页),应看到一行「待你审批 · 第 N 步 …」,右边只有「通过」「拒绝」和一个「⋯ 更多」,点开「更多」能看到转签、退回修改、退回补充、回复。
  • 需要你做的:无,席位落地。

What changes

Ruling A (6917968848), executed as the coordinator's plan (6936836041) lays it out.

  • DeclaredActionsBar gains a second fold, foldDecisions (the approver fold). It applies to a viewer the server says can act (viewer.can_act === true) once more than two of the bar's actions are shown:

    • a status line names the task (「待你审批」 / "Awaiting your approval"), the step's number on the served route (flow_route), the step's label (step_label), and the submitter (submitter_name, or the existing "You submitted this" when viewer.is_submitter is true);
    • the actions whose declared variant is primary or danger stay buttons (today approval_approve and approval_reject); the split is read off metadata (isLeadDecision), never off a name list, so an action shipped as metadata alone lands in the menu;
    • every other permitted action goes into one neutral "More approval actions" menu (DropdownMenu plus DeclaredActionButton asMenuItem, the same mechanism the override fold uses). The trigger is a plain outline button: the amber shield stays the override path's mark;
    • phone: the status line on top, then one row with the two decisions at equal width (flex-1) and the menu trigger at its end.
  • Gates and dispatch unchanged. Every folded action keeps its own visible, disabled and capability gates and its dialog, and sends the same request.

  • onDrawnActionsChange semantics unchanged. Menu actions still count as drawn: a closed menu's actions report through the same visibility probe the override fold uses. The only internal change is that the drawn-set reporter now records a false verdict as a key too, so "every action has reported" can be read; the drawn list itself still holds true verdicts only.

  • Until every action has reported its visible verdict, the band folds, so the usual case never paints a flat row first. With two or fewer shown, the rest stay buttons.

  • Disjoint from the admin override fold by construction: that viewer's can_act is false. foldOverrides, isOverrideOnlyViewer, data-approval-override-folded and their tests are unchanged.

  • Both call sites pass foldDecisions: the business record page (RecordDetailView, beside its existing foldOverrides) and the request page (ApprovalDecisionPanel).

  • Deviation from ruling A's wording — reply (approval_comment) stays in the band's menu on both pages, not in the approvals panel. Ruling 6917968848 and the card body say 回复 moves to the approvals panel or the discussion. The complaint (two stacked bars, reply in the button row) is still fixed: reply leaves the button row. Seat repo:objectstack#3 accepted the deviation on this reason; a line on [Decision] Record page under approval shows two stacked action bars (approval decisions on top, the record's own actions in the header): fold, merge, or move the approval actions? #34361 lets the maintainer ask for a panel entry later. Moving it into the RecordApprovalsPanel timeline is more than a modest change here:

    • on the synthesized record page the panel is a tab (record:approvals), or a right-column block whose placement depends on the page tier;
    • the bar cannot tell whether a mounted panel is actually on screen, so a panel entry plus a menu fallback can draw reply twice or not at all;
    • the panel has no action runtime of its own: it would need a second ActionProvider and the request definition just to run one declared action.

    In the menu, reply is reachable on every layout.

  • Recall for an approver who also submitted: in the menu (allowed by the plan).

  • Waited-days hint: not added. No threshold logic for it exists in app-shell. The only age logic is the console inbox's relative-time formatter plus an SLA due date that the record page's request row does not carry. So there was nothing to reuse, and inventing a threshold is out of scope.

  • New @object-ui/i18n keys (four), in every pack: approvalsInbox.awaitingYourDecision, approvalsInbox.stepNumber, approvalsInbox.submittedByName, approvalsInbox.moreDecisionActions. en and zh-Hans are hand-written, zh-Hant is regenerated by gen:zh-hant (byte-identical to what was written), and the other packs are translated. Reused keys: approvalsInbox.submittedByYou, common.more, common.actions.

Why

Ruling A: 「A 收成一条“待你审批”」 — the approver's decision actions stay in their own band above the page body, folded: a status line that names the step, 通过 and 拒绝 as the only buttons, the other decision actions in one menu; the record's header actions do not move; no protocol change.

Tests

  • New ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.approverFold-34361.test.tsx (12 tests):
    • approver: status line, two buttons, every other lever in the menu, in declaration order;
    • phone layout: flex-1 on the decisions, the trigger last in the row;
    • a menu lever dispatches exactly as its button would;
    • approver plus submitter: remind and recall are in the menu, and the line says "You submitted this";
    • an action declared with no variant lands in the menu, not as a button;
    • the submitter-only viewer is unchanged;
    • the override-only admin stays on the override fold;
    • a host without foldDecisions is unchanged;
    • with two or fewer shown, the levers stay buttons;
    • drawn-set reports: menu levers counted, hidden ones not, and an empty set on unmount;
    • the request page (ApprovalDecisionPanel, real bar) draws the same band, remind included because that page excludes nothing.
  • New ui/packages/app-shell/src/utils/approvalDecisionFold.test.ts (7 tests).
  • Updated RecordDetailView.approvalDeclaredActions.test.tsx: the approver's reassign, send back and request info are read from the band's menu (the override fold set this precedent for the same file). The submitter, override and fail-closed cases are untouched.
  • DeclaredActionsBar.foldOverrides-25877.test.tsx and utils/approvalOverride.test.ts are unchanged and green.

Acceptance notes

  • Claim surface amendment 6938979625 (area o3-A, per L1-a 6938968708): the existing test ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx is edited (assertion edits only: three approver pins read reassign / send back / request info from the band's menu).

  • Sticky band on scroll: not in ruling A, so not done. The coordinator's plan (6936836041) asks for the maintainer's confirmation first.

  • Reply in the panel: kept in the menu; reasons under What changes.

  • Waited-days hint: not added, because no threshold logic exists to reuse.

  • Docs: ui/AGENTS.md ✨ Set up Copilot instructions #2 asks for a matching content/docs/frontend/ page. content/docs/** is outside this card's claimed file surface, and the bar has no SDUI node type and no page that documents its props today.

  • Hot files: feat(approvals): the approval request page shows the whole business record #34631 (审批请求页:直接显示完整的业务记录,不止「提交时的内容」里的 6 个字段 #34588, request page) rewrites ApprovalDecisionPanel.tsx. overlap-check reports a textual conflict with that head in this file. This PR's change there is one prop (foldDecisions) on the bar's call site, so whichever lands second keeps that one prop.

Verification

All on head 48d70e28 (origin/main merged at 97defd60 plus later; the merge brought locale-pack and app-shell changes, so the closure was rebuilt and the suites re-run after it).

Build of the app-shell dependency closure

bash scripts/pm/os-verify-lock.sh -c "pnpm turbo run build --filter='@object-ui/app-shell^...' --concurrency=2 && pnpm --dir ui exec vitest run --maxWorkers=2 packages/i18n/ packages/app-shell/src/views/__tests__/DeclaredActionsBar.approverFold-34361.test.tsx packages/app-shell/src/views/__tests__/DeclaredActionsBar.foldOverrides-25877.test.tsx packages/app-shell/src/utils/approvalDecisionFold.test.ts packages/app-shell/src/utils/approvalOverride.test.ts packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx packages/app-shell/src/views/RecordDetailView.approvalRecallGate.test.tsx packages/app-shell/src/views/approval-decision/ apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx"

 Tasks:    68 successful, 68 total
 Test Files  115 passed (115)
      Tests  2059 passed | 13 skipped (2072)
os-verify-lock: VERDICT command-exit 0
Wider app-shell sweep (pre-merge tree, same diff)

pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/__tests__/ packages/app-shell/src/views/RecordDetailView.approval*.test.tsx … packages/app-shell/src/views/approval-decision/ … apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx

 Test Files  110 passed (110)
      Tests  956 passed (956)
os-verify-lock: VERDICT command-exit 0
Type check

pnpm --filter @object-ui/i18n run type-check && pnpm --filter @object-ui/app-shell run type-check (each runs tsc --noEmit and tsc -p tsconfig.test.json, so the new tests are compiled): VERDICT command-exit 0.

Ablation (one, on the variant split)

node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/utils/approvalDecisionFold.ts --anchor "return typeof variant === 'string' && LEAD_VARIANTS.has(variant);" --replacement "return true; // ABLATION-34361" -- …vitest run …approverFold-34361.test.tsx

ablation-replace: ok mutation landed: anchor 1 -> 0, blob 99b38f5e8ec3 -> d6d63595670c
 Tests  6 failed | 6 passed (12)
ablation-replace: ok restored: blob == HEAD (99b38f5e8ec3) and `git diff HEAD` is empty

The six failures are exactly the tests that need a non-lead lever in the menu; the six that stayed green do not depend on the split (unchanged viewers, the two-or-fewer case, drawn-set reports).

Gates

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (changed files lint clean; repo-wide run is CI's)
  • 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 touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX

…approval

Ruling A: the decisions stay buttons, every other lever goes behind one
menu, and a status line names the task, the step and the submitter.
Both call sites (record page, request page) draw the same band.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
…hangeset

The record page's approver tests read the folded levers from the band's
menu; new pins cover the approver, approver+submitter, submitter-only and
override-only viewers, the variant-driven split and the request page.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

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

L1: REWORK
Head-sha: 48d70e2
Card: #34361 (ruling A 6917968848, plan 6936836041) · claim 6937110802 · os-dev-report 6938509737 · execution note 6938618374

The code, tests and the Clause-② widening all hold. The one must-fix is paper only, the same kind as #34624's: one changed file is outside the claim's file surface. No push is needed. Once the seat posts the claim amendment, I post ACCEPT on this same head.

Must-fix (paper only, no code change)

  1. ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx (an existing test, +24/−1) is outside the claim's file surface. Claim 6937110802 covers RecordDetailView.tsx "(call site only)" and "new tests beside them". This is an edit to an existing test file, declared as deviation (2) in the os-dev report. The edit itself is right; see the readings. The seat posts a claim amendment adding the file, and the PR body names it in one line.

Should-fix

None.

Readings that hold

Item Reading
PR shape Draft, base main, Fixes #34361; no other closing verb in the body (#25877, #26053, #34631, #34588 stand verb-free). No !, no (narrowing): no dogfood battery owed.
Scope 19 files; 18 inside the claim surface (DeclaredActionsBar.tsx, utils/approvalDecisionFold.ts (+ test), RecordDetailView.tsx (+8/−1: a comment and the foldDecisions prop, call site only), ApprovalDecisionPanel.tsx (+3: a comment and the prop, call site only), the new __tests__/DeclaredActionsBar.approverFold-34361.test.tsx, 11 locale files, the changeset). RecordApprovalsPanel.tsx, though listed in the claim, is untouched (consistent with keeping reply in the menu).
Clause-② (TIER_DEFAULT, seat routing) Body and changeset match the claim: yes (widening — new @object-ui/i18n en keys only …), Metadata-protocol: none. The published face moves only in @object-ui/i18n: four add-only keys under approvalsInbox (awaitingYourDecision, stepNumber, submittedByName, moreDecisionActions), +4 lines in each of the 10 non-en packs and +7 in en (the 4 keys plus a 3-line comment). Nothing is renamed or removed. foldDecisions is a new optional prop on DeclaredActionsBar, which is exported from @object-ui/app-shell; that package is "private": true, so this is not a published accept set. No spec/schema or governed-rule face is touched, so no further L2 is owed.
Changeset Names @object-ui/app-shell and @object-ui/i18n. Sentences read against the diff:
• "folded for any viewer the server says can act (viewer.can_act === true) once more than two … shown" = isActingApprover (strict === true) plus foldDecisionOthers = … (!everyLeverReported || drawnNames.length > 2).
• "status line names the task, the step's number … its label, and the submitter ('You submitted this' …)" = ApproverTaskStatus: the badge, currentStepNumber(flow_route.steps), step_label, then viewer.is_submitter → submittedByYou, else submitter_name.
• "variant primary or danger stay buttons; phone equal width" = isLeadDecision plus fill (flex-1 sm:flex-none).
• "every other action, including one declared with no variant, goes into one neutral menu" = decisionOthers into the DropdownMenu with an outline trigger and no amber.
• "same band on both pages" = the prop at both call sites.
• "keeps its own gates … same request" = the same DeclaredActionButton (asMenuItem in the menu).
• "Menu actions still count as drawn" = DeclaredActionVisibilityProbe reporting into reportDrawn.
• "Unchanged: submitter-only, override-only admin, no viewer block, hosts without the prop" = the decisionBand guard (foldDecisions && folded.length === 0 && isActingApprover).
All true. @object-ui/console (the shipping package) is not named; its src/** did not move, so it is not required.
Ruling A fidelity Status line with the step (number and label) and the submitter: met. 通过 / 拒绝 as the only buttons: met, read off variant, not names (plan 6936836041 §1). Other levers in one menu, neutral trigger: met. Record header untouched: met (no header hunk). No protocol change: met. 撤回 (recall) for an approver who also submits sits in the menu: inside A's latitude ("left to execution").
reportDrawn change It now records false verdicts as keys so everyLeverReported can be read. drawnNames still filters on drawnByName[name] === true, so the drawn list is unchanged, and foldOverrides reads the same set. The fold-until-all-reported default means a lever that never reports leaves the band folded, which is the safe side.
Existing-test edit (the must-fix file) The three approver pins still assert that reassign / send back / request info are offered and that approval_send_back dispatches on the REQUEST. They now open the band's menu first and assert role="menuitem", so the edit adds assertions without loosening any. Submitter, override and fail-closed cases are untouched.
Docs content/docs/automation/approvals.mdx describes the gates (can_act / is_submitter / can_override) and the actions, not their placement; nothing there is made false. There is no content/docs/frontend page for the bar (declared).
Tests Real commands with output: the closure was built, then 115 files / 2059 tests passed on the head. There are 12 + 7 new pins. One ablation (isLeadDecision → true) turns the 6 split-dependent pins red while the 6 controls stay green, and the file was restored to the HEAD blob.
Tier check-governed-merges --pr 34641: NOT governed, 0 of 19 paths, 826 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.

Notes

  1. Reply (approval_comment) stays in the menu, against ruling A's "approvals panel or discussion". The seat accepted the deviation and recorded it on the card (6938618374). The reasons hold: the bar cannot know whether the panel is on screen, and the panel has no action runtime. Because it departs from the ruling's wording, I'd suggest the seat put it on the maintainer's pending-decision list (with the usual independent review first) rather than leaving it to be discovered. This is not an L1 bar.
  2. Hot file with feat(approvals): the approval request page shows the whole business record #34631 (ApprovalDecisionPanel.tsx): the seat's ruling stands. Whichever lands second re-adds the one foldDecisions prop, and the second one owes a delta read on that line.
  3. Not measured in a real browser: the phone row (two flex-1 decisions plus the trigger) and the desktop line wrapping with long step labels. The landing area may glance at 390 px if it boots the console.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

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

L1: ACCEPT
Head-sha: 48d70e2
Supersedes: REWORK 6938968708 (same head; its one must-fix was paper only)

Delta read

Item Reading
Must-fix 1 (file surface) Closed. Claim amendment 6938979625 on #34361 adds ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx (assertion edits only) and restates the unchanged Clause-② / Metadata-protocol lines. The PR body names the amendment at the top of Acceptance notes. All 19 changed files are now inside the claim surface.
Head Unchanged at 48d70e28: every other reading in 6938968708 stands, including CI (62 check-runs, all success / skipped), Tier S (check-governed-merges: NOT governed, 826 lines), and the Clause-② widening read at TIER_DEFAULT with no further L2 owed.
For landing The body edit re-fires the PR-body guard run, so re-read the check-runs and mergeable_state on this head before pr_ready. Hot file with #34631 (ApprovalDecisionPanel.tsx): whichever lands second re-adds the one foldDecisions prop and owes a delta read on that line.

The notes of 6938968708 stay notes. Reply-in-menu departs from ruling A's wording and is suggested for the maintainer's pending-decision list; that is not an L1 bar. 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-17T05:06Z · area o3-A

Probe Reading
check-governed-merges.mjs --pr 34641 NOT governed · 826 changed lines (+818/−8) ≤ 3000 · Tier S
L1 + checks on head 48d70e286426b0e0c0b7793f6e0b9e32ac60d15d L1-a ACCEPT 6939025987 (delta over REWORK 6938968708, paper only) · Clause-②: yes (en locale keys only) reviewed by L1-a at TIER_DEFAULT per seat routing in claim 6937110802, no further L2 owed · 66 check-runs: 49 success, 17 skipped, 0 failing (guard re-run after the body edit included) · main 4 first-parent commits ahead of base, none touching locales/en.ts, skills/** or this PR's files

State: pr_ready + automerge_enable now; #34361 closes on merge via Fixes. Hot file with #34631 (#34588): it lands second, merges main and re-adds the one foldDecisions prop (delta read on that line by L1-a).

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

Projects

None yet

2 participants