fix(ui): prevent rename input from losing focus when triggered via context menu#1138
Merged
arnestrickmann merged 1 commit intomainfrom Feb 27, 2026
Merged
fix(ui): prevent rename input from losing focus when triggered via context menu#1138arnestrickmann merged 1 commit intomainfrom
arnestrickmann merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryImplements a blur guard mechanism to fix task rename failing when triggered from the right-click context menu. The solution prevents the Radix context menu's close animation (~150ms) and focus restoration from stealing focus away from the rename input. Changes:
Issues:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/renderer/components/TaskItem.tsx | Added blur guard mechanism with timer to prevent context menu from stealing focus from rename input. Missing timer cleanup on unmount. |
Last reviewed commit: 213d9b9
| const inputRef = useRef<HTMLInputElement>(null); | ||
| const isSubmittingRef = useRef(false); | ||
| const blurGuardRef = useRef(false); | ||
| const blurGuardTimerRef = useRef<ReturnType<typeof setTimeout>>(); |
There was a problem hiding this comment.
Missing timer cleanup on component unmount (see GitHubIssuePreviewTooltip.tsx:94-97 for example). Add:
Suggested change
| const blurGuardTimerRef = useRef<ReturnType<typeof setTimeout>>(); | |
| const blurGuardTimerRef = useRef<ReturnType<typeof setTimeout>>(); | |
| useEffect(() => { | |
| return () => { | |
| clearTimeout(blurGuardTimerRef.current); | |
| }; | |
| }, []); |
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.
Summary
onBlurhandler now checks the guard ref and re-focuses the input if the blur was caused by the context menu dismissal rather than a genuine focus lossonMouseDown={stopPropagation}to prevent click events on the input from bubbling up to parent handlersFixes GEN-428