Skip to content

fix: migrate renderer native dialogs - #21276

Closed
abirkel wants to merge 2 commits into
kirodotdev:mainfrom
abirkel:fix/native-renderer-dialog-migration
Closed

abirkel wants to merge 2 commits into
kirodotdev:mainfrom
abirkel:fix/native-renderer-dialog-migration

Conversation

@abirkel

@abirkel abirkel commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Replace every production renderer browser dialog with KiroCrew-native confirmation, notice, or text-entry UI.

KiroCrew desktop still invoked browser-native confirmation, alert, and prompt APIs in renderer workflows. Those dialogs are unthemed and can interrupt the renderer. The remaining session-close and draft-leave paths also could not await an in-app confirmation safely.

Why it matters

Users see a consistent KiroCrew UI for destructive actions, errors, acknowledgements, and one-line input. Pending confirmations now remain bound to the initiating navigation or history action, so a later route or Back action cannot apply a stale approval.

Not a goal

What changed

This PR migrates confirmations across dashboard and app surfaces, routes alerts to inline notices or the notification feed, and adds TextPromptDialog for one-line input. no-restricted-properties now covers every renderer file with no exemptions, and a no-restricted-syntax rule refuses a leave check tested as a plain boolean (!mayLeave…()), which would skip an open confirmation.

The shared navigation leave channel is asynchronous and owns one provider-scoped exit attempt. Route rows, side-panel tabs, the palette, hand-offs, native and popout navigation, history controls and browser Back all settle through one helper, lib/settleNavigationExit.ts. It takes the leave check itself, so a check that throws or rejects counts as "stay" and still releases the attempt. With no confirmation shown, the action runs in the same click, as on main. While a confirmation is open, a second exit is dropped, and an approval applies only if the page that asked is still on screen. Browser Back restores its trap before awaiting.

Implementation spans website/eslint.config.js, website/src/App.tsx, website/src/apps/, website/src/components/, website/src/hooks/, website/src/lib/, website/src/pages/, website/src/shell/, and website/src/utils/; website/src/store/ installs the feed sink appNotice writes through, and website/src/i18n/ carries the catalog changes. The related coverage lives in website/src/test/ and website/src/guide/, and the screenshots in .github/screenshots/15662/.

Wording:

  • Every leave and discard confirmation's cancel reads "Keep editing" (shared components.confirmDialog.keep_editing); the New crewmate form keeps "Cancel" while a create is in flight, since nothing is editable then.
  • A text prompt that may not be left blank names what is missing ("Enter a file name.", "Enter a link."). The Papyrus commit prompt shows the backend's default, "Update from Papyrus", as its placeholder; a test pins it to gitops.DEFAULT_COMMIT_MESSAGE, and it is not translated because the backend commits that literal.
  • Delete buttons that repeated a file, paper, meeting or tag name now read "Delete file", "Delete paper", "Delete meeting", "Delete tag"; the name stays in the question.
  • Tear down asks "Tear down this deployment?" with a "Tear down deployment" button. The theme editor's confirm reads "Delete theme". "Clear context" is sentence case. "Permanently delete {{count}} selected items?" has plural forms in every locale.
  • New and changed strings are translated in every locale.

The Mochi windows load no dashboard stylesheet, so their gallery delete uses an inline-styled confirm with the same contract. Failures with no mounted owner (session duplicate and reload, a blocked pop-out) go to the notification feed and also raise the live banner; a banner note with no body now wraps its title instead of cutting it to one line, and its timestamp parses in the bell feed. The sidebar's session menus close through the sidebar's one action owner, so a close confirmation survives its row moving lane.

This changes presentation only for the destructive confirmations #700 discusses: each still asks before acting. Whether some should become undo flows stays open in #700.

Backwards compatibility

Compatible: existing actions and their browser beforeunload / Electron exceptions remain available, with renderer dialogs replaced by equivalent in-app surfaces.

Removes nothing: no documented capability is removed. Renderer dialog calls are internally migrated to in-app UI.

