Repository navigation
fix(pages): ask in-app before artifact, channel and Knowledge actions - #30515
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The six native Notes
[DESIGN-REVIEWED] b2a88e4 Description read[DESCRIPTION-READ] fa5d7f30931889e32a966753e299bb1312cf29f01507f7cc5a6746679bee2b9a 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 |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The screenshots show all seven dialog states (revert, artifact removal, channel close, Knowledge item delete, both source-removal wordings, bulk delete). No blind reader has read them, because this is the fork lane; pushing the branch to this repository runs that read. Notes
[UX-REVIEWED] b2a88e4 Description read[DESCRIPTION-READ] 942038b25700d94cb4b28cec88a5d03dfe820098cd6fba35ea66e15c79436133 That sha256 names everything this verdict read: the PR description, plus the 10 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
3d2322c to
f95b343
Compare
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (9 items) — 9 justifiedIntent: stop six artifact, channel and Knowledge actions from opening an OS dialog that leaves the Windows window ignoring the keyboard (#15976). This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] b2a88e4 Description read[DESCRIPTION-READ] 689b50e77849a5479c699b14620fed1df8a6786fa2e3c743b5f932e783f99795 That sha256 names the PR description this verdict read. Recompute it with |
f95b343 to
7de35c4
Compare
7de35c4 to
fc1efad
Compare
fc1efad to
b211f63
Compare
Code change approver recommendation: A person should decideWhy: the decider raised 1 possible problem and estimates a 60% chance that this change introduces a defect; a person should check it. I'm requesting changes. The PR replaces six native confirm() calls with the in-app useConfirm dialog, and most of the stale-state handling for the non-blocking dialog holds up. The exception is the new channel-close guard, where I confirmed the GPT lane's finding in the code. It decides whether to leave the narrow detail view by comparing the stale Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
a81ba02 to
773581a
Compare
773581a to
152051e
Compare
Six actions asked through the browser-native confirm(): reverting an artifact version, removing an artifact from the library, closing a channel, deleting a Knowledge item, removing a Knowledge source and bulk-deleting Knowledge items. In the desktop app that is an OS dialog, and on Windows the window can stop taking keyboard input after it closes until it is re-activated (kirodotdev#15976). Each page now asks through the in-app useConfirm dialog. The title is a short action label and the unchanged question is the dialog body, because Modal truncates a title to one line. Each action captures its target before it waits and acts only on a true answer: the artifact slug and versions, the channel id, the item id, the source id and the selected item ids. Each action ignores a second press while its question is open, and the Artifacts and Sources removals ignore a second press on a row whose delete is still in flight. The Live and ingested Knowledge sources keep their distinct wording, and the remove-artifact question keeps its two paragraphs. The in-app dialog does not block the page, so a continuation can finish after the user has moved on. The artifact revert guards its page-state updates with the edit generation read when the question is answered, so it cannot change another artifact's saving, error or version state. It invalidates the same three cache keys, for the artifact it reverted. Switching artifacts withdraws an open question, such as the revert, because the revert body does not name its artifact, and clears the saving flag, so a revert abandoned mid-request does not leave the next artifact marked as saving. Closing a channel clears the selection and leaves the narrow detail view unless the user has selected another channel that still exists. A Knowledge item delete returns to the list only while that item is still the one displayed, and not after its view unmounted, and its optimistic update removes the deleted item's own row rather than the displayed item's. The Knowledge page's Escape shortcut skips while a confirmation is open. Remove the six files from the native-dialog allowlist. Part of kirodotdev#15976
152051e to
b2a88e4
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. On this head the review checked the following:
- All six changed sites, one by one. Each captures its target (slug, channel id, item id, bulk id list) before it awaits the in-app question, then acts only on what the question named.
- The late-response guards: the edit generation in revert,
currentItemIdRefin DetailView, and the selected-and-still-exists check in ChannelPage. confirmDialogrenders in every early-return branch.- The eslint native-dialog allowlist only shrinks, by exactly these six files.
- Each race the body names has a test that holds the request on a deferred promise. These tests contain no sleeps or wall clocks.
Done well: the source-regex test in channelNarrow.test.ts is replaced by real narrow-layout behaviour tests, so the tests now check what the user sees, not the text of the code.
Security: these are destructive-action confirmations in the dashboard UI, not the agent tool-approval gate. Every confirmation is kept. Only the surface that asks changes, from the native confirm() to the in-app dialog. No auth, sandbox or trust-boundary code is touched. The slug shown in the dialog goes through React text escaping, with no innerHTML.
Optional:
ChannelPage.tsx~1205: add a narrow-layout test where the user opens another channel while a slow close is pending, and assert that the detail pane stays open. All four narrow tests today cover only the return-to-list branch.ChannelPage.tsx~1206: pin the close target inpendingClearRef, as the clear questions next to it do. Then a channel that closes remotely also withdraws its own close question. Today a confirm after a remote close is a harmless no-op.- Body only: #30305 already removed the count from the eslint comment lines, and #30516 and #30734 already migrated the five Sibling sweep files listed as "migrated in a later PR". A body edit would fix both.
Problem / Motivation
Goal: Reverting an artifact version, removing an artifact, closing a channel, and deleting or removing Knowledge items and sources ask for confirmation inside the app window instead of in an OS dialog.
These six actions (artifact revert, artifact removal, channel close, Knowledge item delete, Knowledge source removal and Knowledge bulk delete) call the browser-native
confirm(). #15854 added the lint gate against new native dialogs and exempted these files, with the other existing callers, in a shrink-only allowlist. On Windows, a nativeconfirm()from the renderer leaves the window ignoring the keyboard until it is re-activated (#15976).Why it matters
These prompts are among the remaining native calls that can reach the Windows keyboard problem in #15976. Replacing them shrinks that set.
Not a goal
ConfirmDialog.tsxwith its own PR in this series.What changed (motivation → approach → change)
Each page now asks through the in-app
useConfirmdialog. The native question becomes the dialog body unchanged, and the title is a short existing action label, becauseModaltruncates a title to one line and would hide the warning. The Knowledge sources list keeps its two wordings, one for Live sources and one for ingested sources.The old dialog blocked the page, so nothing could change while it was open. The in-app one does not, so each action captures what it needs first: the artifact slug and versions, the channel id, the item id, the source id, or the selected item ids. Each action also ignores a second press while its question is open, and the Artifacts and Sources removals ignore a second press on a row whose delete is still in flight. Three continuations needed more than that, because they can finish after the user has moved on:
ArtifactDetailPage.tsx: the revert captures the edit generation when the question opens and checks it before every page-state update. Navigating to another artifact while the request is pending does not change that artifact's saving, error or version state, and an open question, such as the revert, is withdrawn when the route moves to another artifact, because the revert body does not name the artifact. A late answer is dropped as well. Switching artifacts also resets the saving state inuseArtifactDetailPageDocument.ts, so a revert abandoned mid-request does not leave the next artifact marked as saving. The revert invalidates the same three cache keys, for the artifact it reverted. Its confirm button uses the non-danger style, because a revert keeps the current state in version history.ChannelPage.tsx: closing a channel clears the selection and leaves the narrow detail view unless the user has selected another channel that still exists. If the user opened another channel while the question or the request was pending, that channel stays open. If another client closed the selected channel first and the page was showing a fallback, closing that fallback returns to the list.knowledge/DetailView.tsx: a successful delete returns to the list only while the deleted item is still the one displayed. If the user opened a different item, or the view unmounted, the newer selection stays. The optimistic list update now removes the deleted item's own row rather than the displayed item's.knowledge/index.tsx: the page's Escape shortcut skips while a confirmation is open, so Escape cancels the question without also clearing the selection.ArtifactsPage.tsx: the remove-artifact question has a blank line between the question and its consequence, which the shared string body would collapse, so the page splits it at the blank line into two paragraphs.Every owner renders its dialog in each of its loading, error and content returns.
website/eslint.config.js: the six paths leave the allowlist, and the two comment lines that counted the modules lose the number, matching the same edit #30305 makes.Backwards compatibility
Compatible: the actions, labels and locale keys are unchanged, with no new keys. Only the dialog that asks is different.
Reader: website/eslint.config.js:native-dialog allowlist -- release -- the six removed paths no longer call a native dialog, so lint passes on them under the 'error' gate
Reader: website/src/test/channelNarrow.test.ts:returns to the list when the channel is closed -- release -- replaced by ChannelPageCoverage.test.tsx "returns to the narrow channel list after confirming the selected channel close"
Tests
Each action has tests that Cancel does nothing, that approval acts on the target captured when the question opened, and that the full question renders in the dialog body. The artifact revert also covers navigating to another artifact while the request is pending, for a success and a failure, and the open revert question is withdrawn when the route moves. The revert question also stays open while the page shows its loading, error and not-found states. A leave-guard test checks that the discard dialog still renders in the load-error return, and the guard's own logic is unchanged. Closing a channel covers the narrow layout returning to the channel list, including after another client closed the selected channel, and the source-regex test for that in
channelNarrow.test.tsis removed because the code no longer has that literal shape. Duplicate presses are covered byignores duplicate removal presses while the mutation is pending, and the Knowledge page hasEscape on the bulk-delete confirmation cancels it and keeps the selection. Knowledge delete covers the displayed item changing and the view unmounting before the delete finishes. The Artifacts page covers a scope change while the question is open. Knowledge bulk delete keeps a refused item in the list, and deletes the ids captured when the question opened even if another row is checked before the answer. The converted tests use the sharedwebsite/src/test/confirmAction.ts.Proof: not provable -- frontend test (prove.py runs Python only).
Seven tests in the related run fail in this environment because Vite cannot load a worker from the symlinked
node_modules, inArtifactDetailPage.test.tsx(edit mode keeps Save and Cancel in the row and offers Snapshot from More,Back button confirms before discarding unsaved edits (round 12),Cmd+S triggers handleSave when dirty in edit mode,Cancel button confirms before discarding while dirty,Live dropdown change with dirty buffer prompts before discarding,does not refetch content while the editor is open) andArtifactDetailPage.anchoredComments.test.tsx(does not offer anchored add while editing), all withDenied ID .../@pierre/diffs/dist/worker/worker-portable.js?worker&url. The same seven fail by name and error on an unmodified checkout of the base commit run the same way, so they are not caused by this change.Manual verification
The real page components were rendered with stubbed API responses in headless Chromium, and each confirmation was opened by clicking the real control (screenshots below). A live desktop build was not run.
Screenshots / video
Artifact revert:
The other dialogs
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 search also matches comments and in-app
confirm({...})calls in other files, none of which is a native dialog.Swept:
git grep -nE "(window\.)?\bconfirm\(" origin/main -- website/src/pages ':!*test*' | grep -v "await confirm"and the same search foralert\(andprompt\(Sibling: website/src/pages/members/MembersPage.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/members/NewCrewmateDialog.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/AgentTemplatesTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/KiroCrewCfgTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/MemoryTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/PortabilityTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/PromptsTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/SkillsTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/overview/SteeringTab.tsx -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/pages/ProjectsPage.tsx -- tracked in #15976 -- allowlisted native alert and prompt, migrated in a later PR of this series.
Sibling: website/src/pages/overview/AgentCfgTab.tsx -- tracked in #15976 -- allowlisted native alert, migrated in a later PR of this series.
Sibling: website/eslint.config.js -- tracked in #15976 -- the allowlist names every remaining native caller, including alert and prompt callers.
Pattern harvest
Rule candidate: lint
Pattern: renderer calls to native confirm, alert and prompt, already refused outside the allowlist by
no-restricted-globalsandno-restricted-propertiesinwebsite/eslint.config.js(#15854). This PR shrinks that allowlist.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.