Skip to content

fix(chatgpt): clear restored sent prompt draft after page reload - #117

Merged
Manho merged 2 commits into
mainfrom
fix/chatgpt-reload-draft-clear
Nov 22, 2026
Merged

Manho merged 2 commits into
mainfrom
fix/chatgpt-reload-draft-clear

Conversation

@Manho

@Manho Manho commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes an issue in Multi-Panel where directly reloading the browser page (Cmd+R / Refresh button, without clicking Panelize's New Chat button) after sending a prompt to ChatGPT causes ChatGPT to reload / and restore the already-sent prompt into its composer.
  • Records confirmed sent prompts in embedded ChatGPT frames (content-scripts/text-injection-all-providers.js) from both Multi-Panel sends (clickSendButton) and in-panel manual sends (enabled send button click, form submit, or Enter), only after confirming the send (composer cleared, new streaming stop button appeared, or navigation into a conversation route) while ignoring pre-existing streaming stop buttons.
  • Reuses the existing post-mount clear mechanism in match-sent-only, no-focus mode (matchSentOnly: true, focus: false) on / reload, panel refresh, Multi-Panel reopen, and SPA return to / so restored sent drafts are cleared automatically without erasing unsent drafts, stealing focus from #unified-input, or overriding unconditional NEW_CHAT draft clearing.
  • Scopes ?temporary-chat=true draft tracking to sessionStorage instead of localStorage.
  • Adds focused unit tests (tests/chatgpt-content-script.test.js) and a Playwright E2E regression test (tests/e2e/chatgpt-send-all.e2e.test.js).

Verification

  • Passed:
    • node --check content-scripts/text-injection-all-providers.js && git diff --check
    • npx vitest run --maxWorkers=2: 93/93 test files, 1291/1291 tests passed
    • npx playwright test tests/e2e/chatgpt-send-all.e2e.test.js --workers=1: 2/2 passed
  • Not run: Other unrelated Playwright E2E suites; npm run lint (web-ext lint fails on existing MV3 layout)
  • Unverified: Live authenticated ChatGPT session in Chrome

@Manho
Manho merged commit 2b3b702 into main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant