Repository navigation
fix(browser): keep emoji panel on screen with compact chat list - #1035
jhordanleandro wants to merge 2 commits into
Conversation
WhatsApp Web centres the emoji, GIF and sticker panel on the composer button without clamping it to the viewport. With the 85 px compact chat list the panel opened about 117 px off-screen to the left. In compact mode, start the panel to the right of the chat list instead. Tests: new regression test (fails without the CSS rule); full suite run in the Flatpak with only the failures that already occur on main. Fixes rafatosta#1026
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce72b3ae01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pointer-events: none; | ||
| } | ||
| :root[${compactAttribute}] div[role="application"]:has([data-testid="expressions-panel"]) { | ||
| left: calc(var(${columnWidthProperty}, ${minimumColumnWidth}px) + 8px) !important; |
There was a problem hiding this comment.
Use the measured column width when the variable is absent
When the script starts in a narrow window with no saved width, applyColumnWidth() clears --zapzap-chat-list-width, but positionHandle() still marks any measured column under 200px as compact. A native 150px column therefore uses this 85px fallback and places the panel at 93px, inside the chat list and over its rows; use the measured column edge when the variable is absent.
Useful? React with 👍 / 👎.
| pointer-events: none; | ||
| } | ||
| :root[${compactAttribute}] div[role="application"]:has([data-testid="expressions-panel"]) { | ||
| left: calc(var(${columnWidthProperty}, ${minimumColumnWidth}px) + 8px) !important; |
There was a problem hiding this comment.
Clamp the expression panel to the WebView width
For a 600px WebView and the 560px panel width modeled by the new test, an 85px compact list makes this position start at 93px, leaving the panel's right edge at 653px—53px beyond the viewport. The change therefore still clips the panel in narrow or resized windows; clamp its position to the available viewport width or reflow it.
Useful? React with 👍 / 👎.
The compact-mode rule read --zapzap-chat-list-width, which is only set when a custom width is applied. In a narrow window with no saved width the list can be compact at its native width, so the rule fell back to 85 px and placed the panel over the chat list. Publish the measured column width on every layout pass and use it instead. Tests: new regression test with a native 150 px column and no saved width (fails without the change); full suite run in the Flatpak with only the failures that already occur on main.
|
Thanks for the review. I pushed a fix for the first finding: the rule now uses the measured column width, which is published on every layout pass, instead of I did not change the second finding (clamping the panel to the viewport width). The panel width is controlled by WhatsApp Web, the 560 px in the test is only an example, and I could not check the real panel's containing block without a logged-in account, so I would rather not add a clamp I cannot verify. The narrow-window clipping is also not what #1026 reports. Happy to look into it separately if you want it handled here. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #1026
Problem
WhatsApp Web positions the emoji/GIF/sticker panel with an inline
leftthat centres it on the composer button, without clamping it to the viewport. With the 85 px compact chat list the panel opened about 117 px off-screen to the left.Change
Add a rule to the chat list stylesheet in
resizable_chat_list.js: in compact mode,div[role="application"]:has([data-testid="expressions-panel"])getsleft: calc(var(--zapzap-chat-list-width, 85px) + 8px) !important, so the panel starts to the right of the chat list. It is the rule proposed in the issue, plus a fallback value in case the width variable is not set. The rule only applies in compact mode, so the normal layout is untouched.Also adds a changelog entry and a regression test.
Tests
test_compact_mode_keeps_expressions_panel_inside_the_window: fails without the rule (-117 != 93) and passes with it; the panel goes back to its native position when the feature is disabled.main(dictionary UI, zh_CN catalog, accounts context menu, macOS packaging).check_unused_code,test_documentation_structureandgit diff --checkpass.The test uses a simplified DOM, not the real WhatsApp Web, so I have not verified the rule against the live page.