Skip to content

feat(showcase): stamp real submitters on the seeded approval requests#3411

Merged
os-zhuang merged 1 commit into
mainfrom
feat/showcase-approval-submitters
Jul 22, 2026
Merged

feat(showcase): stamp real submitters on the seeded approval requests#3411
os-zhuang merged 1 commit into
mainfrom
feat/showcase-approval-submitters

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

The gap

Every seeded approval request had a null submitter: the demo launches flows as SYS, and the approval node stamps the requester from the flow context (submitterId: context?.userId ?? null). Three consequences, all invisible until you look:

  • 申请人 rendered as on every row and in the drawer;
  • the 我发起的 inbox tab was empty for every user — the whole surface was dead;
  • the submitter-only affordances never rendered anywhere. Send reminder and Recall are gated on submitter_id == ctx.user.id, so with no submitter only 5 of the 7 declared approval actions could ever appear.

The fix

Pass userId on the engine context, routed deliberately:

Request Submitter Why
Invoice Dual Sign-off admin the logged-in dev admin owns one request → 我发起的 is non-empty and the submitter-only actions have somewhere to render
Committee Quorum · Expense Sign-off Mei Phone (demo) holds no approval position → a clean requester who is never one of her own approvers

Verified in the running console

申请人 now shows real names; 我发起的 holds the admin's request; and the same viewer sees

  • on Mei's requests → Approve Reject Reassign Send back Request info
  • on his own request → those plus Send reminder and Recall

so all 7 declared actions render, gated by the viewer's role. tsc --noEmit ✓, boot log 0 ERROR.

Follow-up to #3409, from the #3358 §1 evidence pass. Private example → no changeset.

🤖 Generated with Claude Code

Every seeded request had a null submitter, because the demo launches flows as
SYS and the approval node stamps the requester from the flow context
(`submitterId: context?.userId ?? null`, approval-node.ts). Consequences, all
invisible until you go looking:

  * 申请人 rendered as `—` on every row and in the drawer;
  * the "我发起的" inbox tab was empty for every user, so that whole surface
    was dead; and
  * the submitter-only affordances never rendered anywhere — `Send reminder`
    and `Recall` are gated on `submitter_id == ctx.user.id`, so with no
    submitter they were unreachable and only 5 of the 7 declared approval
    actions could ever appear.

Pass `userId` on the engine context and route it deliberately:

  * Invoice Dual Sign-off → submitted by the **admin**, so the logged-in dev
    admin owns one request and "我发起的" is non-empty with the submitter-only
    actions visible;
  * Committee Quorum and Expense Sign-off → submitted by **Mei Phone (demo)**,
    who holds no approval position and is therefore a clean requester who is
    never one of her own approvers.

Verified in the running console: 申请人 now shows real names, "我发起的" holds
the admin's request, and the same viewer sees `Approve / Reject / Reassign /
Send back / Request info` on Mei's requests but those **plus** `Send reminder`
and `Recall` on his own — i.e. all 7 declared actions render, gated by role.
`tsc --noEmit` passes; boot log stays at 0 ERROR.

From the #3358 §1 evidence pass; follow-up to #3409.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 22, 2026
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jul 22, 2026 8:25pm

Request Review

@os-zhuang
os-zhuang merged commit 8ee8c52 into main Jul 22, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the feat/showcase-approval-submitters branch July 22, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant