Refactor interaction handler into command modules#248
Conversation
|
There was a problem hiding this comment.
💡 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".
| const snapshot = await captureSnapshotForSession( | ||
| session, | ||
| req.flags, | ||
| sessionStore, | ||
| contextFromFlags, | ||
| { interactiveOnly: false }, | ||
| dispatch, | ||
| ); |
There was a problem hiding this comment.
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 👍 / 👎.
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.
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.
Summary
Split the interaction handler into per-command modules plus focused shared targeting, snapshot, flag, and selector helpers.
Reduce
interaction.tsto 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