useGuardedLeave readers (SettingsLink, notifications, MembersPageProfile, KiroSignInNotice, GuideContext, and the rest): with no confirmation shown, perform runs synchronously in the click, as on main. While a confirmation is open, a second exit attempt from anywhere is ignored rather than stacking a second dialog, and perform runs only after the user agrees and only if the page that asked is still the one on screen. A perform may itself call useGuardedLeave: the attempt is released first, so the guide's claim-then-enter reaches enter().

Visible label changes beyond the dialogs: the channel header's clear button reads "Clear context", and the web-app card's tear-down button reads "Tear down deployment" instead of "Cancel / Tear down". Each shares its key with the dialog's confirm button, so the card names the action the dialog confirms.

Tests

  • Text-prompt lifecycle: cancel, caller-specific required messages, placeholder, empty-answer behavior, replacement and unmount.
  • Navigation: competing route, tab and browser-Back attempts; a guard that throws, rejects, or unregisters mid-question releases the exit slot; a sidebar close confirmation survives its row unmounting.
  • Every test that stubbed window.confirm / prompt / alert drives the rendered dialog instead. No test scenario was dropped. Playwright specs that accepted a browser dialog click the themed dialog's button.
  • Destructive confirmations act only on what the question named: Skills Dismiss All dismisses the listed candidates, and a Crew Companion pack delete re-reads the active pack. Escape on a confirmation no longer closes the Crew Companion window or clears the Knowledge selection.
  • Each new regression test was checked to fail with its fix removed.
  • After rebasing on current main: ESLint (--max-warnings 0), tsc, npm run i18n:check, the comment-history, brand and file-line-cap gates pass, and the 464 test files touching changed code pass (9,197 tests). Strict act mode is clean for every test file this PR adds or changes, except 8 cases in src/guide/GuideLayer.offerAndFinish.test.tsx that fail identically on main.

Manual verification

The sheets below were rendered in headless Chromium from the real ConfirmDialog, TextPromptDialog, ErrorNotice, StatusNotice and NotificationBanner components, with the exact strings and options each call site ships, through website/capture/native-dialog-migration.html (run node capture/shoot-native-dialog-migration.mjs from website/). They cover every migrated call site in 53 scenes; call sites with identical wording share a scene. Two scenes render the real component in place: the channel header row, and the web-app card footer with its tear-down button, whose tooltip text is painted beside it because headless shots do not render native tooltips. A running gateway dashboard was not used: minting its dashboard token is blocked by the agent host's policy.

Screenshots / video

Each frame is captioned with its call site. Sheets are grouped by area, one per theme.

Sessions, dark
Sessions, light
Leave without saving, dark
Leave without saving, light
Settings and Knowledge, dark
Settings and Knowledge, light
Channels, artifacts and apps, dark
Channels, artifacts and apps, light
Text entry, notices and live banner, dark
Text entry, notices and live banner, light

The files are committed under .github/screenshots/15662/.

Related Issues

Part of #15662

Related to #15976

Pattern harvest

Rule candidate: lint rule (already enforced)

Pattern: Production renderer code must not call browser-native confirm, alert, or prompt; component-local native surfaces own their equivalent interaction.

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

I agree that this contribution is provided under the repository's Apache-2.0 license.

@abirkel
abirkel requested review from a team and KiroCrewCaptain as code owners October 16, 2026 15:05
@abirkel
abirkel requested a review from dodgeblaster October 16, 2026 15:05
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 16, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

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

Design-Verdict: PASS

No design-level concern blocks this. Every reader of the leave channel I could find that now gets an async answer is either changed in this patch or ignores the return value. A new lint rule refuses future boolean misreads, and 10 committed screenshots cover the reshaped dialogs.

Notes

  • sendErrorToChat and showCreatedChat now return boolean | Promise<boolean>. TypeScript does not flag if (x) on that union, and the new no-restricted-syntax rule only matches callees named mayLeave*. A future caller doing if (!sendErrorToChat(...)) would read a pending confirmation as success and nothing would catch it. Consider widening the selector to these two functions. Today's unchanged reader, NotificationDetailPanel.tsx:87, is safe only because it passes leaveGranted: true.

[DESIGN-REVIEWED] d275fd1

Description read

