WEN-31: preserve IME input while issue editor loads#5637
Open
beastpu wants to merge 2 commits into
Open
Conversation
Co-authored-by: multica-agent <github@multica.ai>
|
@beastpu is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: multica-agent <github@multica.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #5617.
This is a real product bug: empty issue comment and reply composers rendered a focusable static shell, mounted Tiptap asynchronously after intent, then replaced the focused shell when Tiptap reported ready. Replacing that node during a Chinese/Japanese/Korean IME composition cancels the native composition and splits input such as
woinstead of我. Agent-query rerenders preserve the editor node; the shell-to-editor handoff is the failing boundary.The fix keeps lazy editor initialization, but makes the handoff shell a native textarea that can receive input. Tiptap mounts hidden in the background. If IME composition overlaps readiness in either order, the swap waits for
compositionend; completed shell text is adopted into Tiptap and focus lands at the end. Main comments and thread replies share the behavior.Multica work item: WEN-31
Related Issue
Fixes #5617
Type of Change
Changes Made
packages/views/editor/use-lazy-editor.ts: preserve an editable stand-in across IME composition, including the boundary where readiness and composition start are batched in the reverse order; adopt pending text before the swap and focus the live editor at the end.packages/views/editor/content-editor.tsx: expose an explicit end-focus operation for handoff callers.packages/views/issues/components/comment-input.tsx: use an editable, draft-aware native handoff shell for the main composer.packages/views/issues/components/reply-input.tsx: apply the same handoff to thread replies.How to Test
woimmediately while the rich editor initializes.我is preserved, and subsequent input is appended after it. Repeat in a thread reply.Automated verification run after review fixes:
pnpm -C packages/views exec vitest run issues/components/comment-composers.test.tsx editor/use-lazy-editor.test.ts editor/content-editor.test.tsx— 59/59 passed.pnpm --filter @multica/views typecheck— passed.pnpm --filter @multica/views lint— 0 errors; 19 pre-existing warnings in untouched files.pnpm --filter @multica/views test— 234 files, 2687/2687 tests passed.Checklist
Risks considered
AI Disclosure
AI tool used: OpenAI Codex (Multica Agent)
Prompt / approach: Investigated GitHub #5617 on current
main, isolated the shell-to-editor focus transfer, wrote delayed-readiness IME regressions, implemented a composition-aware handoff, then reviewed the PR as an external change. That review found the reverse-order batched ready/composition-start gap, demonstrated it with a failing test on the original PR commit, patched it, added ordinary-input and real-editor contract tests, and reran targeted plus package-wide verification.Screenshots (optional)
Not included: the visible layout is unchanged; the regression is an IME/focus timing boundary covered by deterministic component and hook tests.