Repository navigation
feat(spec): notices on an action, warnings its dialog draws before submit (#39182) - #39201
Conversation
…submit (#39182) An action that opens a confirm or param dialog can declare `notices`: a map from a snake_case notice name to a notice in `record:alert`'s vocabulary (`severity`, `title`, `body`, `visible`). The severity enum moves to `ui/alert-severity.ts`, one schema mounted by both the record banner and the notice. The condition takes the action's own condition schema and scope. Text is a plain I18nLabel translated at `..._actions.<action>.notices.<notice>.title|body`. - spec: the key and its refusals, the translation slot, the `translateAction` overlay, the liveness row (planned), the docs. - lint: the translation extractor's slots, the dangling-notice leg, the condition check as a served-row site. - ui core: `notices` in the spec action key list. Ruling A on #39045 (comment 7359751238). Claude-Session: https://claude.ai/code/session_01Utp6Cb58xg59SdrVcwv1bK Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e46f79f8756199d15acd60fba14cf88426c0f62a && git checkout e46f79f8756199d15acd60fba14cf88426c0f62a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f1df7a8f4c408734a4a77e6fb83a92b6f286177c 29c02ea9106f6b93f4945d2e412886b18e4ebfd7 && git checkout -B drift-repro f1df7a8f4c408734a4a77e6fb83a92b6f286177c && git merge --no-ff 29c02ea9106f6b93f4945d2e412886b18e4ebfd7
node scripts/docs-audit/affected-docs.mjs --json f1df7a8f4c408734a4a77e6fb83a92b6f286177c
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd Contract reviewServed-tier: PR #39201 (draft), one commit on ① Derived judgmentsAgainst the ruled terms of 7359751238:
② Semver level
③ Boundary flags
④ Design judgmentPer
Implementing files: the three lint legs and the ledgers agree with the contract they enforce. Findings:
Accepted deviations: N2, N4. Carried to a follow-up or the console half: N1, N3, N5. Open: S1. Implemented-by: VERDICT: PASS |
…39182) Contract review S1 on the action `notices` key: the served object schema's field mask read every non-prose key of an action, so a notice `body` that mentions a denied field's name (an invite notice saying "email" on an object whose `email` the caller cannot read) removed the whole action, against the key's display-only contract. `notices` now has its own read: `title` / `body` are prose, `severity` is vocabulary, and only `visible` (or an unclassified key) is read against the object. `ACTION_NOTICE_POSITIONS` is pinned closed against the spec's notice schema. The global PROSE_KEYS is left alone: an action's top-level `body` is its script body. Also, from the review's nits: - `translateAction` overlays only the leaves a notice authors, and `os validate` reports a translated leaf the notice does not write. - `label` renames to `title` on a notice, as in the translation entry. - The banner-key refusal test checks each key's own sentence. Claude-Session: https://claude.ai/code/session_01Utp6Cb58xg59SdrVcwv1bK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd Contract reviewServed-tier: ① Derived judgmentsThis is a delta of contract review 7362137624 (head 18cddaf, PASS with should-fix S1 open). Read: Findings of 7362137624, by id:
No new finding in the delta. ② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd 维护者速读
席位核对ACCEPT · head
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd 维护者速读
Review requested · 2026-12-03T00:56Z · on the maintainer's choice on the seat's decision card (2026-12-03T00:56Z, 「先给 os-zhuang 审批」): |
Requested by Bill · project thread
Fixes #39182
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #39203
维护者速读
notices(具名映射),在确认框或参数框里、条件成立时显示提示;字段沿用record:alert的 severity/title/body/visible,severity 与横幅共用同一个枚举。RecordAlertProps.severity换成共享枚举,取值不变。What changes
ActionSchema.noticesis a map from a snake_case notice name to a notice the dialog an action opens before it runs (its param dialog, or the confirm dialog ofconfirmText) draws above its description, each while its condition holds. Ruling A on #39045 (comment 7359751238): a general action-dialog notice key inrecord:alert's vocabulary. The seat accepted the named map in the card thread: ruling term 1 leaves one-or-several to this card, as long as each notice has a stable translation key.packages/spec/src/ui/alert-severity.tsholdsAlertSeveritySchema(info | warning | error | success).RecordAlertProps.severityand the notice'sseveritymount the same schema object. The edit tocomponent.zod.tsis the import plus that one line (the file is shared with Tidy leftovers after the form-viewsubformsretirement (#38140): step-18 entry, stale comments, lookup-child prescription #39067).packages/spec/src/ui/action-notices.ts):{ severity?, title?, body?, visible? }, strict.title/bodyare I18nLabels (a non-blank string or an inline locale map), at least one required (requiredOneOf, a projectable refinement).visibleis the action's ownActionConditionInputSchema, passed into the factory so the three predicates share one source and one scope (record, user,features; no new root, no dialog values).icon,action,dismissibleanddismissKeyfrom the banner are refused with guidance;message/text/description→body,visibleWhen/visibility/showWhen→visible,level→severity.confirmTextnor non-emptyparamsthe key is refused at parse, the same rule ascancelText.alerts/warningson an action rename tonotices.actionTranslationSchema.notices.<notice>.{title, body}at both addresses;translateActionoverlays leaf by leaf, only for declared notices (system/i18n-action-notices.ts), and returns the same reference when nothing changes.lint/src/i18n-walk-action-notices.ts);validate-translation-referencesreports a translated notice the action does not declare (translation-target-unknown);validate-expressionschecks each notice'svisiblelike the action'svisible, as the served-row siteaction notice visible.metadata-core/src/object-schema-fls-references.tsgives an action'snoticesits own read:title/bodyare prose andseverityis vocabulary, so a notice sentence that mentions a denied field does not remove the action from a field-masked caller's served schema; only a notice'svisible(or an unclassified key) is read, and a hit removes the action as any other predicate does.ACTION_NOTICE_POSITIONSis pinned closed against the spec's notice schema.PROSE_KEYSis untouched (an action's top-levelbodyis its script).label→titleon a notice as on the translation entry (N3).action.notices(planned,authorWarn, children drilled); expression-conformance rowcel-action-notice-visible(experimental / unevaluated); evaluated-slot population 33 → 34; metadata-form reconciliation omit row; meta-types action key count 55 → 56;@object-ui/coreSPEC_ACTION_KEYS.content/docs/protocol/objectui/actions.mdx: the property line and a "Warning before submit:notices" section with a planned callout. Generated references regenerated.New modules are named without
.zod.tsso the skill reference index (skills/**, governed) does not move.Tests
packages/spec/src/ui/action-notices.test.ts(24): parse on both hosts, every severity, locale maps, every condition form and its normalization; refusals for an unknown severity, a non-string label, a blank, neither title nor body, a non-snake_case name, a no-dialog host, the banner keys; aliases; the one-source pin (RecordAlertProps.severityand the notice's severity are the sameAlertSeveritySchema); the translation slot and the overlay.packages/lint:validate-translation-references.test.ts(anotices.<notice>describe and a coverage row with a ghost leg at both addresses),validate-expressions.test.ts(bare-field noticevisibleis an error; record/features forms pass; the receiver key list),i18n-walk.test.ts(extractor slots).packages/metadata-core/src/object-schema-fls-references.test.ts: a notice body/title naming a denied field keeps the action, avisiblereading it (bare or envelope) or an unclassified key drops it; the notice-key classification pin. Ablation: with thenoticesread removed, the first test fails.Acceptance notes
action-notices.test.ts"the refusals".recordscope; nothing reads it at run time.planned), docs entry: all present.noticeskey (dialog notice before submit) in objectstack-ui and objectstack-i18n #39203).Verification
vitest: specsrc/ui src/system/translation src/system/i18n+ evaluated-slot + metadata-form reconciliation (8099 passed); lint translation-references, expressions, i18n-walk; metadata-protocol degenerate-derivation; qa dogfoodexpression-conformance.test.ts; ui coreactionKeys.pin.test.ts.pnpm --filter @objectstack/spec typecheck,pnpm --filter @objectstack/lint typecheck: green.dispatch-gates.mjs --commands: 105 non-self-test commands run; 101 green on the first pass.check:skill-examples,check:i18n-walk-parityandcheck:dts-closurestopped on an unbuilt prerequisite and went green after building their closures;check:page-declaration-shapelost a temp file to a concurrent run and went green alone. Not cleared here:check:dual-build-cjs-loads(exit 3, needs every package built) andpnpm --dir ui exec vitest run scripts/(unit-registry-absence-collisioncannot import 59 unbuilt ui workspace modules in this container); CI runs both on a built tree.check-nul-bytes: clean.overlap-check.mjs --base=origin/main --pr=39184: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6Cb58xg59SdrVcwv1bK