Skip to content

feat(automated-response): press enter to navigate keyword inputs - #907

Merged
sung17 merged 1 commit into
mainfrom
feat/automated-response-keyword-enter-navigation
Aug 6, 2026
Merged

feat(automated-response): press enter to navigate keyword inputs#907
sung17 merged 1 commit into
mainfrom
feat/automated-response-keyword-enter-navigation

Conversation

@sung17

@sung17 sung17 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pressing Enter inside a keyword input in the create/edit automated response forms no longer submits the form.
  • On the last keyword input, Enter appends a new keyword row (like clicking "Add more") and focuses it; on any other input, Enter focuses the next keyword input.
  • IME composition Enter events (CJK input confirmation) are ignored so composing text isn't interrupted.

Changes

  • apps/builder/src/features/automated-response/hooks/use-keyword-field-navigation.ts (new): shared useKeywordFieldNavigation hook using form.setFocus for navigation.
  • apps/builder/src/features/automated-response/create-automated-response-form.tsx: wire keyword inputs to the new hook via onKeyDown.
  • apps/builder/src/features/automated-response/edit-automated-response-form.tsx: same wiring for the edit form.

Test plan

  • pnpm lint
  • pnpm --filter builder check-types
  • manual verification: create/edit automated response, press Enter on last keyword (adds row + focuses it), press Enter on a middle keyword (focuses next), press Enter mid IME composition (does not submit/append)

Prevent form submit when pressing Enter in a keyword field; instead
append a new keyword row on the last input or focus the next input.
Shared via useKeywordFieldNavigation hook, using form.setFocus and
skipping IME composition events.
@github-actions github-actions Bot added the feature New feature or request label Aug 6, 2026
@sung17
sung17 merged commit 3b14f40 into main Aug 6, 2026
7 checks passed
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
Prevent form submit when pressing Enter in a keyword field; instead
append a new keyword row on the last input or focus the next input.
Shared via useKeywordFieldNavigation hook, using form.setFocus and
skipping IME composition events.

Co-authored-by: Deathgiver <anonymous@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant