Skip to content

fix(app-shell): tell an approver who may read none of the submitted fields, instead of an empty pane - #39479

Draft
objectstack-fleet[bot] wants to merge 8 commits into
mainfrom
claude/issue-39406-wip
Draft

objectstack-fleet[bot] wants to merge 8 commits into
mainfrom
claude/issue-39406-wip

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Part of #39406. This PR carries the decision-time half (the request page says the reader has no field access instead of rendering empty). The design-time half (a save-time warning naming the approver without read) is not in it: its premise did not hold where the card placed it, and it waits on a decision the report on the card spells out.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 审批人打开一张自己没有对象读权限的审批单时,「提交时的内容」区域不再是一片空白,而是写明「你没有查看此对象字段的权限,请联系管理员」;有权限的人看到的页面不变。
  • 属于审批流程体验;替新公司上线审批时遇到「经理打开审批单什么也看不到」的管理员和审批人解决。
  • 只影响读不到任何字段的审批人看到的提示,不放宽任何数据权限;出问题可直接撤回本改动,页面回到原来的空白状态。
  • 要你做一件事:裁定设计期告警(保存审批流时提示审批人无读权限)放在哪一层,选项见卡片上的报告。

What changes

  • SubmittedRecord.tsx: the submitted-record card draws a notice, "You don't have access to this object's fields; ask an administrator.", where it used to draw nothing. Two answers trigger it, and nothing else does:
    • the object's definition is withheld from the reader (the schema read answers as for a name that names no object, ADR-0106 posture hidden) while the reader's permissions deny reading the object;
    • the definition answered, neither row narrowed for the reader holds a declared non-bookkeeping field, and a denial emptied it: the reader's field permissions withheld a snapshot key, or the served definition declares no field at all (ADR-0106 D1 removes every unreadable field from the served definition).
  • A snapshot that only holds keys the object does not declare is not an access gap and still draws nothing (the existing CONTROL in ApprovalDecisionPanel.decidedSnapshot-27502.test.tsx pins it, and this PR's first version broke it; the denial condition above is the fix).
  • The redaction is unchanged: the notice draws no value and no field name, and a withheld definition's machine name is not shown in place of its label.
  • New locale key approvalsInbox.snapshotNoFieldAccess in en and zh-Hans.

Tests

  • New pin ApprovalDecisionPanel.noReadableFields-39406.test.tsx: three ways the reader sees none of the fields (object withheld; object readable, no field; snapshot served whole, every field denied client-side), each asserting the notice text and that no submitted value or field label reaches the page; two controls (an absent definition the reader may read claims no gap; one readable field draws the card and no notice).

Acceptance notes

  • Known red, named gap: all-locales-key-parity.test.ts. The new key is in en and zh-Hans only, so the nine other packs (ar, de, es, fr, ja, ko, pt-BR, ru, zh-Hant) each miss one key. The claim's file surface names en and zh-Hans only and says to stop on a breach, so the other nine packs are not edited here; adding them is a one-line, new-key-only edit per pack, waiting on the seat's word.
  • Design-time half, not delivered. The claim's mechanism assumption was that the read check sits beside the missing-manager advisory in validate-approval-approvers.ts, with permission data in reach. Measured: permission SETS are in reach there (stack.permissions, also carried at the save door), but which sets an approver holds is not. For user, manager, team, department, queue, field and expression approvers it is runtime data (user-to-set and user-to-position assignments, sys_user.manager_id), which no lint rule can read. For position it is the position's own permissionSets metadata, which the CLI stack carries but the runtime save door does not (RuntimeStackContext carries objects, permissions, books, datasets and flows, no positions). So the card's own example, a manager approver, cannot be judged at design time anywhere a lint rule runs, and a save from Studio cannot judge a position either without widening the gate's context. The options are on the card.
  • Observation, not filed: ApprovalDecisionPanel.fullRecord-34588.test.tsx acceptance 1 failed once in a directory run on a loaded shared box (the child rows did not arrive inside the 1000 ms waitFor) and passed alone on both the base and this head. The child table loads @object-ui/plugin-detail lazily inside that window; check:test-source-alias only judges test files a change adds or edits, so it does not ask that file to pay the load at collection.

Verification

Read first, by risk:

  1. SubmittedRecord.tsx, the noFieldAccess derivation in useSubmittedRecord (when the notice claims an access gap).
  2. SubmittedRecord.tsx, the SubmittedRecordCard early return and the notice block.
  3. The new pin's controls.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/approval-decision/ApprovalDecisionPanel.noReadableFields-39406.test.tsx from the repo root; expect 5 passed. Against the base component the three notice cases fail and the two controls pass.

Local readings, head 9e96ba5
  • New pin on the base component (red reproduction of the empty pane): Tests 3 failed | 2 passed (5), the three notice cases failing.
  • New pin plus the 27502 suite on head: Tests 9 passed (9).
  • approval-decision/ directory on head: Tests 1 failed | 107 passed (108), the one failure being the 34588 timing note above; that file alone: Tests 12 passed (12) on head and on base.
  • pnpm --filter @object-ui/app-shell run type-check (both tsconfig.json and tsconfig.test.json): exit 0, 0 errors.
  • Design-time absence, reproduced with the validator itself on a stack whose approval steps are a manager and a position with no read on the object: 2 findings, both approval-approvers-may-resolve-empty, none about read, with and without atSaveDoor.
  • Derived gate families: 39 derived, 36 run with exit 0, 3 NOT MEASURED (check-comment-mask-corpus, check:query-options-erasure timed out at 300 s on a shared box at load 6 to 9; vitest run scripts/ under ui/ not run), dispatch-gates --ran exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV

…d fields

The approval request page drew nothing in the submitted record's place when
the reader could read none of its fields: the object's definition is
withheld from a reader without object read, and the snapshot is redacted to
nothing. The card now draws "You don't have access to this object's fields;
ask an administrator." in that case. The redaction is unchanged.

Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bbc64113715561ef2f58039eae435ccd06e963bb → packageMentionDocs.

This branch has not been deployed

No deployments
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

Development

Successfully merging this pull request may close these issues.

2 participants