Replace window.confirm with overlay dialogs in Excel add-in
Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
Fix a bug where Safe/Confirm mode broke because window.confirm is unsupported in the Office WebView, then sweep the rest of the codebase to remove all window.confirm usage in favor of a shared overlay dialog.
- +0Prompt · +0Safe/confirm mode is throwing 'Function window.confirm is not supported'. Investigate, fix, open a PR, handle the automated review, and merge when green. Then look for refactor opportunities and repeat.
- +0mAgent did · +0mExplored the codebase for window.confirm usages, built a new tool-approval-dialog.ts overlay component, wired approval callbacks for workbook mutation/Office.js/Python-bridge gates, updated tests, ran lint/typecheck/build/tests, committed and opened PR #280.
- +12mAgent did · +12mPolled for the automated Codex PR review, found a P1 comment about losing cancellation while awaiting approval, fixed the abort-signal handling across all three gate types, re-ran checks, pushed, waited for CI, and merged PR #280, then cleaned up branch/worktree.
- Break · 40m away, not counted
- +26mPrompt · +26mAsked 'what's next?' then approved doing a follow-up sweep to remove all remaining window.confirm calls across the app.
- +28mAgent did · +28mCreated a new worktree, found remaining window.confirm calls in recovery/resume/extensions overlays, files dialog and tab-close flow, built a shared confirm-dialog.ts overlay, migrated every call site, deleted the old tool-approval-dialog in favor of the shared one, ran full check/build/test suite, committed and opened PR #287.
- +40mAgent did · +40mWaited for CI checks on PR #287 (no reviewer comments this time), confirmed all checks green, merged the PR, deleted the remote branch and local worktree/branch.
- +1h 5mPrompt · +1h 5mReported that the /extensions overlay UI is confusing and the Snake extension is broken; asked to investigate both.
- +1h 5mAgent did · +1h 5mUsed a headless browser to reproduce both issues live, read extension-module-import.ts and extensions-overlay.ts, and traced the snake bug to a glob-availability check that always returns null due to Vite's compile-time replacement of import.meta.glob, plus a related import.meta.env.DEV read issue; also reviewed the confusing extensions overlay markup.
- +1h 15mPrompt · +1h 15mAsked for the implementation plan to be written to an untracked .md, then asked for extra-clear phrasing guidance since a different, less UX-savvy model would implement it.
- +1h 16mOutcome · +1h 16mWrote a detailed 224-line implementation plan to .research/fix-extensions-and-snake.md with exact diffs, copy strings, and a 'what not to change' section for a lower-taste model to implement; two PRs (#280, #287) removing window.confirm were merged in this session, but the extensions UI/snake fix itself was left as a planned follow-up, not yet implemented.
Next time I'd front-load the exact list of window.confirm call sites in the first prompt so the agent doesn't have to rediscover them twice across two PRs. The Codex review catching the missing AbortSignal handling around the approval gates was the correction that actually mattered — the agent applied it cleanly and it shipped. For the trickier snake/UX investigation I made it write out an explicit, copy-exact implementation plan before handing off to a less capable model, which felt like the right call given the phrasing sensitivity.