You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more
apps/code/src/renderer/components/action-selector/useActionSelectorState.ts, line 480-485 (link)
setIsEditing(false) fires before the early-return guard
setIsEditing(false) is called unconditionally on line 480, then on line 482 we potentially return early (empty text, nothing checked). This means pressing Enter on an empty "Other" input silently collapses the editor without submitting — the user has to click "Other" again to re-open it. This matches the previous behaviour so it isn't a regression, but it is easy to miss. Consider moving the setIsEditing(false) call to just before each exit path so the intent is explicit, or at least add a comment explaining that closing the editor on a no-op Enter is the desired UX.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/components/action-selector/useActionSelectorState.ts
Line: 480-485
Comment:
**`setIsEditing(false)` fires before the early-return guard**`setIsEditing(false)` is called unconditionally on line 480, then on line 482 we potentially `return` early (empty text, nothing checked). This means pressing Enter on an empty "Other" input silently collapses the editor without submitting — the user has to click "Other" again to re-open it. This matches the previous behaviour so it isn't a regression, but it is easy to miss. Consider moving the `setIsEditing(false)` call to just before each exit path so the intent is explicit, or at least add a comment explaining that closing the editor on a no-op Enter is the desired UX.
How can I resolve this? If you propose a fix, please make it concise.
apps/code/src/renderer/components/action-selector/useActionSelectorState.ts, line 252-272 (link)
Submit-path logic duplicated in four places
The same "check canSubmitOrAdvance, step-advance or call handleSubmitMulti/handleSubmitSingle" block now appears in selectCurrent, selectByIndex, handleClick, and handleInlineSubmit. The new canSubmitOrAdvance guard had to be added to all four independently. Extracting this into a shared handleSubmit() helper would satisfy OnceAndOnlyOnce, make future changes (like adding more guards) a single-site edit, and reduce the risk of the paths drifting out of sync again.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/components/action-selector/useActionSelectorState.ts
Line: 252-272
Comment:
**Submit-path logic duplicated in four places**
The same "check `canSubmitOrAdvance`, step-advance or call `handleSubmitMulti`/`handleSubmitSingle`" block now appears in `selectCurrent`, `selectByIndex`, `handleClick`, and `handleInlineSubmit`. The new `canSubmitOrAdvance` guard had to be added to all four independently. Extracting this into a shared `handleSubmit()` helper would satisfy OnceAndOnlyOnce, make future changes (like adding more guards) a single-site edit, and reduce the risk of the paths drifting out of sync again.
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---### Issue 1 of 2
apps/code/src/renderer/components/action-selector/useActionSelectorState.ts:480-485
**`setIsEditing(false)` fires before the early-return guard**`setIsEditing(false)` is called unconditionally on line 480, then on line 482 we potentially `return` early (empty text, nothing checked). This means pressing Enter on an empty "Other" input silently collapses the editor without submitting — the user has to click "Other" again to re-open it. This matches the previous behaviour so it isn't a regression, but it is easy to miss. Consider moving the `setIsEditing(false)` call to just before each exit path so the intent is explicit, or at least add a comment explaining that closing the editor on a no-op Enter is the desired UX.
### Issue 2 of 2
apps/code/src/renderer/components/action-selector/useActionSelectorState.ts:252-272
**Submit-path logic duplicated in four places**
The same "check `canSubmitOrAdvance`, step-advance or call `handleSubmitMulti`/`handleSubmitSingle`" block now appears in `selectCurrent`, `selectByIndex`, `handleClick`, and `handleInlineSubmit`. The new `canSubmitOrAdvance` guard had to be added to all four independently. Extracting this into a shared `handleSubmit()` helper would satisfy OnceAndOnlyOnce, make future changes (like adding more guards) a single-site edit, and reduce the risk of the paths drifting out of sync again.
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
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.
Problem
hitting "enter" after typing a custom response to a question does nothing. but shift+enter does correctly make a newline
Changes
How did you test this?
manually
Publish to changelog?
no