Repository navigation
Fix emoji panel remaining visible after SPA navigation - #266
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Browser test files that share a session also share IndexedDB, so an upload ticket left by one file could make comment-form submission recover a stale pending submission and never post in another file. Delete the draft database in afterEach together with localStorage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On sites that navigate without a full reload (Swup, Turbo, PJAX), the comment
widget's emoji panel is a shared element appended to
document.body, while itsvisibility relied on a
<style>element injected intodocument.head.SwupHeadPlugin removes runtime-injected head tags that are not part of the
incoming document before replacing the page content. After the first in-site
navigation the panel therefore lost its
display: nonerule and reappeared atits last position. It could not be closed afterwards because the new page's
buttons were in the closed state and the previous button had been removed.
Fix
displaystyle, so hiding nolonger depends on the injected stylesheet.
missing or detached.
disconnected pickers as unusable.
import, so navigation during the first load cannot reopen the panel.
Reproduction
Before the fix, the panel reappeared at its last position and could not be
closed. After the fix it stays hidden, and navigating while the panel is open
also closes it.
Validation
pnpm -C packages/comment-widget test— 38 test files / 190 tests pass.pnpm exec tsc --noEmit -p packages/comment-widget/tsconfig.json— pass.biome checkon the changed files — pass.Added browser regression tests covering style removal, pages without the
comment widget, navigation while open, whole-body replacement, an interrupted
first load, reattached buttons, and concurrent first opens.
Fixes #264
plugin-comment-widget-3.5.1-build.266.jar.zip