Skip to content

fix(apps): ask in-app before four destructive actions - #30517

Open
abirkel wants to merge 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m02-app-deletes
Open

abirkel wants to merge 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m02-app-deletes

Conversation

@abirkel

@abirkel abirkel commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Deleting a meeting, a Design Tweak request or a Papyrus paper, and committing an Auto Improvement finding, ask for confirmation inside the app window instead of in an OS dialog.

These four actions 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 native confirm() from the renderer leaves the window ignoring the keyboard until it is re-activated (#15976).

Why it matters

These four prompts are among the remaining native calls that can reach the Windows keyboard problem in #15976. Replacing them shrinks that set.

Not a goal

  • Migrating any other allowlisted file. Each remaining one has its own PR in this series.
  • Changing the confirmation wording or the visible buttons of the pages.
  • Making the shared dialog wrap very long unbroken names. That limit applies to every useConfirm caller today and gets its own change.

What changed (motivation → approach → change)

Each page now asks through the in-app useConfirm dialog. The native question becomes the dialog body unchanged, and the title is a short action label, because Modal truncates a title to one line and would hide the warning.

The old dialog blocked the page, so the target could not change while it was open. The in-app one does not, so each action captures its target first and uses only that:

  • AutoImprovementPage.tsx: captures the fingerprint and the repository, URL, clone and branch. Inside the mutation, immediately before the request, it compares those four with the latest configuration and sends nothing if any differ, including after an offline resume.
  • useDesignTweakPageState.ts (with DesignTweakPage.tsx): the delete action moves into the state hook that already owns the page's requests. The new guard covers the question only, so deleting a different request while one is in flight still works.
  • MeetingsPage.tsx: renders the dialog in the list, meeting and settings views. Adds the dialog-only key apps.meetings.list.deleteMeetingButton to the English catalog, the eleven translations and en-XA.json.
  • ProjectList.tsx: the confirm button uses the existing components.commentsSidebar.delete label and keeps the paper name in the body. That avoids a new key but borrows another component's string, and a dedicated key is easy to add if preferred.
  • website/eslint.config.js: the four paths leave the allowlist.

Backwards compatibility

Compatible: the actions, labels and locale keys that exist today are unchanged. Only the dialog that asks is different, plus one new locale key.

The Design Tweak state hook stops exporting errMsg and stops returning setStatus and refresh, because the delete action that used them moved into the hook.
Reader: website/src/apps/design-tweak/DesignTweakPage.tsx:errMsg -- app -- its only use was the delete action, which moved into the hook with it
Reader: website/src/apps/design-tweak/DesignTweakPage.tsx:setStatus, refresh -- app -- only the delete action read them from the hook, and it now lives inside the hook

Tests

Each surface has tests for: Cancel does nothing; approval acts on the target captured when the question opened, even if the list, filter, project or queue changes during the question; a second press is ignored; and the full question renders in the dialog body. Meetings also checks that the dialog stays rendered after switching to the meeting or settings view. Auto Improvement also covers a change to any of the four target fields during the question, after approval before the request, and during an offline pause. Design Tweak covers deleting a different request during a pending call. Six of the seven touched test files share website/src/test/confirmAction.ts, a byte-identical copy of the helper added in #30251, so the two merge without conflict.

Proof: not provable -- frontend test (prove.py runs Python only).

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

Meetings, dark theme:

Meetings dark

Papyrus project list, light theme:

Papyrus light

Auto Improvement, Design Tweak and the other themes

Auto Improvement dark

Auto Improvement light

Design Tweak dark

Design Tweak light

Meetings light

Papyrus dark

Related Issues

Part of #15976. Also relates to #15662, which #15854 closed after adding the allowlist.

Sibling sweep

Swept: git grep -nE "(window\.)?\bconfirm\(" origin/main -- website/src/apps ':!*test*'
Sibling: website/src/apps/papyrus/PapyrusPage.tsx:1011 -- tracked in #15976 -- allowlisted native confirm, migrated in a later PR of this series.
Sibling: website/src/apps/crew-companion/GalleryPanel.tsx:1163 -- tracked in #30305 -- allowlisted native confirm, migrated by the open gallery PR.
Sibling: website/src/apps/mochi/src/renderer/GalleryPanel.tsx:813 -- tracked in #30305 -- allowlisted native confirm, migrated by the open gallery PR.
Sibling: website/eslint.config.js -- tracked in #15976 -- the remaining allowlisted modules are the full inventory, including alert and prompt callers outside apps/.
Checked and not affected: website/src/apps/issue-radar/views/CrewPageView.tsx:302, website/src/apps/meetings/components/AgentPanel.tsx:203 and :226, and website/src/apps/papyrus/PapyrusPage.tsx:560 call the in-app confirm.

Pattern harvest

Rule candidate: lint
Pattern: renderer calls to native confirm, alert and prompt, already refused outside the allowlist by no-restricted-globals and no-restricted-properties in website/eslint.config.js (#15854). This PR shrinks that allowlist.

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.

App repo: KiroCrewCaptain/kirocrew-app-papyrus#5

@abirkel
abirkel requested review from a team and KiroCrewCaptain as code owners November 5, 2026 15:39
@abirkel
abirkel requested a review from iamwhatever November 5, 2026 15:39
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running 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 059b8e262ff26d6ebba01c209ea0ab318dbd2d0d 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. Each item comes from #15976 (a native confirm() leaves the Windows window ignoring the keyboard) or from the in-app dialog not blocking the page.

Notes

  • Item 5 — oversized: "compares those four with the latest configuration and sends nothing if any differ, including after an offline resume". The old native confirm() also never re-checked the target when an offline-paused commit resumed, so that branch does more than move to the in-app dialog. Subtraction: drop the dispatch-time recheck in mutationFn and its offline-resume test. Keep only the target captured when the question opens.
  • Item 6 — undeclared: the commit error changes from a plain <p> to <ErrorNotice variant="inline">, and the description never mentions it. Subtraction: put back the <p className="text-[12px] text-warn"> the base renders.

What this change ships

Inventory (10 items) — 7 justified

Intent: stop four destructive actions in apps from opening a native OS dialog that breaks the keyboard on Windows. This is a FIX.

  1. Deleting a meeting asks in an in-app dialog titled "Delete meeting" — justified
  2. Deleting a Design Tweak request asks in-app, and the delete logic moves into the state hook — justified
  3. Deleting a Papyrus paper asks in-app, using the borrowed "Delete" label — justified
  4. Committing an Auto Improvement finding asks in-app — justified
  5. A commit is refused if the repo, URL, clone or branch changed after approval, including on offline resume — oversized
  6. Commit failure text now renders as an inline ErrorNotice — undeclared, rides along
  7. A second press while a question is open or a request is pending is ignored on all four surfaces — justified
  8. New locale key deleteMeetingButton in 13 catalogs — justified
  9. Four paths leave the native-dialog lint allowlist — justified
  10. The Design Tweak hook stops exporting errMsg, setStatus and refresh — justified

[FIRST-PRINCIPLES-REVIEWED] 059b8e2

Description read

[DESCRIPTION-READ] 713e0f823dfb76ef13bd73e13ef63064f995897dd83e35eb41b3977c51303f55

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 059b8e262ff26d6ebba01c209ea0ab318dbd2d0d 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 concerns: each confirmation captures its target before asking, and the take-away readers listed (errMsg, setStatus, refresh) have no other callers in this tree.

Notes

  • apps/adoption-pins.json pins all four apps, so each fix should land in its app repository first. The description names only kirocrew-app-papyrus#5; it gives no App repo: line for auto-improvement, design-tweak or meetings.
  • When the Auto Improvement target changes during the question, the page shows the generic commitFailed text. A message saying the repository or branch changed would tell the operator why nothing was published.

[DESIGN-REVIEWED] 059b8e2

Description read

[DESCRIPTION-READ] 68c7db0591d01001d5ce567b28aef531f3e5fa0f28f31648ca130136c3e9eb51

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

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

UX-level review of 059b8e262ff26d6ebba01c209ea0ab318dbd2d0d 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 Auto Improvement commit-failure row. The diff restyles it as an inline ErrorNotice with an icon, and it now also shows when the dialog's target changed, but no screenshot shows it.

Evidence gaps

  • Auto Improvement finding row, commit-failed state. The diff changes <p className="text-[12px] text-warn"> to <ErrorNotice variant="inline" …>, which adds a level icon and the notice's colours. It also adds a new way to reach this state: if the repo, URL, clone or branch changes while the dialog is open, the mutation throws autoImprovement.commitFailed. Attachments 01–08 show only the four confirmation dialogs. To close it, attach a still of a finding row showing the commit error, in either theme.

Notes

  • AutoImprovementPage.tsx: when the client aborts because the target changed, the row says "The commit was refused." The code knows the real cause. Say so with a dedicated string, e.g. "The repository or branch changed while you were confirming. Nothing was committed."
  • ProjectList.tsx: the Papyrus dialog's title and button are a bare "Delete" (attachments 02 and 08), borrowed from components.commentsSidebar.delete. The other three dialogs name their object ("Delete meeting", "Delete request"). Add apps.papyrus.page.delete_paper_button = "Delete paper" so the button says what gets deleted.
  • The four dialogs I could see (attachments 01–08) have no visible defects. No first-time reader has looked at them, because this fork lane has no blind read. Pushing the branch to this repository would get one.

[UX-REVIEWED] 059b8e2

Description read

[DESCRIPTION-READ] 9544f066d98162e216a4def18205a3303b4a7617d6d822e59ff64d302f956cd0

That sha256 names everything this verdict read: the PR description, plus the 11 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

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] 059b8e2

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 059b8e2

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 5, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from 22f9834 to dd7f77c Compare November 6, 2026 00:57
@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 Nov 6, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch 2 times, most recently from 3f5ed53 to eccb220 Compare November 6, 2026 04:24
@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 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD (policy: data-deleting paths) at eccb220280481fa648d35d57d8f75d78ee2f6099.

This PR replaces the native confirm() in front of meeting delete, Papyrus paper delete (a server-side rmtree) and Design Tweak request delete, plus Auto Improvement's commit. Because the in-app dialog does not block the page, it also changes how each target is captured before the call. That makes it a change to data-deleting paths, which is reserved for a human reviewer.

I found no concrete defect. Each action captures its target before the question and acts only on that target (Meetings, Papyrus, Design Tweak). Repeat presses are ignored. The Auto Improvement commit re-checks its target at dispatch (AutoImprovementPage.tsx#L302-L309). CI is green at this head.

AI findings judged non-blocking

  • UX Review (PASS) evidence gap: no screenshot of the Auto Improvement commit-failure row now rendered with ErrorNotice. Does not block: ErrorNotice inline is the shared error surface website/AGENTS.md requires and the message text is unchanged (code).
  • UX Review (PASS) note: the target-changed guard reuses 'The commit was refused.' although nothing was sent. Does not block: wording only: nothing is committed, and the user sees a failure and can retry (code).
  • UX / Design notes: Papyrus borrows components.commentsSidebar.delete ('Delete') for the title and button. Does not block: wording/coupling nit; the paper name stays in the body, and the PR offers a dedicated key (code).
  • Opus 5.5 note: pt 'Excluir reunião' and hi wording differ from the surrounding catalog. Does not block: translation wording nit in a new key, no functional effect (code).
  • First Principles (PASS) note: website/src/test/confirmAction.ts is a copy of fix(dashboard): settle useConfirm asks when their dialog disappears #30251's helper (AGENTS.md: one PR owns a shared helper). Does not block: test-only file and byte-identical, so either merge order is clean; no user-visible harm (code).

— crew-pr-reviewer (r148)

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 6, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from eccb220 to 1947616 Compare November 7, 2026 12:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 7, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 7, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 8, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from 1947616 to ecf76ef Compare November 10, 2026 00:50
@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 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
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Nov 11, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from ecf76ef to c2044bd Compare November 12, 2026 00:13
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider raised 1 possible problem and estimates a 65% chance that this change introduces a defect; a person should check it.

The migration from native confirm() to useConfirm in the four pages is careful. Each action captures its target before asking, ignores repeat presses, and has tests. But auto-improvement is an adopted, pinned app, and AGENTS.md requires the fix to land in its app repository first, with the PR naming that commit. The PR names no auto-improvement app commit, and PR Hygiene fails for exactly this reason. Adopted hosts would keep the native dialog, so the stated goal is only met on the wheel-copy path. The Papyrus app reference is also a PR number, not the required commit sha. Secondary, and fail-safe: a refused commit after a target change can be silent.

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 c272d93bea · 562 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 12, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from c2044bd to c272d93 Compare November 15, 2026 05:39
@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: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 15, 2026
Deleting a meeting, a Design Tweak request or a Papyrus paper, and
committing an Auto Improvement finding, asked through the
browser-native confirm(). In the desktop app that is an OS dialog that
blocks the renderer, 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. Every action captures its
target before it waits and acts only on a true answer. Auto Improvement
also compares the captured repository, URL, clone and branch with the
latest configuration inside the mutation, immediately before the
request, so a change while the question is open sends nothing. Design
Tweak's new guard covers the question only, so deleting a different
request while one is in flight still works. Meetings renders its dialog
in the list, meeting and settings views.

Add apps.meetings.list.deleteMeetingButton for the Meetings dialog's
confirm button, and remove the four files from the native-dialog
allowlist.

Part of kirodotdev#15976
@abirkel
abirkel force-pushed the fix/native-dialog-m02-app-deletes branch from c272d93 to 059b8e2 Compare November 18, 2026 02:01

This branch has not been deployed

No deployments
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: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants