Skip to content

fix(desktop): clear stale validation error when reopening the schedule modal - #10627

Merged
alexhancock merged 1 commit into
aaif-goose:mainfrom
TheSeydiCharyyev:fix/schedule-modal-stale-validation-error
Jul 31, 2026
Merged

fix(desktop): clear stale validation error when reopening the schedule modal#10627
alexhancock merged 1 commit into
aaif-goose:mainfrom
TheSeydiCharyyev:fix/schedule-modal-stale-validation-error

Conversation

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor

Summary

A validation error raised while creating a schedule stays on screen when the modal is reopened to edit a different schedule.

ScheduleModal is rendered unconditionally by both SchedulesView and ScheduleDetailViewif (!isOpen) return null is an early return inside the component, so it never unmounts and its state survives close/reopen. The isOpen effect resets internalValidationError only in the create branch, so an error set during creation is still rendered afterwards. The error banner sits above the !isEditMode block, so it shows in edit mode too.

Steps: open Create Schedule, enter a name but no recipe source, submit ("Please provide a valid recipe source."), cancel, then click Edit on any schedule — the Edit dialog opens with the leftover error.

Fix: reset the validation error whenever the modal opens, before branching on create vs edit.

Testing

Added ScheduleModal.test.tsx — the component needs no mocks on this path (window.electron is only touched by the file browser), so the test is just render + rerender under IntlTestWrapper. It fails on main and passes with the fix.

pnpm run lint:check, pnpm run typecheck and pnpm run test:run (583 passed) all pass.

Related Issues

None — self-found.

…e modal

ScheduleModal is rendered unconditionally by SchedulesView and ScheduleDetailView, and its not-open case is an early return inside the component, so it never unmounts and its state survives close/reopen. The isOpen effect reset internalValidationError only in the create branch, so an error raised while creating a schedule stayed on screen when the modal was reopened to edit one. The error banner renders above the isEditMode block, so it showed in edit mode too.

Reset the validation error whenever the modal opens, before branching on create vs edit. Adds a test that needs no mocks on this path.

Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1bf2d7956d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock
alexhancock merged commit eea5609 into aaif-goose:main Jul 31, 2026
23 checks passed
lifeizhou-ap added a commit that referenced this pull request Aug 3, 2026
* main: (103 commits)
  fix: parse PyPI requirements for OSV checks (#10510)
  fix(telegram): contain voice file extensions (#10456)
  Revert "feat(security): chunk command-classifier input with overlapping windows" (#10416) (#10870)
  docs: update Discord invite (#10863)
  fix(security): preserve denied tool request precedence (#10612)
  fix(hints): contain subdirectory hint discovery (#10545)
  chore(deps): bump pem from 3.0.6 to 4.0.0 (#10853)
  chore(deps): bump base64 from 0.22.1 to 0.23.0 (#10851)
  chore(deps): bump jsonwebtoken from 10.4.0 to 11.0.0 (#10850)
  chore(deps): bump astral-sh/setup-uv from 8.3.2 to 9.0.0 (#10847)
  chore(deps): bump docker/login-action from 4.5.1 to 4.5.2 (#10846)
  chore(deps): bump github/codeql-action from 4 to 4.37.3 (#10845)
  chore(deps): bump actions/stale from 10.4.0 to 11.0.0 (#10844)
  feat(dictation): add LOCAL_WHISPER_LANGUAGE for multilingual local transcription (#10634)
  fix(desktop): clear stale validation error when reopening the schedule modal (#10627)
  fix(docs): resolve CVE-2026-13149 in both brace-expansion copies (#10842)
  feat(provider): add Friendli as declarative provider (#10762)
  fix: sanitize shell/subprocess call in linux.rs (#10748)
  fix(desktop): unlink destination before copying binaries (#10705)
  feat(otel): enrich root span with gen_ai attributes and improve output format (#10816)
  ...
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.

2 participants