Repository navigation
feat(windows): add opt-in draggable wallpaper slice controls - #316
sanketpatel32 wants to merge 3 commits into
Conversation
Adds AMADEUS_WALLPAPER_DRAGGABLE_CONTROLS, a Windows-only desktop preference (default off, applies after restart). When enabled the transparent slice window spans the whole primary display, the slice host projects normalized control bounds through the wallpaper art's cover transform, and the Work status button and task card can be dragged anywhere on the display. Dragged positions persist as normalized window coordinates in the slice window's localStorage; a right-click on a control restores its authored position. The default path is unchanged. Implements the optional dragging proposal from Code-Amadeus#219; the window geometry fix already landed in Code-Amadeus#220. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Signed-off-by: Sanket Patel <sanpatel323@gmail.com>
40e599a to
9a51a66
Compare
Lucas1479
left a comment
There was a problem hiding this comment.
Thank you @sanketpatel32 for turning the optional dragging draft from #219 into a settings-gated, default-off feature, and for keeping display-following out of scope.
As noted in #219, host compatibility, interaction defaults and persistence need agreement before this is ready for mainline. Requested changes:
-
Persistence depends on an origin that can change. Positions are stored in the slice window's
localStorage, whose origin ishttp://127.0.0.1:<assetPort>. When the preferred port is busy,AssetServer.start()takes the next free port, so the origin can change between launches and the saved positions silently disappear. Please persist positions somewhere stable, for example through the main process with the desktop settings, or explain why the origin can't change. -
Windows acceptance evidence. Please attach a short recording on a live Lively-mounted wallpaper that shows:
- dragging, the 5 px click threshold and right-click reset;
- clicks outside the controls still reaching the desktop;
- control alignment on a display that isn't 16:9, where the new cover projection and the default slice projection can differ.
-
Cost of the full-display transparent window. Please report whether spanning the whole display changes GPU or compositor load compared with the default slice window, for example at 4K.
-
Interaction with #311. #311 also changes
electronSliceBounds()to support a target display. If both land, the full-display layout has to follow the chosen wallpaper display.
The full-display Slice surface saved positions in localStorage, but it loads from http://127.0.0.1:<assetPort> and AssetServer picks a free port each run, so the origin — and the saved positions — reset every restart. - sliceControlPositions.ts: normalized {status,card} positions (window coordinates, [-1,1]) stored at userData/wallpaper-control-positions.json with the same durable write pattern as desktop settings. - Preload exposes get/setControlPositions on window.amadeus; the renderer loads positions once over IPC and writes on drop/reset. Only the slice and canvas renderers may call the IPC. - electronSliceDisplay(): both full-display bounds helpers now resolve the target display in one place — AMADEUS_WALLPAPER_MONITOR matches an Electron label/id until Code-Amadeus#311's DeviceId resolver lands, primary stays the fallback, so the surface follows the chosen wallpaper display.
|
Requested changes addressed in be074a7:
Outstanding: the Windows acceptance recording (drag, 5px threshold, right-click reset, pass-through clicks, non-16:9 alignment) and the measured GPU cost both need a Windows host. |
…paper-follow-drag
Fixes #219
Summary
Implements the optional draggable-controls proposal from #219 as a settings-gated, default-off feature. The required window geometry fix already landed in #220 and is included in this base; this PR adds only the optional half.
AMADEUS_WALLPAPER_DRAGGABLE_CONTROLS, boolean, default off,desktop_restartapply). Env var still overrides the saved value, matching the startup-mode convention.BrowserWindowspans the whole primary display (same as macOS scene host), andfreeControls=1is passed toelectron_slice.html. The default path keeps the authored slice-relative projection and ignores any saved positions.wallpaperImageSize) in/wallpaper/bridge-info; in free mode the slice host reproduces the scene's aspect-preserving cover transform so normalized bounds land where the artwork paints them, letting controls be placed anywhere on the display.localStorage(amadeus.desktop-controls.positions.v1); right-click restores the authored position. Drag stays clamped to keep a visible margin on-screen.Files changed
config/catalog/desktop/startup.json+ regeneratedelectron/src/shared/configCatalog.generated.ts— new catalog field.electron/src/main/startupMode.ts,electron/src/main/index.ts— preference resolution (win32-only), full-display slice bounds,freeControlsURL param.wallpaper/scene_assets.py,wallpaper/wallpaper_engine_bridge.py,server/handlers/wallpaper_handler.py—wallpaperImageSizeplumbing.render/web/electron_slice_host.js— cover projection, drag/persist/reset, click suppression, right-click reset.docs/windows_wallpaper_lifecycle.md— documented the opt-in setting.electron/tests/startupMode.test.mjs,tests/electron_slice_host.test.cjs(new),tests/test_electron_slice_host.py(new),tests/test_wallpaper_asset_revision.py.Verification
node --test tests/electron_slice_host.test.cjs— 6/6 pass (default-off projection, cover-crop projection, drag+persist+click suppression, click preserved, right-click reset, header-only card drag).node --experimental-strip-types --test electron/tests/startupMode.test.mjs— 6/6 pass.python -m pytest -q tests/test_wallpaper_asset_revision.py tests/test_electron_slice_host.py tests/test_windows_desktop_layer.py— 23 pass (includes the fix(windows): preserve window geometry during desktop-layer reconciliation #220 geometry regressions).python -m pytest -q tests/test_wallpaper_subscription_recovery.py::test_slice_refreshes_bridge_credential_after_reconnection— pass.npx tsc --noEmit -p electron/tsconfig.json— clean.npm run check:config— clean.Not verified: native Windows manual acceptance (dragging on a live Lively-mounted wallpaper); no screenshot captured in this environment.