Skip to content

test(components): pin a declared danger action on action:bar to the app-todo shape - #27300

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-ozc80c
Oct 28, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-ozc80c

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #26781

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:只新增一个测试文件,用 app-todo 的 delete_completed(危险操作)原样形状驱动 action:bar,钉住按钮画成红色(destructive)、确认框按钮也是红色。
  • 为什么改:代码修复已随 feat(spec)!: the action blocks spell the destructive variant danger, the word ActionSchema.variant uses #26966 合入,但没有任何测试经过 action:bar 走这条路径,卡要求「在 app-todo 形状上钉住」。
  • 风险与回滚:零运行时风险,只加测试;回滚即删这一个文件。
  • 先看:ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx(三个用例:危险按钮样式、对照按钮、确认框选项)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx,预期 3 passed。
  • 需要你做的:无,席位落地。

What changes

One new test file, action-bar-danger-variant-26781.test.tsx, under ui/packages/components/src/renderers/action/__tests__/. No source change.

It renders an action:bar shaped like the list page's toolbar (objectViewHeaderToolbar.ts: location: 'list_toolbar', size: 'sm', variant: 'outline') carrying two actions copied key for key from examples/app-todo (DeleteCompletedAction and ExportToCsvAction, ai block included), and asserts:

  1. the delete_completed member (variant: 'danger') draws with the Button primitive's destructive style (bg-destructive, not the bar's outline);
  2. CONTROL: export_csv in the same bar declares no variant and draws the bar's outline;
  3. clicking delete_completed asks its confirmText through the confirm handler with { title, confirmText: label, destructive: true }, and the script handler is not run on a cancel.

Why

The code path landed with #26966 (toButtonVariant maps danger to the primitive's destructive; toRunnerVariant forwards danger to the runner, whose confirm paints destructive). The existing danger pins (action-variant-confirm-26665.test.tsx) drive action:button / icon / group / menu directly; nothing drove a declared danger action through action:bar, which is where a list toolbar action reaches the screen. The card's Wanted asks for that pin on the app-todo shape.

Tests

  • New file: 3 passed (vitest, dom project), run from the ui/ root.
  • Ablation A (one-shot, restored): toButtonVariant case 'danger' returns default ⇒ test 1 red (expected '…' to contain 'bg-destructive'), 2 passed; restore verified (blob equal to HEAD, git diff HEAD empty).
  • Ablation B (one-shot, restored): toRunnerVariant drops its danger case ⇒ test 3 red (options lose destructive), 2 passed; restore verified the same way.
  • pnpm --filter @object-ui/components run type-check exit 0 (its tsconfig.test.json includes src/**/*.test.tsx).

Acceptance notes

  • The confirm is read from the confirm handler's call, the input the host's ActionConfirmDialog (@object-ui/app-shell) draws from. @object-ui/components cannot import app-shell, so the dialog's own button class is not rendered here; this is the same layer the 26665 pins read.

Verification

Derived gates — 24 derived, 24 run, all exit 0, on head 0d2d769

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 24 commands; each was run with its exit captured before any pipe; --ran reconciliation: "24 derived famil(ies) accounted for — 24 run, 0 NOT-MEASURED". --tier: no path-derived mandate; changed lines 143, under the 3000 threshold. Extra: eslint on the file exit 0; pnpm --dir ui run check:new-line-citations reports 0 new citations.

Tests only, nothing a released package ships: skip-changeset.


Generated by Claude Code

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-warren · session_01JQwxbZeBv2y91towxasSUT

席位核对

ACCEPT · seat domain:ui#1 · head 0d2d7695 · 2026-10-28T15:49Z

席位意见:只新增一个测试文件,把 app-todo 的 delete_completed(variant: 'danger')原样放进列表工具栏形状的 action:bar,钉住成员按钮画成 destructive、确认框带 destructive: true,同栏的 export_csv 作对照仍画栏的 outline。代码修复已随 #26966 合入,本卡只缺这个钉子。符合 #26781 的 Wanted 和派发单 6472285833 的范围。

  1. Shape: Fixes #26781; 1 file, +143/−0, ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx. No source change. skip-changeset (tests only).
  2. Premise measured: both fixtures match examples/app-todo/src/actions/task.actions.ts key for key (delete_completed :134, export_csv :159, ai blocks included), read by the seat on origin/main. The bar copies objectViewHeaderToolbar.ts's list toolbar (list_toolbar, sm, outline), so the bar's own variant is in play and the control separates "member draws its own variant" from "every member draws destructive".
  3. Gates / check-runs: PR check-runs on 0d2d7695: 44 success, 16 skipped, 0 failure; mergeable_state clean. Dev's local run: 24/24 derived gates exit 0 (--ran reconciled), @object-ui/components type-check exit 0, eslint on the file exit 0. Ablation A (toButtonVariant('danger') → default) reds test 1; ablation B (drop toRunnerVariant's danger case) reds test 3; both restored to the HEAD blob.
  4. Accepted deviations: the single commit is titled wip (pushed before the build, no force-push); the squash merge takes the PR title, so main does not carry it. The dev's report opens with the post-stamped signature line ahead of os-dev-report, which .claude/agents/os-dev.md does not yet describe; the dev named the conflict, and the line is required since pm(post-stamped): every seat post opens with a signature line LANE#N · ACCOUNT · SESSION, refused without one; the recognisers skip it #27263.
  5. Out of scope: the host dialog's own button class (ActionConfirmDialog in @object-ui/app-shell) is not rendered here, since components cannot import app-shell; the confirm is read from the handler's options, the same layer the 26665 pins read. Skills-docs: none — tests only.
  6. Landing: not Tier H; the seat readies and arms auto-merge.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 28, 2026 15:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit d4427ae Oct 28, 2026
61 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ozc80c branch October 28, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

2 participants