Skip to content

Refactor interaction handler into command modules#248

Merged
thymikee merged 2 commits into
mainfrom
codex/interaction-handler-split
Mar 22, 2026
Merged

Refactor interaction handler into command modules#248
thymikee merged 2 commits into
mainfrom
codex/interaction-handler-split

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Mar 22, 2026

Summary

Split the interaction handler into per-command modules plus focused shared targeting, snapshot, flag, and selector helpers.
Reduce interaction.ts to a thin router so the interaction command family is easier to explore and maintain from scratch.
Touched files: 11 in src/daemon/handlers. Scope stayed within the interaction command family.

Validation

pnpm format
pnpm typecheck
pnpm test:unit
pnpm test:smoke

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 22, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-248/

Built to branch gh-pages at 2026-03-22 18:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf400d1ff2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/daemon/handlers/interaction-is.ts Outdated
Comment on lines +69 to +76
const snapshot = await captureSnapshotForSession(
session,
req.flags,
sessionStore,
contextFromFlags,
{ interactiveOnly: false },
dispatch,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid capturing snapshot twice for non-exists is checks

The unconditional captureSnapshotForSession(...) call here runs even when predicate !== 'exists', and those paths then call resolveSelectorTarget(...), which captures another snapshot internally (interaction-selector.ts). This doubles snapshot work for is visible|hidden|editable|selected|text, adding avoidable latency and creating race-prone behavior when UI state changes between the two captures; before this refactor these predicates resolved against a single snapshot.

Useful? React with 👍 / 👎.

@thymikee thymikee merged commit 37b82ab into main Mar 22, 2026
7 checks passed
@thymikee thymikee deleted the codex/interaction-handler-split branch March 22, 2026 18:55
ken0nek added a commit to ken0nek/agent-device that referenced this pull request Mar 25, 2026
PR callstack#248 refactored interaction.ts into a thin routing layer delegating
to focused command modules. PR callstack#245 (gesture telemetry overlays)
unintentionally reverted get/is/scrollintoview back to inline
implementations due to a stale branch.

This restores the thin router from callstack#248, adapted for callstack#245's
handleTouchInteractionCommands, and removes interaction-press.ts and
interaction-fill.ts which were made dead code by callstack#245's
interaction-touch.ts.
thymikee pushed a commit that referenced this pull request Mar 25, 2026
PR #248 refactored interaction.ts into a thin routing layer delegating
to focused command modules. PR #245 (gesture telemetry overlays)
unintentionally reverted get/is/scrollintoview back to inline
implementations due to a stale branch.

This restores the thin router from #248, adapted for #245's
handleTouchInteractionCommands, and removes interaction-press.ts and
interaction-fill.ts which were made dead code by #245's
interaction-touch.ts.
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.

1 participant