Overlay #104: default to last-used controller + 'No controller selected' splash text#105
Conversation
The bare gamepad emoji under-communicated the not-SELECTED state. Add a title
('No controller selected') + hint ('Press a controller, or open the list ⧉ to
pick one.') beneath it, so SELECTED vs not-SELECTED reads clearly.
- Persist the last SELECTED pad's identity (vid:pid) in designateEntry (overlay:lastController). - On launch, within a 6s grace window, auto-SELECT the remembered pad as soon as it's RECEIVING — no button press required (relaxes the input-driven policy ONLY for the remembered pad). A real press on any pad still wins: press-based autoAdoptFromPool runs first each loop and sets hidDevice before tryAdoptLastUsed. - If the remembered pad never shows within the window, open the controllers window (AVAILABLE list) so the user can pick; No-Controller splash stays. NEEDS HARDWARE VERIFY (grace/enumeration timing, BT pads). vid:pid identity is the browser-safe baseline; per-unit Electron serial matching is a follow-up.
🔎 PR #105 preview — torn downThis PR is closed; its web preview and desktop prerelease have been removed. |
…embered pad Fallback bug: the first launch after this feature ships has nothing persisted (_lastUsed is null), and the early-out for that case skipped the fallback entirely — so the list never opened when nothing was selected. Move the no-remembered-pad check inside the grace branch (just wait it out) so the 'grace expired + nothing SELECTED -> open the AVAILABLE list' path fires regardless of whether a pad was remembered. (RESET DEFAULTS already clears overlay:lastController via its overlay* key sweep + reload — no change needed there.)
With nothing remembered there's nothing to wait for, so open the AVAILABLE list sooner (NO_PAD_GRACE_MS = 2s). The full 6s wait now applies only when we're actually waiting for a remembered pad to enumerate (BT/wireless is slow). The 2s beat still lets the user press a connected pad to select it first, and lets the pool populate so the list isn't empty when it opens.
Adds a small '● <name>' badge shown while a controller is SELECTED and driving the overlay, gated behind a new 'Show Controller Badge' setting that is OFF by default (overlay:showBadge). updateLiveBadge() reflects designate/undesignate + the toggle.
- Picking a model from the dropdown while nothing is SELECTED now shows a 'Preview · not selected' label (the viewport doubles as a model browser). - Such a preview pick is NO LONGER persisted (was becoming a sticky override); only a deliberate override (chosen while a controller is live) or an explicit Auto-Detect persists. - When a real controller takes over, switchController resets the dropdown to Auto-Detect and snaps to that controller's own model (discards the preview). - Choosing Auto-Detect with nothing live returns to the IDLE splash.
|
Tested by Pete ✅. Marking ready for review. Final scope — all of #104 except the dimmed IDLE model (descoped; emoji+text is enough):
Optional follow-up: per-unit Electron serial matching (currently vid:pid). |
…ust vid:pid) When two same-model pads are connected (e.g. a BT GameSir and a USB DS4, both 054c:05c4), vid:pid alone could auto-select the wrong one. rememberLastUsed now also stores the unit's transport (driver.connectionType) and its unit-specific serial when resolvable (real MAC/serial, not a '(no serial)' placeholder). tryAdoptLastUsed ranks same-vid:pid receiving pads: exact serial match first (once the main-process inventory is populated via a list/pair gesture), else same transport (works at boot — distinguishes BT vs USB), else any same-model pad. Old records without conn/serial fall back to vid:pid — no regression.
|
Added the per-unit matching (was the last optional follow-up), commit 113073c:
Needs a hardware pass with two same-vid:pid pads to confirm. |
…re scan) The #104 auto-opened controllers window had no user gesture, so the serial scan (requestDevice, which needs user activation) never ran — its rows showed no serials while manually clicking 'Show list…' did. Arm a one-shot scan on the user's first interaction with the overlay (pointerdown/keydown); Electron auto-picks with no chooser and upserts every present device's serial into the live inventory the window reads. The manual 'Show list…' scan is unchanged.
Implements the core of #104 (last-used controller default) and the first slice of its 3D-viewport communication. Draft — needs hardware verification (BT/wireless enumeration + grace timing).
In this PR
designateEntryrecords the SELECTED pad's identity (overlay:lastController, vid:pid) as the launch default.tryAdoptLastUsedauto-SELECTs the remembered pad as soon as it's receiving, no button press required (relaxes the input-driven policy for the remembered pad only). A real press on any pad still wins — press-basedautoAdoptFromPoolruns first each loop and claimshidDevicebefore the last-used path.Deferred (still tracked by #104, next iteration)
● <name>badge.Verify on hardware
Refs #104.