Skip to content

Fix collapse of long user messages after switching chats#19

Merged
11me merged 2 commits intomasterfrom
fix/user-collapse-spa-reattach
Feb 9, 2026
Merged

Fix collapse of long user messages after switching chats#19
11me merged 2 commits intomasterfrom
fix/user-collapse-spa-reattach

Conversation

@11me
Copy link
Copy Markdown
Owner

@11me 11me commented Feb 9, 2026

Problem\nLong user messages could fail to collapse after switching chats in ChatGPT SPA until a full page refresh.\n\n### Fix\n- Rebind user-collapse on SPA navigation (popstate/pushState/replaceState) with href-based detection and guard against double patching.\n- Handle DOM recycling via attribute-mutation observation and container replacement reattach.\n- Harden unit tests (observer selection + teardown).\n\n### Testing\n- Unit: npm test\n- Manual E2E: Brave via CDP (agent-browser connect 9222), verified toggle appears after switching chats without refresh.

11me added 2 commits February 9, 2026 09:56
- Rebind user-collapse observers on chat navigation and DOM recycling

- Handle attribute mutations + container replacement

- Harden unit tests for observer selection/teardown
- Avoid floating promise in navigation coalescing

- Avoid unsafe any member access for patch guard
@11me 11me merged commit 24219ac into master Feb 9, 2026
1 check passed
@11me 11me deleted the fix/user-collapse-spa-reattach branch April 7, 2026 19:59
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