[DESCRIPTION-READ] d0e4ba488b857572acbd548ea6478cad1d955dd4e404a2dfe3b2b1574faac097

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 Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The 10 committed sheets show every migrated dialog, notice and changed label in both themes. This fork lane has no blind read, so nobody has yet judged whether a first-time user understands them. Pushing the branch to this repository runs that read.

Notes

  • Live banner "Couldn't duplicate this session. Reason: HTTP 500. Try again in a moment." shows a raw status code to the user. Drop "Reason: HTTP 500." or say in plain words what failed.
  • "Session reload failed. The agent may be mid-turn or the gateway unreachable…" makes the user guess the cause and uses the jargon "gateway". If the call site knows which of the two happened, show the message for that case only.
  • The confirm button "Dismiss All" is title case, while this PR moves its siblings to sentence case ("Clear context", "Delete theme"). Change it to "Dismiss all".

[UX-REVIEWED] d275fd1

Description read

[DESCRIPTION-READ] 19c09e8cc822d357f7db5058b2cbbf62ad0482a84a77072e46e06d79403e2c4c

That sha256 names everything this verdict read: the PR description, plus the 13 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 Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Premise-level review of d275fd197b5e4f0b2b3865b71774b47165fe715b 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

Nothing blocks. The base's own ESLint allowlist already scheduled these 35 modules for migration under #15662. The two riders below are relabels with no named failure.

Notes

  • Item 7 — rides along, unjustified move: the description says "the channel header's clear button reads 'Clear context', and the web-app card's tear-down button reads 'Tear down deployment'… Each shares its key with the dialog's confirm button". Sharing a key with the dialog is a symmetry argument, and nobody is named as having misread either button. Subtraction: put back the old labels on the header and card buttons, and keep the new key on the dialog only.
  • Item 8 — rides along: the description says "Delete buttons that repeated a file, paper, meeting or tag name now read 'Delete file'…". No report says the name in the button confused anyone. Subtraction: leave those button labels as they are on base.
  • Item 9 — undeclared: the PR deletes windowConfirmRatchet.test.ts, whose comment said the remaining sites wait on UX: no undo anywhere — reversible destructive ops are confirm-only #700 "and this ratchet must stay green until that decision lands". The description never mentions deleting it. The stricter whole-tree lint rule covers what the ratchet pinned, and the base allowlist had already scheduled those files for migration, so this is a note.

What this change ships

Inventory (9 items) — 6 justified

Intent: replace the browser's native confirm, alert and prompt dialogs in the renderer with themed in-app UI. This is a FIX.

  1. Destructive and leave confirmations show the in-app themed dialog — justified
  2. Error alerts appear as inline notices, or in the bell feed plus the live banner — justified
  3. One-line text input opens an in-app prompt dialog — justified
  4. Mochi and Companion gallery deletes use an inline-styled confirm — justified
  5. A pending leave confirmation stays bound to the exit that raised it; a second exit is dropped — justified
  6. The lint gate now refuses native dialogs in every renderer file — justified
  7. Header and card buttons relabeled to "Clear context" and "Tear down deployment" — rides along, symmetry only
  8. Delete buttons no longer repeat the item's name — rides along
  9. The window.confirm ratchet test is deleted — undeclared

[FIRST-PRINCIPLES-REVIEWED] d275fd1

Description read

[DESCRIPTION-READ] 0b025726f6c8c9ebe0a65c577486fd07d8d07439d4f0df39171dd138546ef366

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 Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — 🔴 changes requested (blocking)

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

Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

BLOCKING -- website/src/pages/members/MembersPage.tsx:610 -- Leave confirmation cannot take focus above an active Radix dialog
const confirmDiscard = useCallback((title: string) => confirmLeave({
Trigger: Press browser Back with unsaved edits in CrewEditorNextDialog; NavigationBackGuard calls the registered leave guard, opening this useConfirm modal while the Radix dialog remains open. The same conflict occurs in NewCrewmateDialog.tsx:712 with its Workspace dialog open.
Outcome: Radix’s modal focus trap redirects focus into the underlying dialog, preventing keyboard users from reaching “Keep editing” or “Discard changes.” The higher z-index changes painting, not focus ownership.
Anchor: defect
Fix: Use a Radix-backed confirmation that joins the active dialog’s focus stack, preserving the caller-specific labels.

[BLOCK-MERGE] d275fd1
[GPT-REVIEWED] d275fd1

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — UPHOLD (MEDIUM). Keyboard users lose the ability to answer the leave prompt on a common path: pressing Back with unsaved edits. Before this change that path used window.confirm, which keyboard users could answer.

  • Conditions confirmed: the route guard now awaits confirmDiscard, which uses useConfirm, which renders the hand-rolled Modal (website/src/components/Modal.tsx:84-100, its own focus trap, not Radix). That is new code at patch lines 7138-7143 and 7169-7177. Meanwhile CrewEditorNextDialog stays open as a Radix Dialog with its own focus trap (website/src/components/crew/CrewEditorNextDialog.tsx:496). layer: 'top' only changes which one paints on top (Modal.tsx:31-37). Recovery: none in the code I opened; a mouse still works.

  • Fix cost: small. The editor already renders a Radix discard confirmation (CrewEditorNextDialog.tsx:1085), so the fix is to reuse that pattern or one shared Radix-backed confirm with caller labels. No new cross-module contract is needed.

    [ADJUDICATION] d275fd1 total=1 uphold=1 downgrade=0
    UPHOLD F1 website/src/pages/members/MembersPage.tsx:610 reason=harm-warrants-remedy
    [GPT-ADJUDICATED] d275fd1

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d275fd1

@abirkel
abirkel force-pushed the fix/native-renderer-dialog-migration branch from f061753 to 92ee064 Compare October 18, 2026 09:37
@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 Oct 18, 2026
@abirkel
abirkel force-pushed the fix/native-renderer-dialog-migration branch from 92ee064 to 752c19d Compare October 18, 2026 09:43
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 18, 2026
@abirkel
abirkel force-pushed the fix/native-renderer-dialog-migration branch from 752c19d to d5de4f5 Compare October 18, 2026 09:48
@abirkel

abirkel commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. d5de4f541 is rebased onto current main and addresses every finding raised against f0617530d:

Design review (BLOCK) and UX review (BLOCK): missing rendered evidence. The description now embeds eight dark and light screenshots, committed under .github/screenshots/15662/. They show the session-close confirmation, the text prompt, the prompt's required-value error and an error notice. They come from a capture page that mounts the real ConfirmDialog, TextPromptDialog and ErrorNotice components with their shipped strings, in the repo's website/capture/ pattern. The description explains why a live dashboard session was not used.

UX review: confirm labels.

  • The web-app teardown button now reads "Tear down application", not "Cancel / Tear down".
  • The four chat-sidebar confirmations now use short action labels instead of repeating the question on the button.
  • An empty submit in TextPromptDialog now shows "A value is required." instead of repeating the title.

Design review: the two sites the old ratchet kept on purpose. Both now use the themed confirmation with the same decision as before, and the PR notes that #700's undo question stays open.

First-principles review. I removed the surface that had no callers: the unused TextPromptDialog options, textPromptOpen, the promptText alias and the duplicate publishAppNotice export. The Back attempt's target field is gone, and windowConfirmRatchet.test.ts is deleted now that the lint rule covers every renderer file with no exemptions.

GPT review: NewCrewmateDialog blocking exits during creation. Restored: leaving mid-create asks again, as on main, now in the themed dialog.

Opus review.

  • AskAgentButton and ErrorNotice now await the async hand-off, so a refused or failed hand-off keeps the diagnostic open.
  • A same-URL target skips only the question and still runs the handler.
  • The session confirmation host sits above the Radix menu, and the theme confirmation host sits above the editor modal, so neither unmounts mid-question.
  • Knowledge bulk delete now uses the plural count string.
  • The Papyrus delete label now passes {{file}}.

Validation on the rebased head: ESLint with zero warnings, TypeScript, the i18n key check and the affected frontend suites (67 files, 2,230 tests) pass.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running 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: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 18, 2026
@abirkel
abirkel force-pushed the fix/native-renderer-dialog-migration branch from d5de4f5 to 7012f17 Compare October 18, 2026 17:51
@abirkel

abirkel commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 7012f17ac, rebased on current main. It answers the reviews and CI failures on d5de4f5:

Design review (BLOCK): nested guardedLeave dropped the guide's Start, Take over and Replay. Fixed. The exit attempt now covers only the question and is released before perform runs, so GuideContext's inner guardedLeave(() => enter(next)) goes through. With no confirmation shown, the answer is synchronous and perform runs in the same click as on main. That covers the Watch item too, and the readers are now listed under Backwards compatibility. The same fast path applies to the rail rows, the palette, error hand-offs, pop-out intents and side-panel tabs.

UX review (BLOCK): appNotice failures were silent. Fixed. appNotice now also raises the live notification event, so the banner shows the failure where the user acted. It still lands in the feed too.

UX review (evidence gaps). The capture page now renders all 33 migrated call sites with their shipped strings and options: every leave-without-saving dialog, the Prompts and Memory discards, all three text prompts, every delete or remove confirmation, Restart, replace-import, Tear down, and the new inline notices. They are laid out as contact sheets in the description, in both themes.

UX review (Tear down title repeats the button). Fixed. The title is now "Tear down this deployment?", a new key in every locale, and the button keeps "Tear down application".

GPT review (fenced): error hand-offs could discard an unsent Nudge. Fixed. Research Lab's campaign view registers a leave guard while a nudge draft is non-empty, so a hand-off to chat asks first.

GPT and Opus: the row ✕ close confirmation was never mounted. Fixed. ChatSidebar renders sessionActions.confirmDialog.

Opus: the Tear down resource list collapsed onto one line. Fixed. The body keeps one resource per line.

First-principles (undeclared): the ErrorNotice menu stayed open after a hand-off. Fixed. The menu closes as before when the hand-off completes in the click. It stays open only while the page's leave confirmation is still pending.

CI. The frontend shards and E2E failures came from tests and specs that still drove a browser confirm, plus the async delay above. All are now driven through the themed dialog. One real bug turned up this way: the board's tag-filter popover closed itself on the confirmation's click and cancelled the delete. Backend shard 1 (test_platform_compat_process_identity) touches no file in this PR. MarkdownRenderer.domGolden fails identically on main.

Fork workflow-change guard. This blocks the PR because the screenshots live under .github/screenshots/15662/, the path the repo's screenshot-evidence check reads. A maintainer needs to review them and apply allow-fork-workflow-change.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Oct 18, 2026
@abirkel

abirkel commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

I added the evidence the UX review asked for and rebased on current main.

  • Web-app card tear-down button. The apps sheets now include the real WebAppArtifactCard footer with its "Tear down deployment" button. Headless screenshots do not render native tooltips, so the scene reads the button's own title and paints that text beside it. I also corrected the scene count in the description.
  • Error text in the bell feed. The reload and duplicate failures keep the wording main already showed in alert(). Mapping status codes to user-facing causes would be new wording outside this PR's goal.
  • "Cancel" on the close-session question. This is intended. Closing a session keeps its conversation and draft, so there is nothing to keep editing.
  • Memory leave title. That sentence is main's existing wording.

Backend shard 2 hit the same test_facade_mirror_guards.py timeout again, and the Coverage Gate failed only because of it. Would a maintainer rerun both? The allow-fork-workflow-change label and the earlier asks still stand.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 20, 2026
@abirkel

abirkel commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Hi @KiroCrewCaptain and @dodgeblaster,

Thank you for your patience with this one. I think the PR is ready for a maintainer review. On the current head, no bot review is blocking, the branch is rebased on main with no conflicts, and I've addressed or answered every finding in the comments above.

Two things still need a maintainer, since I can't do them from a fork:

  • Add the allow-fork-workflow-change label so the screenshot sheets pass the fork guard.
  • Rerun backend shard 2 (the test_facade_mirror_guards.py timeout, which also shows up on unrelated branches) and the Coverage Gate that depends on it.

Would you review it when you have a moment, and merge it if it looks good to you? I'm happy to make any changes you'd like.

Thanks.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 21, 2026
@abirkel
abirkel force-pushed the fix/native-renderer-dialog-migration branch from 71118c3 to 4cf1483 Compare October 22, 2026 00:19
@abirkel

abirkel commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on current main to clear a merge conflict. The new head is 4cf1483fa.

  • docs/feature-map/README.md and website/src/i18n/pluralKeys.json conflicted with rows main changed. I kept main's rows and this PR's own additions in both.
  • KiroCrewAgentsPage.discardGuard.test.tsx, added on main by feat(crew): edit crewmates on the Customize tab with the shared editor #21748, imported useMayLeaveForNavigation, which this PR removes. It now reads the leave answer through the same test helper the other guard tests use, and all 17 of its tests pass.

There are no other changes. The type check, lint, the i18n and feature-map checks and the related frontend tests pass. The earlier asks for the fork label and the backend shard 2 rerun still stand.

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 22, 2026
@abirkel

abirkel commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on current main to clear a merge conflict. The new head is dda67704f.

  • feat(notifications): stack notes by sender, clear by group #22744 replaced the notifications Clear all question with a press-twice button, so main no longer has a native confirm there. I took main's version of the feed and the bell sheet, and dropped this PR's Clear all dialog, its two test files, its clear_failed strings and its three screenshot scenes. The description now says 53 scenes.
  • The two New mate test files kept this PR's dialog-based checks, with main's "mate" wording.
  • Two tests from main needed the async leave answer this PR uses (MembersPage.schedules), or the new meeting note in a mock (MeetingsAttachmentPrompt).

The type check, lint over website/src, the i18n check and all 773 related frontend test files pass. The label and rerun asks from my earlier comment still stand.

@abirkel

abirkel commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (1b91dd96b) to clear the conflicts. Two upstream additions brought new native dialogs into files this PR already migrates, so they now use the in-app surfaces too:

The leave guard keeps #24786's multi-step history jumps: the Back trap still asks only for a one-step Back, and any other jump is asked about in-app. The type check, lint, the i18n checks and the 2,230 related frontend test files pass.

@abirkel

abirkel commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

I rebased onto current main and pushed 458d96a99. This fixes the Opus block and the i18n failures from the last run.

Opus 5.5 Review (blocking)

  • Escape on the gallery's delete question no longer closes the Gallery window. The inline dialog now marks the Escape that answers it as prevented, and the gallery's window handler skips a prevented Escape. The render-time "question open" flag is gone. A new test forces the re-render between the two listeners that a real key press causes, and it fails without the fix.

Frontend Tests 1-4 (i18n)

  • The previous rebase brought back pages.channelPage.click_new_to_create_one in every locale after main had removed it. That caused the register style tests (de, fr, ru, bn, hi) and the dead-key count to fail. It is removed again.

Conflicts with main

  • ChannelPage: feat(web): confirm clear-context in the page and acknowledge the result #11157 moved clear-all to the in-page dialog. I kept main's version and converted the two remaining native confirms (close channel and per-agent clear) to the same dialog. The per-agent tests now answer that dialog.
  • useAskingNavigate (from main): it now asks through the same leave attempt as the other exits, so a page that shows a discard question gets an answer before the navigate runs. showCreatedChat passes that answer on, and the palette and the new-chat shortcut stage their follow-up only once the user agrees to leave. A new test covers the decline and accept paths.
  • SteeringTab, SourcesList, shellKeyboard, paletteActions, pluralKeys.json and the feature-map row keep both sides.

@iamwhatever

Copy link
Copy Markdown
Contributor

Heads-up on one overlapping hunk: PR #25951 moves the ChannelPage per-agent Clear context confirm to useConfirm, and also closes that dialog when its agent or channel leaves while it is open. Both PRs touch the same line in website/src/pages/ChannelPage.tsx. Whichever lands second can drop or keep that hunk, and we are happy to rebase ours.

🤖 AI-assisted comment 🤖

@abirkel

abirkel commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main to clear the conflict. Two upstream changes needed more than keeping both sides:

  • AgentSwitchNoticeBanner (new on main) navigated through useMayLeaveForNavigation, which this PR removes. It now uses useAskingNavigate, so its delayed navigate waits for the discard answer like the other create-then-show callers.
  • fix(channel): ask the per-agent clear through the in-page dialog #25951 had already moved the channel's per-agent clear onto the in-page dialog, so I took main's version of that handler and its test.

Two new upstream tests were updated for this PR: the Mates swipe tests answer "Keep editing" (the leave dialog's cancel label here), and the session-menu reference test renders the menu with its actions.

I also added the allow-fork-workflow-change label for the screenshot sheets under .github/screenshots/.

@abirkel

abirkel commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

I added a second commit with fixes from another review pass, and rebased onto current main:

  • The Add to knowledge and Export as artifact error notices in Research Lab no longer offer the agent hand-off, because the campaign can still hold an unsent Nudge or answer.
  • The native-dialog lint rule now also catches globalThis.* and self.*, and the prompt() message names useTextPrompt(). A new test lints each spelling, including the computed and destructured forms.
  • Five side-panel leave checks return a plain true again when nothing is unsaved, instead of a promise.
  • Duplicated test helpers moved into shared files, a few repeated tests were merged, and stale comments were shortened.

@abirkel

abirkel commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main to clear the conflict. Some newer code on main read the leave check as a plain boolean, and this PR lets it answer later with a promise, so I adapted those callers:

  • The palette's navigate (fix(chat): send an in-window auto-send hand-off on a mounted ChatPage #27229 made it return whether it went) now returns the answer, a promise while a discard question is open. The Command Bar waits for it before it stages an auto-send, so a "stay" still leaves only a seed.
  • The milestone starter (useRunStarter) asks through the shared exit claim and waits for the answer before it creates a chat.
  • The app pop-out and hard-exit paths in navIntent and errorReport, and the Knowledge page's single bulk-action notice, keep main's behavior around this PR's async settle.

Two Knowledge tests now answer the in-app dialog instead of stubbing confirm. I re-added the allow-fork-workflow-change label after the push.

The Add to knowledge and Export as artifact error notices in Research
Lab offer an agent hand-off. The campaign can still hold an unsent
Nudge or answer at that point. Opening the chat unmounts the campaign
and loses that text.

The lint rules flag the bare dialog names and window.confirm(), but
globalThis.confirm() and self.confirm() pass. The same holds for alert
and prompt. The prompt() message tells developers to use "the native
text-entry dialog", which names no component.

Five side-panel leave checks are async functions, so they return a
Promise even when nothing is unsaved. A clean pane then waits on that
Promise before it changes tabs.

Drop the hand-off from those two Research Lab notices. Add globalThis
and self to the lint rules, and name useTextPrompt() in the prompt()
message. Add a test that lints each spelling.

Return a plain true from a clean leave check, and a Promise only while
a confirmation is open.

Move duplicated test helpers into shared files and merge repeated
tests. Shorten stale and overlong comments.
@abirkel

abirkel commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

This push fixes the two blocking review findings on the previous head, and the wider cases behind them:

  • A confirmation or text prompt whose dialog is not on screen now answers "stay" on its own, so it can no longer hold the leave guard and freeze in-app navigation. useConfirm and useTextPrompt handle this centrally. Pages whose question should survive a failed refetch (agent config, artifact detail, the artifacts library) also render it on their loading and error branches.
  • A confirmation opened over another dialog now makes that dialog inert until the confirmation has fully closed, then returns focus to it. This covers Create prompt, New crewmate, the theme editor and the Invite dialog. Modal gains an onExitComplete prop for this.

Each fix has a test that fails without it. I also rebased onto current main and re-added the allow-fork-workflow-change label.

@abirkel

abirkel commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing this in favor of a series of small PRs. At 209 files it was too large to review, and it needed a rebase every few days.

The series is tracked as Part of #15976. The first three are open:

The per-area migrations follow one at a time, each removing its own rows from the native-dialog allowlist in website/eslint.config.js. I will link them from #15976 as they open. The work from this PR stays on the fix/native-renderer-dialog-migration branch of my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-fork-workflow-change fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants