Skip to content

fix(ssh): keep the IME confirmation Enter from submitting the port-forward dialog - #34315

Merged
nwparker merged 1 commit into
mainfrom
fix/ssh-port-forward-ime-enter-34124
Oct 27, 2026
Merged

nwparker merged 1 commit into
mainfrom
fix/ssh-port-forward-ime-enter-34124

Conversation

@nwparker

@nwparker nwparker commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​65 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​65
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

When you type Japanese, Chinese or Korean, you press Enter to confirm the word you are typing. In the SSH "Forward a port" dialog, that Enter also submitted the form, so the forward was created before you had finished typing. Now that Enter only confirms the word.

What Changed

The four text fields in the port-forward dialog (Remote Port, Local Port, Remote Host, Label) now use the existing ImeInput field instead of a plain <input>. ImeInput already owns the IME confirmation Enter everywhere else in the app, so the Enter that confirms a candidate no longer reaches the form. A second, normal Enter still submits.

On main, this dialog was the only <form> in the renderer with plain text inputs, so this closes the gap for the whole class.

This is @seijikohara's fix from #34126, cherry-picked with their authorship kept. This PR supersedes #34126. Thank you @seijikohara for the report and the fix.

Why

Reusing ImeInput keeps one IME policy across all text fields instead of adding a dialog-specific keydown guard.

Linked Issue

Fixes #34124

Visual Proof

N/A: IME composition can't be driven in a hidden test window. The new test reproduces the composition, confirmation Enter and implicit submit sequence instead.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • ssh-port-forward-dialog.ime-enter.test.tsx fails 4/4 with main's dialog and passes 4/4 with the fix.

  • pnpm tc:web, oxlint, and pnpm check:changed (21 checks) pass on the exact head.

  • Local run of the PR static job: everything passes except the Node 18 process-host smoke (no local Node 18; this change doesn't touch process-host). The orcad terminal smoke is skipped for this diff.

Review

Reviewed with Codex: no findings.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only. Works the same on macOS, Linux and Windows, and for SSH and paired hosts (the dialog is client-side). Mobile has no port-forward dialog. No wire or compatibility changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…rward dialog

The SSH port-forward dialog renders its four fields as raw inputs inside a
form with a submit button. IMEs that redispatch an unmarked Enter after
compositionend therefore trigger implicit submission with the half-typed
value. The pre-revert ImeEnterGuardedForm covered this form; #25480 moved
the guard into shared fields but did not reach these raw inputs, and the
#28609 lint rule only inspects Enter handlers, which these fields lack.

Render the fields with ImeInput so the shared gesture tracker swallows the
confirmation and its redispatch while ordinary Enter still submits.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d5b567a-9811-4f76-812a-bd70d0ec86ed
Commits

Reviewing files that changed from the base of the PR and between 4c66f91 and 7482fca.

Files selected for processing: 2
  • src/renderer/src/components/right-sidebar/ssh-port-forward-dialog.ime-enter.test.tsx
  • src/renderer/src/components/right-sidebar/ssh-port-forward-dialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The four text fields in the SSH port-forward dialog now use ImeInput instead of native inputs. Tests cover IME confirmation in each field and verify that a later Enter submits the form once with the expected field value.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 7482f

No actionable merge-blocking risk is identified; the change is ready to merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the fix and its target: the IME confirmation Enter should not submit the SSH port-forward dialog. The title matches the main change in the summary, the ImeInput swap in the four dialog…
Description check Passed The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #34124), Visual Proof (N/A with a reason), Testing, AI Disclosure, Review, Agent skill …
Linked Issues check Passed Issue #34124 requires IME confirmation Enter to leave the dialog open in all four fields, preserve confirmed text, and allow a later deliberate Enter to submit once. The supplied change summary report…
Out of Scope Changes check Passed The reported changes are limited to the four port-forward dialog inputs and focused IME behavior tests. The production change preserves existing field props and styling. The tests directly verify issu…
Full details: Title check

Explanation

The title names the fix and its target: the IME confirmation Enter should not submit the SSH port-forward dialog. The title matches the main change in the summary, the ImeInput swap in the four dialog fields, and the linked issue. It is a single sentence and specific enough for a teammate scanning history. It is slightly long at 81 characters, but it is within a reasonable range.

Full details: Description check

Explanation

The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #34124), Visual Proof (N/A with a reason), Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. The Testing section explains the automated test results. The manual testing box is unchecked, and the AI Disclosure section is empty. The Why section is brief but gives the reason for reusing ImeInput. Several sections are partly filled, but the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #34124 requires IME confirmation Enter to leave the dialog open in all four fields, preserve confirmed text, and allow a later deliberate Enter to submit once. The supplied change summary reports that all four fields now use ImeInput. The added test covers remote port, local port, remote host, and label. The test verifies that the first Enter is prevented without addPortForward, and that the next Enter submits once with the field value.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the four port-forward dialog inputs and focused IME behavior tests. The production change preserves existing field props and styling. The tests directly verify issue #34124 behavior. No unrelated production or compatibility changes are reported.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit c0f9df5 into main Oct 27, 2026
33 checks passed
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.

[Bug]: IME confirmation Enter can submit the SSH port-forward dialog

2 participants