Skip to content
PidebugWeb20 files · +1690 −764

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

1h 16msession
0interventions
GOAL

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.

  1. Prompt · +0
    Safe/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.
  2. Agent did · +0m
    Explored 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.
  3. Agent did · +12m
    Polled 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.
  4. Break · 40m away, not counted
  5. Prompt · +26m
    Asked 'what's next?' then approved doing a follow-up sweep to remove all remaining window.confirm calls across the app.
  6. Agent did · +28m
    Created 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.
  7. Agent did · +40m
    Waited 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.
  8. Prompt · +1h 5m
    Reported that the /extensions overlay UI is confusing and the Snake extension is broken; asked to investigate both.
  9. Agent did · +1h 5m
    Used 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.
  10. Prompt · +1h 15m
    Asked 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.
  11. Outcome · +1h 16m
    Wrote 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.
VERDICT

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.

I tried this · 0

Discussion · 0

How Builds work