Skip to content

fix(pages): replace native alerts with dismissible notices - #30734

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m10-page-alerts
Nov 11, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m10-page-alerts

Conversation

@abirkel

@abirkel abirkel commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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

  • Migrating other native-dialog callers, which have separate batches in this series.
  • Changing export, save or schedule APIs, accepted upload types or translated wording.
  • Adding navigation hand-offs to pages that hold unsaved text.

What changed (motivation → approach → change)

The eight native alerts become dismissible notices using the existing shared components and locale text.

Surface Feedback inside the page
Auto Research Export and Knowledge failures each have an inline ErrorNotice beside their own button.
Projects Rejected files and missing schedule input use warning StatusNotice messages. Daily scheduling success uses an information notice.
Agent Config Invalid JSON uses a warning StatusNotice. A failed save uses a separate ErrorNotice above 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.js removes the three component paths from the native-dialog allowlist. No locale keys change.

The open-PR sweep at 5e8741f525 found 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 0 uses the same config without the three exemptions.

Tests

ResearchLabPageCoverage.test.tsx covers 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 campaign checks both actions against a cached campaign switch. keeps artifact and knowledge failures attached to their own controls checks notice ownership and the action row's start alignment.

ProjectsPageCoverage.test.tsx covers both upload routes, unchanged drafts, cleared pickers, warning dismissal and valid retries. hides a %s upload warning when a run is opened checks 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 spec and clears a schedule outcome when another run action starts keep concurrent feedback accurate. preserves another run's warning when a schedule completes late checks that a late success cannot replace another run's warning or reappear on return.

AgentCfgTab.test.tsx covers 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 mutation checks the late failure alongside its validation warning. preserves an empty draft edited before the initial config query completes and clears the saved label when the next save fails JSON validation cover 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:

Research export failure beside its button

Projects daily scheduling information notice:

Projects daily scheduling information notice

Agent Config save failure with the draft retained:

Agent Config save failure with the draft retained

Upload and JSON validation warnings

Projects rejects YAML in From Spec

Projects rejects a non-YAML file in From YAML

Agent Config invalid JSON warning with the draft retained

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/main at 5e8741f5255b94c52c62db52db1c48d397d46707. 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-globals and no-restricted-properties in website/eslint.config.js (#15854). Remove a path as soon as its last native call is gone, then run whole-source lint.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license. See the Licensing section of CONTRIBUTING.md.

@abirkel
abirkel requested review from a team and KiroCrewCaptain as code owners November 5, 2026 19:56
@abirkel
abirkel requested a review from iamwhatever November 5, 2026 19:56
@github-actions github-actions Bot added readiness: checking Automated validation is still running fork Pull request from a fork (external contributor) labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of da2c6b500cc465a36afafe280dec9f94e21c241e via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Every item either replaces one of the eight allowlisted alert() calls with an existing notice component, or keeps the new local feedback state tied to its own campaign, run or draft.

What this change ships

Inventory (10 items) — 7 justified

Intent: 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.

  1. Auto Research export and Knowledge failures show as inline dismissible notices beside their buttons — justified
  2. Switching campaigns no longer carries another campaign's pending action or failure into its controls — justified
  3. The Auto Research action row aligns its controls to the top when a notice appears — rides along
  4. Rejected file uploads in Projects show a warning notice, and the picker resets — justified
  5. Missing-spec and daily-schedule outcomes in Projects show as warning or info notices, scoped to the run — justified
  6. A late schedule result is dropped if another run is selected or the page has closed — justified
  7. Starting a run action clears the previous status notice — justified
  8. Invalid JSON in Agent Config shows a warning notice, and a failed save shows a separate error notice — justified
  9. Invalid JSON clears the "Saved" marker; a refetch no longer refills an editor the user cleared — rides along
  10. Three files leave the native-dialog lint allowlist, so the lint rule now applies to them — justified

[FIRST-PRINCIPLES-REVIEWED] da2c6b5

Description read

[DESCRIPTION-READ] 5247b6eff0b215ea5e095b302351f3e6df0ca2779ea56cdaac64e206b53181bd

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of da2c6b500cc465a36afafe280dec9f94e21c241e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Auto Research is a built-in app, but src/kiro_crew/apps/adoption-pins.json does not pin it, so fixing it in core without an app-repository commit is allowed.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed da2c6b500cc465a36afafe280dec9f94e21c241e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] da2c6b5

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed da2c6b500cc465a36afafe280dec9f94e21c241e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] da2c6b5

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m10-page-alerts branch from 847ee84 to 87d50ba Compare November 10, 2026 00:52
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 10, 2026
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
@abirkel
abirkel force-pushed the fix/native-dialog-m10-page-alerts branch from 87d50ba to da2c6b5 Compare November 11, 2026 02:39
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of da2c6b500cc465a36afafe280dec9f94e21c241e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Auto Research "Add to Knowledge" failure: setError(err?.message || …failed_to_add_to_knowledge_library) renders an inline ErrorNotice under the Knowledge button. That message can be raw server text, and attachment-01 only shows the Export failure. To close this, attach a screenshot of the Knowledge failure, ideally next to an Export failure so both notices are visible together.
  • Projects Schedule with no spec: setStatusNotice({ message: …no_spec_idea_to_schedule, tone: 'warn', runId }) shows a warning banner on the selected-run view. attachment-02 only shows the info-tone success. To close this, attach the run view after clicking Schedule on a run that has no spec or idea.

Notes

  • This fork lane has no blind read, so nobody coming to it cold has judged the six notices the screenshots do show. A maintainer can get that read by pushing the branch to this repository.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 11, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. 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.
  2. 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 statusNotice in the mode chip handlers.
  • The AgentCfgTab initializedRef change (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 = true line in onChange is removed. Flushing pending notifications before the final assertion would make it a reliable pin.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 11, 2026 04:05

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KiroCrewCaptain
KiroCrewCaptain merged commit 806851e into kirodotdev:main Nov 11, 2026
94 of 95 checks passed
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-auto-research that referenced this pull request Nov 13, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants