Skip to content

fix(web): keep settings inputs focused during IME composition - #10262

Merged
t3dotgg merged 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/web-settings-ime-commit
Sep 6, 2026
Merged

fix(web): keep settings inputs focused during IME composition#10262
t3dotgg merged 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/web-settings-ime-commit

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What changed

Ignore IME keydowns in useCommitOnBlur using the same isComposing / keyCode === 229 guard already used by thread rename in #6281. Normal Enter and blur still commit changed values.

Why

Pressing Enter to confirm an IME candidate in a settings DraftInput currently blurs the field and saves an unfinished value. Further typing no longer reaches the input. This affects fields such as provider display names.

The shared hook covers web and desktop settings. Mobile uses separate inputs. No provider adapters, contracts, product defaults, or diagnostic settings change.

flowchart LR
    A[Enter in DraftInput] --> B{IME composition?}
    B -->|Yes| C[Keep focus and draft]
    B -->|No| D[Blur]
    D --> E[Commit changed value]
Loading

Verification

Tested the running app in local Chromium with synthetic IME keydown events on Settings → Providers → Display name. This does not claim a native OS IME or Safari test.

  • Before: both isComposing=true and isComposing=false, keyCode=229 blur and save prematurely.
  • After: both retain focus and leave the saved provider label unchanged. Typing can continue.
  • Normal Enter and Tab still save; the committed value survives a reload.
  • Targeted lint, formatting, and hook-only TypeScript checks pass. Fallow's changed-file audit passes with no introduced findings.

UI changes

PNG captures at 2×, immediately after the same synthetic composing Enter.

Before: focus is lost and the partial name has already replaced the provider label.

Before: IME Enter prematurely saves the display name

After: the input keeps focus and the provider label remains unchanged until a normal commit.

After: IME Enter keeps focus and the unsaved draft

Before video, typing team after the composing Enter is lost:

settings-ime-before.webm

After video, typing continues and a normal Enter saves the full name:

settings-ime-after.webm

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for UI changes
  • I included videos for interaction changes

Model: GPT-5. Harness: Codex in T3 Code.

Note

Fix useCommitOnBlur hook to ignore Enter during IME composition

Adds an early return in useCommitOnBlur.ts when the keyboard event is part of IME composition or uses the IME composition key code. This prevents the hook from committing and blurring the input while users are mid-composition with input methods like CJK keyboards. Non-composition Enter handling is unchanged.

Macroscope summarized 8f7adcf.

Summary by CodeRabbit

  • Bug Fixes
    • Improved text input behavior for IME users by preventing premature commits or field blurs when confirming composed text with the Enter key.

Copilot AI lite review requested due to automatic review settings September 6, 2026 02:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T02:27:08.406060Z 8f7adcf PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 8f7adcf

Macroscope's review found this PR approvable — The PR adds a single localized IME guard to the shared settings input hook, preserving focus and the draft during composition while leaving normal Enter and blur commits unchanged. Its runtime impact is narrow and readily accounted for, with no product-default or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 09db0f39-17dc-400c-85e8-d17ef17897c9

📥 Commits

Reviewing files that changed from the base of the PR and between b438447 and 8f7adcf.

📒 Files selected for processing (1)
  • apps/web/src/hooks/useCommitOnBlur.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The useCommitOnBlur hook now ignores Enter key events that occur during IME composition. This prevents composition confirmation from triggering an early commit or blur.

Changes

IME commit handling

Layer / File(s) Summary
Composition guard
apps/web/src/hooks/useCommitOnBlur.ts
The onKeyDown handler returns when event.nativeEvent.isComposing is true or event.keyCode is 229.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 8f7ad

