feat(desktop): Alt+wheel to scale the pet, never cropped - #52877
Merged
Conversation
Hold Alt/Option and scroll over the mascot to resize it (same on Mac and Windows); the modifier keeps a plain scroll passing through to the page. The gesture drives the same `display.pet.scale` path as the settings slider. The popped-out overlay grows its OS window to fit the pet at any scale (anchored bottom-center) so the sprite is never clipped by the window edge, and the in-window pet re-clamps against its actual size so growing near an edge can't crop it. Also makes the overlay click-through per-pixel: only solid sprite pixels (plus bubble / mail button) are interactive, transparent margins pass clicks through.
Alt+wheel now scales about the pixel under the pointer instead of growing from a corner, so the pet stays put under the cursor instead of running away. In-window shifts its top-left; the overlay repositions its OS window (cursor-anchored on wheel, bottom-center for slider-driven changes).
5 tasks
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 29, 2026
…ch#52888 from kshitijk4poor/chore 2b86e9d Merge pull request NousResearch#52877 from NousResearch/bb/pet [analysis]
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…gesture feat(desktop): Alt+wheel to scale the pet, never cropped
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…gesture feat(desktop): Alt+wheel to scale the pet, never cropped
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…gesture feat(desktop): Alt+wheel to scale the pet, never cropped
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…gesture feat(desktop): Alt+wheel to scale the pet, never cropped
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…gesture feat(desktop): Alt+wheel to scale the pet, never cropped
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
preventDefaultwhile Alt is held). Drives the samedisplay.pet.scalepath as the settings slider, so the two stay in agreement and it persists.How it's wired
usePetZoomGesture— small hook, native non-passivewheellistener, reads live scale from$petInfo, no-ops unlessaltKey. Emits the new scale plus a{ clientX, clientY, ratio }anchor. Used by both the in-window pet and the overlay.nextScaleFromWheel(pet-gallery) — pure multiplicative step clamped to the slider range.overlayWindowSize(pet-overlay) — single source of truth for overlay window dims at a given scale; used by both pop-out and the live resize.electron/main.cjs—set-boundsbriefly flipsresizableon when the size actually changes (Electron 40 ignores programmatic resize on non-resizable windows on Win/Linux); pure drags untouched.scalecontrol message persists through the main window's gateway (the overlay has none).pet-spritecanvas opts intowillReadFrequentlyfor the per-pixel alpha sampling.Math — zoom toward the cursor
Standard "zoom about a point": as the sprite scales by
ratio = newScale / oldScale, every pixel's offset from the anchor scales by the sameratio. To keep the anchor pixel fixed on screen, move the origin by the growth of that offset.ratiois clamp-aware (it'snext / baseafter clamping to the slider range), so at the min/max boundratio = 1and nothing drifts.In-window pet (origin = the element's top-left
pos, anchor = cursor in viewport coords):The
(cursor − pos)is the cursor's offset inside the pet; scaling it byratioand subtracting fromcursorgives the new top-left. Result is clamped to the viewport so the whole sprite stays visible.Overlay (the OS window moves; the sprite is laid out bottom-centered at window-local
B = (W/2, H − padBottom)and scales aboutB):Let
abe the anchor in window-local coords (the wheel cursor; for a slider change with no cursor we fall back toa = B, which makes the term below vanish). The window-local anchor maps to screenscreen + a. After scaling, the sprite's bottom-center must land where the anchor's scaled offset still resolves to that same screen point, so the new window origin is:where
Bnew = (Wnew/2, Hnew − padBottom). Witha = Bthis collapses tooriginNew = screen + B − Bnew, i.e. pin the feet. One formula covers both wheel and slider.Test plan