Skip to content

feat(contracts): one-tap ACCEPT/REJECT/FULFILL contract actions (#73)#74

Open
Zillatron27 wants to merge 3 commits into
mainfrom
feat/contract-actions
Open

feat(contracts): one-tap ACCEPT/REJECT/FULFILL contract actions (#73)#74
Zillatron27 wants to merge 3 commits into
mainfrom
feat/contract-actions

Conversation

@Zillatron27

Copy link
Copy Markdown
Owner

Summary

The centerpiece of the action-passthrough wave: the contract sheet's deliberately-withheld actions ship, done inside APXM with no switch to APEX per the #25 direction ruling. Your tap is the commit — one tap, one action, nothing unattended. Three commits:

1. refactor(act): extract the action-feedback observer. waitActionFeedback/waitConfirmationResolved/waitActionProgress move from the step machine to lib/act/action-feedback.ts so one implementation serves the ACT engine and one-shot actions. New optional onManualConfirm(pending) callback fires around the manual-confirm window (balanced even on cancel/overlay removal) — the visibility signal the next commit consumes, and the one the future ACT views (#25 Phase D) will reuse. Step-machine behaviour unchanged; existing gate tests pass untouched.

2. feat(shell): manual-confirm visibility mode. Design-phase discovery: with autoConfirm off, APEX's confirmation dialog was un-hidden underneath the opaque APXM shadow host — physically untappable. Now gameState.actConfirmPending hides the shell via CSS (stays mounted), shows a slim ConfirmBar ("Confirm or cancel in APEX below"), and :host(.act-confirm) drops only the host background — never the height, which APEX's layout listeners read as navigation mid-drive (CLAUDE.md gotcha). Base pointer-events: none passes taps through to APEX's dialog. No APXM-side cancel button (deviation from the plan sketch): APEX's own dialog is fully visible/tappable and the observer already handles both exits.

3. feat(contracts): the actions. runContractAction(localId, target): open CONT <localId> off-screen → click APEX's button (case-insensitive text match — visible case is CSS text-transform) → observe feedback → always restore APEX. ACCEPT/REJECT render when acceptance === 'awaiting-mine'; FULFILL per available condition, addressed by ordinal among available conditions (APEX renders one button per fulfillable row; raw indexes would misalign past fulfilled/partner rows). One action in flight at a time; APEX's error text surfaces inline; success needs no refresh (the CONTRACTS_CONTRACT delta updates the store).

Known device-discovery items (#73)

Nobody drives the CONT buffer — not rPrun, not the fork — so these need the dev-build session before release:

  • Actual button labels (accept/reject assumed; fulfill candidates: fulfill/pay/provide).
  • Whether contract actions pop the confirmation overlay at all (the mechanism handles both).
  • ConfirmBar placement vs APEX's dialog (top chosen; swap to bottom if it covers).
  • Verify APEX's stack does NOT navigate when act-confirm toggles.

Testing

  • 596 tests pass (+16 on this branch): action-feedback signal window semantics (fires/never-fires/balanced-on-cancel), gameState flag, matcher (case-insensitivity, fulfill ordinal, synonyms), runner (success/error/missing-button/confirm-window/in-flight guard/open-failure — buffer always restored).
  • Mutation-verified: removing the in-flight guard fails its test; dropping case-folding fails 7.
  • npx tsc --noEmit clean; Chrome + Firefox builds green.

Closes #73. Part of #25's direction; the ACT views inherit onManualConfirm + act-confirm + ConfirmBar wholesale.

🤖 Generated with Claude Code

Zillatron27 and others added 3 commits July 6, 2026 21:10
…ignal

waitActionFeedback / waitConfirmationResolved / waitActionProgress move
from the step machine into lib/act/action-feedback.ts so one
implementation serves both the ACT engine and one-shot passthrough
actions (contract ACCEPT/REJECT, #73). New optional onManualConfirm
callback fires true entering the manual-confirm window and false when it
resolves (balanced even on cancel/overlay removal) — the visibility
signal callers need because the APXM shadow host is an opaque cover and
the engine's own #container un-hide alone leaves APEX's dialog buried
underneath it.

Behaviour unchanged for the step machine; existing gate tests pass
untouched. New action-feedback suite pins the signal's window semantics.

Part of #73.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When a driven action hits APEX's confirmation dialog with autoConfirm
off, the dialog was un-hidden UNDERNEATH the opaque APXM shadow host —
physically untappable. New gameState.actConfirmPending: AppShell hides
the shell via CSS (stays mounted so the in-flight action survives) and
shows a slim ConfirmBar; :host(.act-confirm) drops only the host
background — never the height, which APEX's layout listeners would read
as navigation mid-drive. Base pointer-events:none passes taps through to
APEX's dialog; the user confirms or cancels there, keeping the commit
theirs.

No APXM-side cancel button: APEX's own dialog is fully visible and
tappable, and the feedback observer already handles both of its exits.

Part of #73; the future ACT views (#25 Phase D) reuse this mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rough

The contract sheet's withheld actions ship: ACCEPT/REJECT when the
contract awaits your acceptance, FULFILL per available condition. The
tap is the commit — runContractAction() opens CONT <localId> off-screen
via the mobile buffer navigator, clicks APEX's own button (matched
case-insensitively; visible case is CSS text-transform), observes the
feedback overlay through the extracted action-feedback observer, and
always restores APEX. One action in flight at a time; errors surface
inline with APEX's own message text.

Fulfill buttons are addressed by ordinal among AVAILABLE conditions —
APEX renders one button per fulfillable row, so raw condition indexes
would misalign past fulfilled/partner rows. The fulfill label set is the
device-discovery surface (no one documents the CONT buffer's DOM);
condition types that open forms report "may need APEX" instead of
growing dead buttons.

Closes #73.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
apxm 65e62f1 Jul 06 2026, 11:17 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract actions: one-tap ACCEPT / REJECT / FULFILL from the contract sheet

1 participant