fix(desktop): cap emoji picker search-icon size in shadow root - #5229
fix(desktop): cap emoji picker search-icon size in shadow root#5229kchung wants to merge 2 commits into
Conversation
The emoji-mart picker renders its search magnifying-glass ("loupe") and clear controls as inline SVGs sized by emoji-mart's own shadow-root stylesheet. When that stylesheet hasn't applied at first paint — observed in the Tauri/WebKitGTK webview on Linux, where shadow-DOM style application can race the paint — the loupe falls back to its intrinsic size and balloons into a giant icon covering the search field and emoji grid.
Inject a small defensive stylesheet into every picker's shadow root that hard-caps the search-icon size. It reuses the existing shadow-DOM plumbing in disableSearchInputCorrections (which every call site already runs), is idempotent via an id guard, and only ever shrinks a runaway icon: the 1.3em values match emoji-mart's intended glyph size, so it is a no-op when emoji-mart's own CSS is present.
Co-authored-by: Kevin Chung <chung@squareup.com>
Signed-off-by: Kevin Chung <chung@squareup.com>
Verification — dev server + before/afterBooted the desktop dev server ( Reproduced the reported bug and confirmed the fix constrains it:
Measured directly from the shadow root via Left (red): the runaway loupe covering the search field + "Frequently used" row. Right (green): with this PR, the loupe is a small glyph tucked back inside the search box. I also confirmed via the live shadow DOM that this PR's Full gate (run locally at HEAD)
|
Co-authored-by: Kevin Chung <chung@squareup.com> Signed-off-by: Kevin Chung <chung@squareup.com>
|
Closing per Kevin Chung's request — another contributor is picking up this work. Diagnosis + fix left here for reference. |

What
Cap the emoji picker's search-icon size inside the
<em-emoji-picker>shadow root so a runaway magnifying-glass ("loupe") can't balloon over the search field and emoji grid.Why
emoji-mart renders the search bar's loupe and clear controls as inline SVGs and sizes them with a stylesheet it injects into its own shadow root. When that stylesheet hasn't applied by the time the SVG paints, the loupe falls back to its intrinsic size and renders as a giant icon covering the search input and the "Frequently used" row (see screenshot).
This is not a Buzz regression:
5.6.0) has never been bumped since —git logonEmojiPicker.tsx,desktop/package.json, andpnpm-lock.yamlshows only release-tag commits, no functional change to the picker.#nav svg) but never the search loupe.docs/linux-rendering-troubleshooting.md, though that doc doesn't cover this one).How
Inject a tiny defensive stylesheet into every picker's shadow root that hard-caps the search-icon size. It:
disableSearchInputCorrections, which every call site already runs (composer, reactions, status), so all pickers are covered — not just the avatar editor.#buzz-emoji-search-icon-fixid guard prevents re-injection).1.3emvalues match emoji-mart's intended glyph size, so it's a no-op when emoji-mart's own CSS is present..iconcovers the current markup;svgdirectly under.searchguards against markup shifts across emoji-mart versions.Testing
biome checkpasses clean on the changed file (run via the repo's hermitbiome).tsc --noEmit/biome check ./ unit tests could not be run locally in this environment:corepackcan't fetchpnpm(self-signed cert in the chain), sodesktop/node_modulesisn't installed. Relying on CI to run the full desktop lint/typecheck/test gate.🐝 Filed from a Buzz channel. Opened as a draft per standing preference.