Repository navigation
fix(pages): replace native alerts with dismissible notices - #30734
Conversation
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item either replaces one of the eight allowlisted What this change shipsInventory (10 items) — 7 justifiedIntent: let users read and dismiss export, upload, schedule and config-save feedback inside the page instead of a native dialog that can freeze the keyboard on Windows (#15976). FIX.
[FIRST-PRINCIPLES-REVIEWED] da2c6b5 Description read[DESCRIPTION-READ] 5247b6eff0b215ea5e095b302351f3e6df0ca2779ea56cdaac64e206b53181bd That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the eight native alerts become in-page notices built from the existing shared notice components, the screenshots cover this revision, and every reader of the three removed allowlist entries is listed. Notes
[DESIGN-REVIEWED] da2c6b5 Description read[DESCRIPTION-READ] e576dcda3e1d7a9c911c8f3aa318336958473255105df345e38e848fb981acf1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
847ee84 to
87d50ba
Compare
Eight actions report feedback through native alert(): Research export and Knowledge failures, Projects upload warnings and schedule outcomes, and Agent Config validation and save failures. In the desktop app these are OS dialogs. On Windows, the window can ignore the keyboard after a native dialog closes until it is reactivated (kirodotdev#15976). Keep each message inside its page using dismissible ErrorNotice and StatusNotice surfaces. Clear stale feedback on retry and keep failures beside the action or editor they describe. Reuse the existing translated text without adding locale keys. Keep Research action state with its campaign. Scope Projects upload warnings to the new-task view and schedule notices to their run. Discard a schedule completion received while another run is selected, including on return to the original run. Preserve Agent Config edits through query completion and refetch, including an empty draft, and keep pending save failures visible after JSON validation resets the mutation. Remove the three component paths from the native-dialog allowlist. Cover dismissal, retries, draft preservation and late completions in the behavior tests. Part of kirodotdev#15976
87d50ba to
da2c6b5
Compare
UX Review (Opus 5.5, fork) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the Add to Knowledge failure notice and the "nothing to schedule" warning. The diff adds both, and none of the six screenshots shows either one. Evidence gaps
Notes
[UX-REVIEWED] da2c6b5 Description read[DESCRIPTION-READ] 3fa0ace8e7d9b0f33316282f481d0449b8dd8c455efce705c012a34e92c8be8c That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for this. The code review on this head is clean, but one evidence gap blocks merge: the UX review could not judge two of the new notices because no screenshot shows them.
website/src/apps/auto-research/ResearchLabPage.tsx:572(rendered at :578-581). When Add to Knowledge fails with a non-409 error, the new inline ErrorNotice shows the server message. None of the six screenshots in the body shows this state, so nobody has seen it rendered. Fix: attach a screenshot of this head that shows the Knowledge failure notice, ideally next to an Export failure.website/src/pages/ProjectsPage.tsx:801(rendered at :684). When you click Schedule on a run with no spec or idea, the run view shows a warn-tone StatusNotice. No screenshot shows it. Fix: attach a screenshot of the selected-run view after Schedule on such a run.
No code change is needed. After you add the two screenshots, re-run the UX review lane.
Optional:
- In Projects, the "upload via the From YAML tab" warning (set at ProjectsPage.tsx:407) stays visible after you switch to From YAML. You could clear
statusNoticein the mode chip handlers. - The AgentCfgTab
initializedRefchange (no refill after the user clears the editor) goes beyond the alert swap. The body discloses it, so it can stay. Cutting it would keep the PR tighter. - The test "preserves an empty draft edited before the initial config query completes" (AgentCfgTab.test.tsx:157) does not always fail when the
initializedRef.current = trueline in onChange is removed. Flushing pending notifications before the final assertion would make it a reliable pin.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (7 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: native alert() calls on three pages are replaced with dismissible inline notices, and the eslint allowlist shrinks to match; tests added.
Brings the app level with every built-in change since 6d07df11cf: - kirodotdev/KiroCrew#29683: a campaign created but never started offers Start, blocked while another campaign is active, and says "Not started yet." (new not_started_yet string in every locale). - kirodotdev/KiroCrew#28544: a verified finding, the cycle cap or stagnation settles the run like the idle path, so the worker loop stops instead of scheduling turns nobody reads. - kirodotdev/KiroCrew#34815: a person's revoke of the worker's trust parks the campaign for re-authorization instead of being granted back. - kirodotdev/KiroCrew#30734: export and add-to-knowledge failures are dismissible notices beside their buttons, not native alerts. - kirodotdev/KiroCrew#35029: a worker grant also stores the session's auto approval policy, through _host.effective_session_key (nothing stored on a gateway without it). PORTING.md gets a row per port and gap 1 now names the swap-side refusal in kirodotdev/KiroCrew#36321; the README covers the two new on-screen states. app.json moves to 0.1.1 for this release. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Problem / Motivation
Goal: Auto Research, Projects and Agent Config show export failures, upload warnings, schedule outcomes and config-save feedback inside the app window.
Eight
alert()calls report these outcomes through a native dialog. On Windows, closing a native renderer dialog can leave the window ignoring the keyboard until it is reactivated (#15976). #15854 added the lint gate against new native dialogs and exempted these callers in a shrink-only allowlist.Why it matters
Exporting research, choosing a file, scheduling a project or correcting config JSON can reach the Windows keyboard problem. These notices let the user read and dismiss the message while keeping the page and its draft available.
Not a goal
What changed (motivation → approach → change)
The eight native alerts become dismissible notices using the existing shared components and locale text.
ErrorNoticebeside their own button.StatusNoticemessages. Daily scheduling success uses an information notice.StatusNotice. A failed save uses a separateErrorNoticeabove the editor.Research errors clear when retried and stay independent. A failed regeneration keeps the existing report link, and a Knowledge 409 keeps the already-in-library outcome. Campaign keys prevent an old campaign's pending request from disabling another campaign's controls or showing its failure there. The action row aligns controls at the top when a notice grows.
Projects upload warnings belong to the new-task view and are hidden once a run is opened. Both file handlers keep the draft and reset the rejected picker, and a valid upload clears the warning before reading the file. A run action clears the previous status notice. Scheduling with no spec shows its warning while preserving an unrelated action error. The schedule handler captures the selected run's id before the request starts. A completion that arrives while another run is selected, or after the page unmounts, is dropped, so returning to the original run does not show it.
Agent Config clears stale feedback on the next Save. Invalid JSON resets the Saved marker without sending a save request. A pending save can still report its failure after a newer invalid draft resets the mutation, so validation and save failure remain independently dismissible. Query completion and refetch preserve edits, including an explicitly cleared editor.
website/eslint.config.jsremoves the three component paths from the native-dialog allowlist. No locale keys change.The open-PR sweep at
5e8741f525found PR #29683 on Research and its coverage suite, and PR #25471 on Projects. Allowlist-only overlaps are PR #30517, PR #30516, PR #30515, PR #30250 and PR #10132.Backwards compatibility
Compatible: accepted files, request payloads, action labels and existing locale strings stay the same. Feedback stays inside the page, and a refetch no longer refills an editor the user has cleared.
Reader: website/eslint.config.js:native-dialog allowlist for ResearchLabPage.tsx -- release -- the component has no native dialog calls, so both error-level restrictions apply and whole-source lint passes.
Reader: website/eslint.config.js:native-dialog allowlist for ProjectsPage.tsx -- release -- all four native alerts are gone, so removing this exemption passes whole-source lint.
Reader: website/eslint.config.js:native-dialog allowlist for AgentCfgTab.tsx -- release -- both native alerts are gone, so removing this exemption passes whole-source lint.
Reader: website/package.json:lint -- release -- ESLint reads the same config and applies the restrictions to the three migrated paths.
Reader: .github/workflows/ci.yml:frontend-lint -- release --
npx eslint src/ --max-warnings 0uses the same config without the three exemptions.Tests
ResearchLabPageCoverage.test.tsxcovers local export and Knowledge failures, independent dismissal, retry clearing, and the existing report link through regeneration.does not show a late %s failure on another campaignchecks both actions against a cached campaign switch.keeps artifact and knowledge failures attached to their own controlschecks notice ownership and the action row's start alignment.ProjectsPageCoverage.test.tsxcovers both upload routes, unchanged drafts, cleared pickers, warning dismissal and valid retries.hides a %s upload warning when a run is openedchecks that the warning belongs to the new-task view. Schedule coverage checks warning and information tones, retry clearing and captured request data.preserves a failed run action when scheduling has no specandclears a schedule outcome when another run action startskeep concurrent feedback accurate.preserves another run's warning when a schedule completes latechecks that a late success cannot replace another run's warning or reappear on return.AgentCfgTab.test.tsxcovers invalid JSON without a save request, independently dismissible feedback, retry clearing and preserved edits during save and query completion.reports a pending save failure after an invalid draft resets the mutationchecks the late failure alongside its validation warning.preserves an empty draft edited before the initial config query completesandclears the saved label when the next save fails JSON validationcover the empty editor and stale success marker.Proof: not provable -- frontend test (prove.py runs Python only).
Recorded regression checks fail when campaign ownership, late schedule ownership or config draft initialization guards are removed. The feedback and layout regressions fail with their fixes removed. The pending-save and late-schedule regressions fail when their local error state and selection guard are replaced by the alternatives proposed in review. The layout assertion checks the Tailwind class in the DOM, and the screenshots provide browser rendering evidence.
Final recorded verification passes: frontend typecheck, scoped ESLint, whole-source ESLint with zero ESLint warnings, comment-history, brand-name, file-line-cap and staged whitespace checks. The related run passes 65 files and 913 tests. The three changed suites pass 122 tests on repeat and with shuffled seed 1010. Locale catalogs are unchanged.
Vitest reports one Research act warning per run and ten Projects act warnings in the related run, plus Vite advisories. Whole-source lint reports a jsx-ast-utils advisory. These commands exit zero. No failure is classified as pre-existing.
Aggregate local-gate: incomplete. Its backend phase was interrupted before a completed result, with exit 130. There is no aggregate pass or failure verdict. This gate still needs completion if required before publication.
Manual verification
The real staged components were rendered in headless Chromium with stubbed API responses. The actual controls triggered Research export failure, both rejected upload routes, daily scheduling success, invalid config JSON and save failure. All six notices were checked for dismissal, readable text and placement inside the viewport. Rejected pickers reset, and both config drafts stayed in the editor.
Still required: trigger and dismiss the notices in a Windows desktop build, then type without reactivating the window. Live export, save and scheduling services were not exercised by the screenshot harness.
Screenshots / video
Research export failure beside its button:
Projects daily scheduling information notice:
Agent Config save failure with the draft retained:
Upload and JSON validation warnings
Related Issues
Part of #15976. Also relates to #15662, which #15854 closed after adding the shrink-only native-dialog allowlist that this PR shrinks.
Sibling sweep
The sweep covers native alerts across renderer code on
origin/mainat5e8741f5255b94c52c62db52db1c48d397d46707. Line numbers refer to that base. Comment matches are listed as not affected, and native calls outside these three components remain tracked in the migration issue.Swept:
git grep -nE '(window\.)?\balert\(' origin/main -- website/src ':!*test*'Sibling: website/src/apps/auto-research/ResearchLabPage.tsx:525 -- changed here -- export failure uses a dismissible ErrorNotice beside its control.
Sibling: website/src/apps/auto-research/ResearchLabPage.tsx:557 -- changed here -- Knowledge failure uses its own dismissible ErrorNotice.
Sibling: website/src/components/FilePathMenu.tsx:73 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/FilePathMenu.tsx:98 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/FilePathMenu.tsx:302 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/FilePathMenu.tsx:372 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/FileRenderers.tsx:548 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/MarkdownPanel.tsx:295 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/components/useMarkdownPanelFileState.ts:19 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/hooks/useSessionActions.ts:276 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/hooks/useSessionActions.ts:318 -- tracked in #15976 -- remaining native session-action alert belongs to another migration batch.
Sibling: website/src/hooks/useSessionActions.ts:320 -- tracked in #15976 -- remaining native session-action alert belongs to another migration batch.
Sibling: website/src/hooks/useSessionActions.ts:322 -- tracked in #15976 -- remaining native session-action alert belongs to another migration batch.
Sibling: website/src/hooks/useSessionActions.ts:325 -- tracked in #15976 -- remaining native session-action alert belongs to another migration batch.
Sibling: website/src/hooks/useSessionActions.ts:429 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/hooks/useSessionActions.ts:437 -- tracked in #15976 -- remaining native session-action alert belongs to another migration batch.
Sibling: website/src/pages/ProjectsPage.tsx:401 -- changed here -- the spec picker shows a warning and resets the rejected file.
Sibling: website/src/pages/ProjectsPage.tsx:411 -- changed here -- the YAML picker shows a warning and resets the rejected file.
Sibling: website/src/pages/ProjectsPage.tsx:789 -- changed here -- an empty spec produces a warning without clearing an unrelated action failure.
Sibling: website/src/pages/ProjectsPage.tsx:792 -- changed here -- schedule success produces an information notice for its selected run.
Sibling: website/src/pages/chat/page/turnActions.ts:90 -- not affected -- comment describing alert feedback, with no native call on this line.
Sibling: website/src/pages/overview/AgentCfgTab.tsx:23 -- changed here -- save failure uses a dismissible ErrorNotice without losing the draft.
Sibling: website/src/pages/overview/AgentCfgTab.tsx:28 -- changed here -- invalid JSON uses a dismissible warning and clears the Saved marker.
Sibling: website/src/utils/popoutController.ts:259 -- tracked in #15976 -- remaining native popout alert belongs to another migration batch.
Pattern harvest
Rule candidate: lint
Pattern: renderer calls to native confirm, alert and prompt are already refused outside the shrink-only allowlist by
no-restricted-globalsandno-restricted-propertiesinwebsite/eslint.config.js(#15854). Remove a path as soon as its last native call is gone, then run whole-source lint.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license. See the Licensing section of CONTRIBUTING.md.