IME candidate confirmation no longer prematurely commits or blurs settings inputs, while normal Enter and blur commits remain intact. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preserving settings input focus during IME composition.
Description check ✅ Passed The description explains what changed, why it changed, verification results, UI evidence, and checklist completion. It is focused and complete.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@t3dotgg
t3dotgg merged commit 9c96ac2 into pingdotgg:main Sep 6, 2026
22 checks passed
BarretoDiego pushed a commit to BarretoDiego/t3code that referenced this pull request Sep 7, 2026
…tgg#10262)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 7, 2026
## What's Changed
* fix(clients): show feedback results in composer banners by @juliusmarminge in pingdotgg/t3code#10398
* fix(server): stop Windows terminal polling from spiking CPU by @UtkarshUsername in pingdotgg/t3code#9476
* fix(web): onboarding installs agents without needing Node or npm by @t3dotgg in pingdotgg/t3code#10402
* fix(server): allow settling threads with unanswered async questions by @t3dotgg in pingdotgg/t3code#10400
* feat(ci): ship stable releases from the latest nightly commit by @t3dotgg in pingdotgg/t3code#10410
* feat(marketing): add a nightly channel to the download page by @t3dotgg in pingdotgg/t3code#10408
* fix(web): keep settings inputs focused during IME composition by @Lucenx9 in pingdotgg/t3code#10262
* fix(server): preserve Codex reset credits during usage updates by @yashranaway in pingdotgg/t3code#10308
* docs: link the repository security reporting policy by @yashranaway in pingdotgg/t3code#10303
* fix(web): only show auto balance errors after failed checks by @maria-rcks in pingdotgg/t3code#10407
* fix(web): improve preview recording frame delivery by @maria-rcks in pingdotgg/t3code#10403
* fix(server): preserve inline provider secrets on redacted saves by @maxwellyoung in pingdotgg/t3code#10054
* fix(web, mobile): replace Apple desktop machine labels by @extoci in pingdotgg/t3code#10396
* fix(web): hide browser when the right panel starts closing by @Neel2107 in pingdotgg/t3code#10385
* fix(web): keep settings section headings description-free by @maria-rcks in pingdotgg/t3code#10415
* fix(usage): read and redeem hub reset credits through CLIProxyAPI by @juliusmarminge in pingdotgg/t3code#10395
* fix(web): deduplicate expanded tool labels and keep errors expandable by @Yash-Singh1 in pingdotgg/t3code#10420
* fix(server): skip git status scans while the index is locked by @Gigioxx in pingdotgg/t3code#9845
* fix(mcp): allow text-only preview snapshots by @juliusmarminge in pingdotgg/t3code#10232
* fix(claude): name the expired login or usage limit instead of a generic API error by @vitalyiegorov in pingdotgg/t3code#10321
* feat(mobile): queue a message while its attachment is still uploading by @juliusmarminge in pingdotgg/t3code#10404
* feat(mobile): show when an existing thread has a message waiting in the outbox by @juliusmarminge in pingdotgg/t3code#10405
* fix(codex): accept misalignment policy errors on thread resume by @realbakari in pingdotgg/t3code#10373
* fix(server): skip disabled settlement lookups by @t3dotgg in pingdotgg/t3code#10424
* fix(server): run OpenCode CLI commands sequentially by @t3dotgg in pingdotgg/t3code#10427
* feat(web): name the drop action while dragging sidebar threads by @SunkenInTime in pingdotgg/t3code#10378
* perf(web): keep the sidebar responsive during bulk thread updates by @t3dotgg in pingdotgg/t3code#10413
* fix(web): onboarding wizard now supports light mode by @t3dotgg in pingdotgg/t3code#10432
* feat(threads): dismiss async questions without replying by @t3dotgg in pingdotgg/t3code#10431
* fix(web): stop collapsing the composer when it loses focus by @t3dotgg in pingdotgg/t3code#10437
* fix(server): keep interrupted threads resumable after restarts by @maria-rcks in pingdotgg/t3code#10421

## New Contributors
* @Neel2107 made their first contribution in pingdotgg/t3code#10385
* @realbakari made their first contribution in pingdotgg/t3code#10373

**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1316...v0.0.39-nightly.20260907.1325

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260907.1325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants