Skip to content

fix(studio): prevent IME confirmation from submitting chat renames - #12613

Merged
danielhanchen merged 19 commits into
mainfrom
reland/pr-12475
Oct 3, 2026
Merged

danielhanchen merged 19 commits into
mainfrom
reland/pr-12475

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Re-opens #12475 for review. It was merged before its review converged and was reverted in #12569.

The change is the original squash commit, cherry-picked unchanged (git cherry-pick -x 079dc91ea), with authorship kept for @kei-yamazaki. The full description and discussion are on #12475.
#12569 has merged, so this PR targets main and its diff shows only this change.

UI before / after

Inline chat rename in the sidebar, driven in Chromium with a real IME composition (CDP Input.imeSetComposition, an Enter keydown with keyCode 229 while composing, then Input.insertText to commit the candidate). BEFORE is the merge base b1da486, AFTER is this branch, two separate Studio installs.

Inline rename with a Japanese IME: before saves the unconverted text, after keeps editing until a separate Enter

Step Before After
Enter that picks the IME candidate rename closes, title saved as the unconverted にほん input stays open holding 日本
Separate plain Enter nothing left to edit saved as 日本

Etherll and others added 12 commits October 2, 2026 14:53
…and lighten both drag copies" (#12499)

This reverts commit 9838541. It was merged before Codex review converged; it will be re-opened for review.
…11187)" (#11361)

This reverts commit cd4d5c1. It was merged before Codex review converged; it will be re-opened for review.
… saved" (#12505)

This reverts commit a91ee37. It was merged before Codex review converged; it will be re-opened for review.
…advancing" (#12523)

This reverts commit d8740d3. It was merged before Codex review converged; it will be re-opened for review.
…row" (#12529)

This reverts commit 5b78baf. It was merged before Codex review converged; it will be re-opened for review.
…ersized request streams pinned groups" (#12526)

This reverts commit d883d2d. It was merged before Codex review converged; it will be re-opened for review.
…, Z-Image, Ideogram 4, Wan2.2 and HunyuanVideo-1.5" (#12516)

This reverts commit fd2522b. It was merged before Codex review converged; it will be re-opened for review.
…ndow" (#12514)

This reverts commit dae96ea. It was merged before Codex review converged; it will be re-opened for review.
…#12486)

This reverts commit ed6d0e8. It was merged before Codex review converged; it will be re-opened for review.
…names" (#12475)

This reverts commit 079dc91. It was merged before Codex review converged; it will be re-opened for review.
#12562 (make carried rows a faintly frosted, darker copy) landed after this
branch was cut and restyles the shared ghost rule that #12499 introduced: it
relies on --row-ghost-surface and .model-picker-row-ghost, and edits
model-picker-pinned-drag-preview.test.ts, all of which the #12499 revert
removes. Keeping it without #12499 leaves .sidebar-row-ghost reading an unset
variable, so the conflict is resolved by dropping #12562's two hunks as well.
It should be re-opened together with #12499. #12563, #12564 and #12597 are kept.
…12475)

* fix(studio): preserve chat rename during IME composition

* fix(studio): keep rename dialogs open when Escape dismisses an IME candidate

Radix's Dialog closes on Escape from a document capture listener, before
the input's onKeyDown guard runs. Prevent that close while composing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Etherl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 079dc91)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 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-10-03T14:13:40.786335Z 8498706 Manual request
🔒 Security Review ⚠️ Failed 2026-10-03T10:48:24.243003Z 817e6cf 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.

Base automatically changed from revert/unconverged-2026-10-02 to main October 3, 2026 10:51
danielhanchen and others added 3 commits October 3, 2026 03:51
…12475)

* fix(studio): preserve chat rename during IME composition

* fix(studio): keep rename dialogs open when Escape dismisses an IME candidate

Radix's Dialog closes on Escape from a document capture listener, before
the input's onKeyDown guard runs. Prevent that close while composing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Etherl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 079dc91)
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Track compositionstart/compositionend on the rename inputs and reuse
imeKeydownBlocksComposerSubmit, so a 229 Enter is only treated as IME owned
while a composition is open or just ended (WebKit bug 165004). An idle
Pinyin Enter (keyCode 229, isComposing false, #12137) saves the rename again.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

A compositionend can go missing (WSL Chrome, macOS input-method switch),
which pinned the shared rename IME state open and swallowed later idle
Pinyin Enters. Focus changes always commit or cancel the composition, so
reset there, matching the composers.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen danielhanchen self-assigned this Oct 3, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 84987064f7

ℹ️ 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 on lines +57 to +58
onCompositionStart: () => {
ime.open = true;

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 Recover a stuck composition without requiring a focus change

When an IME omits compositionend while the rename field remains focused, ime.open stays true and every subsequent IME-marked Enter (keyCode === 229) is rejected indefinitely, because the new recovery only runs on focus or blur. Fresh evidence beyond the prior fix is thread.tsx's useImeComposerInputHandlers, which explicitly documents that switching input methods can cause this while focus is retained and therefore uses IME_STUCK_TIMEOUT_MS; add equivalent in-session recovery here so keyboard submission does not remain wedged until the user clicks away or types a non-IME key.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not changing: the stuck flag is already cleared by any new composition, any non-229 key, and focus/blur; the inline field commits on blur and the dialog has Save, so no rename is lost. A watchdog timer here is extra state for an edge the user exits with any keystroke.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 84987064f7

ℹ️ 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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 3, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 3, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 3, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 3, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 3, 2026
@danielhanchen
danielhanchen merged commit be2f942 into main Oct 3, 2026
@danielhanchen
danielhanchen deleted the reland/pr-12475 branch October 3, 2026 15:51
@danielhanchen

Copy link
Copy Markdown
Member Author

The red Chat UI Tests here is not caused by this PR. The permission step fails on heading "Enable Full access?". #12630 reworded that dialog and removed the pill's danger variant, which broke the step on main. #12640 (merged as 93769f5) fixes the step. A rebase onto main or a re-run of the Chat UI jobs should clear it.

JoshuaL3000 pushed a commit to JoshuaL3000/unsloth that referenced this pull request Oct 4, 2026
…nslothai#12613)

* Revert "Studio: lift a carried model picker row like a sidebar chat, and lighten both drag copies" (unslothai#12499)

This reverts commit 9838541. It was merged before Codex review converged; it will be re-opened for review.

* Revert "fix(studio): WSL2 Windows localhost hint in startup banner (unslothai#11187)" (unslothai#11361)

This reverts commit cd4d5c1. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Studio: stop rejecting --mmproj-device CUDA1 when gpu_ids are saved" (unslothai#12505)

This reverts commit a91ee37. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Studio: renew the chat-run lease while long prefill is still advancing" (unslothai#12523)

This reverts commit d8740d3. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Count only the lock's own waits in the unlockable-filesystem row" (unslothai#12529)

This reverts commit 5b78baf. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Studio: move torchao int8 weights back to the GPU after an oversized request streams pinned groups" (unslothai#12526)

This reverts commit d883d2d. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Studio: use ComfyUI's default settings for FLUX.1, Qwen-Image, Z-Image, Ideogram 4, Wan2.2 and HunyuanVideo-1.5" (unslothai#12516)

This reverts commit fd2522b. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Parity: keep the reap-margin check off the edge of its own window" (unslothai#12514)

This reverts commit dae96ea. It was merged before Codex review converged; it will be re-opened for review.

* Revert "Studio: train a dataset's system column as the system prompt" (unslothai#12486)

This reverts commit ed6d0e8. It was merged before Codex review converged; it will be re-opened for review.

* Revert "fix(studio): prevent IME confirmation from submitting chat renames" (unslothai#12475)

This reverts commit 079dc91. It was merged before Codex review converged; it will be re-opened for review.

* fix(studio): prevent IME confirmation from submitting chat renames (unslothai#12475)

* fix(studio): preserve chat rename during IME composition

* fix(studio): keep rename dialogs open when Escape dismisses an IME candidate

Radix's Dialog closes on Escape from a document capture listener, before
the input's onKeyDown guard runs. Prevent that close while composing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Etherl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 079dc91)

* fix(studio): prevent IME confirmation from submitting chat renames (unslothai#12475)

* fix(studio): preserve chat rename during IME composition

* fix(studio): keep rename dialogs open when Escape dismisses an IME candidate

Radix's Dialog closes on Escape from a document capture listener, before
the input's onKeyDown guard runs. Prevent that close while composing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Etherl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 079dc91)

* Trim comments in IME rename guard

* Let idle macOS Pinyin Enter through the rename IME guard

Track compositionstart/compositionend on the rename inputs and reuse
imeKeydownBlocksComposerSubmit, so a 229 Enter is only treated as IME owned
while a composition is open or just ended (WebKit bug 165004). An idle
Pinyin Enter (keyCode 229, isComposing false, unslothai#12137) saves the rename again.

* Reset rename IME state on focus and blur

A compositionend can go missing (WSL Chrome, macOS input-method switch),
which pinned the shared rename IME state open and swallowed later idle
Pinyin Enters. Focus changes always commit or cancel the composition, so
reset there, matching the composers.

* Clear rename IME timestamp on focus change and gate keyCode 13 candidate Enter

* Tighten IME rename guard comments

---------

Co-authored-by: Etherl <[email protected]>
Co-authored-by: Kei YAMAZAKI <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

3 participants