fix(desktop): clear stale validation error when reopening the schedule modal - #10627
Merged
alexhancock merged 1 commit intoJul 31, 2026
Conversation
…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>
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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
approved these changes
Jul 31, 2026
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) ...
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
A validation error raised while creating a schedule stays on screen when the modal is reopened to edit a different schedule.
ScheduleModalis rendered unconditionally by bothSchedulesViewandScheduleDetailView—if (!isOpen) return nullis an early return inside the component, so it never unmounts and its state survives close/reopen. TheisOpeneffect resetsinternalValidationErroronly in the create branch, so an error set during creation is still rendered afterwards. The error banner sits above the!isEditModeblock, 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.electronis only touched by the file browser), so the test is just render + rerender underIntlTestWrapper. It fails onmainand passes with the fix.pnpm run lint:check,pnpm run typecheckandpnpm run test:run(583 passed) all pass.Related Issues
None — self-found.