Skip to content

fix(recipe): close modal when canceling parameter form - #9167

Closed
enilsen16 wants to merge 2 commits into
aaif-goose:mainfrom
enilsen16:pr/recipe-modal-cancel-fix
Closed

enilsen16 wants to merge 2 commits into
aaif-goose:mainfrom
enilsen16:pr/recipe-modal-cancel-fix

Conversation

@enilsen16

@enilsen16 enilsen16 commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #8864. In the goose1 desktop app, hitting Cancel on the recipe-parameter form was spawning a fresh window instead of closing the modal — because the cancel path went through the same "launch with recipe" code as Submit.

Testing

  • New tests under ui/desktop/src/components/__tests__/ParameterInputModal.test.tsx cover Cancel and Submit paths.
  • Manual: open a recipe with required params, hit Cancel; confirm the modal closes and no new window appears.

Related Issues

Fixes #8864.

@enilsen16
enilsen16 force-pushed the pr/recipe-modal-cancel-fix branch from 6e7ba49 to 46ed722 Compare May 12, 2026 19:43

@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: 46ed722bc4

ℹ️ 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 thread ui/desktop/src/components/ParameterInputModal.tsx Outdated
@enilsen16
enilsen16 force-pushed the pr/recipe-modal-cancel-fix branch from 46ed722 to 545c800 Compare May 12, 2026 20:40
enilsen16 added a commit to enilsen16/goose that referenced this pull request May 12, 2026
ChatSessionsContainer keeps inactive sessions mounted, so two open
recipe sessions can each render a ParameterInputModal at the same time.
Using `id={param.key}` produced duplicate DOM IDs whenever two recipes
shared a parameter key, which means `<label htmlFor>` would resolve to
the first matching (often hidden) control — label clicks and assistive
tech ended up targeting the wrong field.

Generate a per-instance prefix with React's `useId` and route both the
label `htmlFor` and the input `id` through a small `fieldId` helper.
The DOM/label association is preserved, but two mounted modals no longer
collide.

Addresses Codex P2 on aaif-goose#9167 (ParameterInputModal.tsx:167).

Signed-off-by: Erik Nilsen <enilsen16@live.com>
enilsen16 added 2 commits May 12, 2026 13:43
…w instead of closing modal

- Removed window.electron.createChatWindow() call when canceling recipe setup
- When user selects 'Start New Chat (No Recipe)', modal now just closes (calls onClose())
- Previously this was creating an extra window instead of closing the modal
- Removed unused getInitialWorkingDir import
- Added comprehensive tests for ParameterInputModal component
- Tests verify the bug fix and cover form submission, validation, and cancel behavior

Signed-off-by: Erik Nilsen <enilsen16@live.com>
ChatSessionsContainer keeps inactive sessions mounted, so two open
recipe sessions can each render a ParameterInputModal at the same time.
Using `id={param.key}` produced duplicate DOM IDs whenever two recipes
shared a parameter key, which means `<label htmlFor>` would resolve to
the first matching (often hidden) control — label clicks and assistive
tech ended up targeting the wrong field.

Generate a per-instance prefix with React's `useId` and route both the
label `htmlFor` and the input `id` through a small `fieldId` helper.
The DOM/label association is preserved, but two mounted modals no longer
collide.

Addresses Codex P2 on aaif-goose#9167 (ParameterInputModal.tsx:167).

Signed-off-by: Erik Nilsen <enilsen16@live.com>
@enilsen16
enilsen16 force-pushed the pr/recipe-modal-cancel-fix branch from 545c800 to b465c9a Compare May 12, 2026 20:43
@enilsen16 enilsen16 changed the title fix: canceling recipe parameter form closes modal instead of spawning new window (#8864) fix(recipe): close modal when canceling parameter form May 12, 2026
@enilsen16

Copy link
Copy Markdown
Contributor Author

Closing to reduce review queue. Can be reopened when ready for review.

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.

Canceling recipe parameter form spawns new extra window instead of closing the modal overlay

1 participant