fix: Discord embed polish — resize handles, gesture freeze, auto zoom, compact mode - #123
Merged
Merged
Conversation
…, compact mode - Padded frame: tile body gets a p-2 gutter and publishes the INNER rect, exposing RGL's edge/corner resize handles (previously covered by the fixed z-30 host - only n/ne/nw worked) and framing the embed with the tile chrome; host rounds all four corners now. - Gesture freeze: discordStore.interacting (set by any grid drag/resize via DashboardGrid gesture callbacks) freezes the host's size at the last settled value and mutes its pointer events while position keeps tracking; final size applies once on gesture end. Out-of-gesture size changes settle via a 120ms debounce. Decision logic is a pure helper (nextHostStyle) with unit tests. - Auto zoom: zoomForWidth steps the guest zoom (>=900 1.0 / >=700 0.9 / >=550 0.85 / else 0.75) on dom-ready and on settled-width breakpoint crossings; webview-tag setZoomFactor/insertCSS signatures pinned against electron@33.4.11 typings. - Compact CSS: fail-soft [class*=membersWrap] hide injected on every dom-ready (inserted CSS doesn't survive reloads); server rail and channel sidebar deliberately kept. - Loading splash now Discord dark (#313338) instead of theme surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Phase A of the Discord-widget rework: three defects fixed on top of the (unchanged, load-bearing) app-lifetime
DiscordHostarchitecture.1. Dead resize handles → padded frame
RGL renders handle spans INSIDE each grid item; grid items are transform-created stacking contexts, so no handle could rise above the root-level fixed z-30 host — every handle under the webview (
s/se/sw/e/w) was dead. The tile body now wraps ap-2gutter and publishes the INNER div's rect, exposing RGL's edge/corner hit areas all around the webview and letting the tile chrome visibly frame the embed. Host corners:rounded-b-md→rounded-md(all four are visible inside the gutter).2. Resize/drag jank → gesture freeze + settle debounce
New ephemeral
discordStore.interacting, set/cleared byDashboardGrid'sonDragStart/onResizeStart/onDragStop/onResizeStop(any tile's gesture — harmless when Discord isn't visible). While interacting: host position tracks per frame, width/height FREEZE at the last settled size, and the host goespointer-events:noneso grid mousemoves never hit the guest. Final size applies once on gesture end; out-of-gesture size changes (window resize) settle via a 120 ms trailing debounce. Decision logic is the pure helpernextHostStyle(rect, interacting, settledSize)inapps/renderer/src/widgets/discord/lib.ts— unit-tested.3. Scaling — auto zoom + compact CSS + dark splash
zoomForWidth(width): ≥900px → 1.0, ≥700 → 0.9, ≥550 → 0.85, else 0.75 — applied on webviewdom-ready, re-applied only on settled-width breakpoint crossings and after reload.setZoomFactor(factor): void/insertCSS(css): Promise<string>added toDiscordWebviewElement, pinned against electron@33.4.11WebviewTagtypings.DISCORD_COMPACT_CSShides the members list ([class*="membersWrap"]) on everydom-ready(inserted CSS doesn't survive navigation). FAIL-SOFT: selector rot = stock layout, nothing breaks. Server rail + channel sidebar deliberately kept.#313338) — no theme-colored flash.Out of scope / follow-ups
layoutStore,SettingsModal, IPC/preload untouched;DashboardGridedits are limited to the gesture callbacks.Gates
pnpm testgreen (renderer suite incl. 8 discord lib tests),pnpm typecheckgreen,pnpm lintgreen — re-run after rebasing ontomaster@ feat: accordion expand takes space from the widget below instead of reflowing the grid #122.Verification for Nish (needs the running app — not covered by unit tests)
🤖 Generated with Claude Code