Uh oh!
There was an error while loading. Please reload this page.
feat(widget): free placement for the compact widget - #159
Conversation
In free-placement mode, clamp the pill into a placement region that runs the full screen width and down to the physical bottom (so it can sit over the Dock), but is capped just below the menu bar at the top. Nothing hangs off-screen, yet the pill can rest at Dock level. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hiskudin
left a comment
There was a problem hiding this comment.
Read the full diff in context, checked out the branch, and built it locally (make build clean; CI green across all six checks).
Overall: solid. Extracting the geometry into a pure CompactPlacement enum is the right call, and the tests are genuine — degenerate-frame clamp, malformed parse, and frame-origin offset are all covered. Default-on preserves existing behaviour. .snapToCorners is correctly wired into settingsRows, applyCycle, and selectedRowRespondsToArrows, so no half-wired row. Nice catch passing snap into handleSnapModeChange as a parameter rather than re-reading it — see the first inline comment for why that mattered.
Four things worth addressing; the two marked (1) and (2) are the ones I'd want fixed before merge. Details inline.
Also: README not updated
Not anchorable to the diff, so noting it here. README.md:210 still describes the widget settings as "widget (corner, mascot picker, opacity)", and neither STACKNUDGE_COMPACT_SNAP nor STACKNUDGE_COMPACT_POS appears anywhere in the docs — the config table around README.md:248 is where the other user-facing keys live. Repo convention is to keep it current; the last panel PR updated README.md:189 for a smaller behaviour change than this one.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- applyCompactLayout takes an optional `snap` override so the $compactSnap sink (which runs during the @published willSet, when the property is still stale) lays out with the correct value instead of the inverted one. - parsePosition rejects non-finite values (NaN/Inf) so a hand-edited STACKNUDGE_COMPACT_POS can't flow through clamp into setFrame. - Snap-off seeds the free origin from the panel's own screen rather than the cursor's, so keyboard-driven toggling on multi-monitor keeps the widget on its display (cornerOrigin now takes an optional screen). - Document + test the nearestCorner midX/midY tie-break; add a placementBounds test for a display below the main one (negative origin). - Re-align the Settings Widget rows after the new toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
faisalreza-stackone
commented
Aug 21, 2026
On the README note: intentionally leaving the docs unchanged in this PR (author's call). Flagging so it's a conscious decision rather than an oversight — the widget-settings line at |
Uh oh!
There was an error while loading. Please reload this page.
What
Adds an opt-in "free placement" mode for the compact widget (the always-on pill), which until now could only sit at one of four screen corners.
A new Snap to corners toggle in Settings → Widget drives it. It defaults to On, so existing users see no change. Turn it off and the pill stays wherever you drop it.
Behaviour
Settings
New Snap to corners toggle. The existing Widget corner row dims while snap is off, since it has no effect in free mode.
Config
STACKNUDGE_COMPACT_SNAP(true/false, defaulttrue)STACKNUDGE_COMPACT_POS(x,y, the saved free origin)STACKNUDGE_COMPACT_CORNERis unchanged and remains the source of truth while snap is on.Scope
The pill widget only. Notification banners are macOS notifications positioned by the system, and the full expanded panel keeps its own position handling. Neither is touched.
Testing
CompactPlacement): nearest-corner selection, clamping, screen selection, placement bounds, and position parse/format.swift testsuite passes.🤖 Generated with Claude Code