Skip to content

Steam Controller float layout: spacing fix, defaults & Edit Layout editor (#75)#79

Merged
petegordon merged 5 commits into
mainfrom
claude/issue-75-float-spacing
Jun 20, 2026
Merged

Steam Controller float layout: spacing fix, defaults & Edit Layout editor (#75)#79
petegordon merged 5 commits into
mainfrom
claude/issue-75-float-spacing

Conversation

@petegordon

@petegordon petegordon commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fixes #75.

Summary

Started as the #75 float-spacing fix and grew into a broader pass on the Steam Controller float/popout layout and its Edit Layout editor:

  • Fix the overlapping bumpers/triggers and half-hidden paddles (Detached buttons are too close together #75).
  • Bake the hand-tuned trigger/bumper positions in as the defaults.
  • Make the per-part numeric editor actually usable (a floating popup) and default the camera to Top.
  • Make Reset to all defaults actually reset everything (including window size).

1. Float spacing fix (#75)

These parts are positioned by per-part floatTuning (floatFactor/floatLateralBias only apply to untuned parts, so the tuning is the only lever). Adjusted the Steam Controller profile:

Part Before After Why
Triggers back 0.22, up 0.24 back 0.34, up 0.36 Reopen the gap so triggers sit clearly above the bumpers instead of on top of them
Paddles up -0.14, back -0.45 up -0.06, back -0.58 Raise them and pull them toward the camera so they clear the body's bottom edge instead of hiding behind it

Bumpers (back 0.08, up 0.12) and the paddle side (-0.13) are unchanged.

2. Hand-tuned defaults

  • New defaultLayout on the Steam Controller profile holds the exact trigger/bumper offsets captured from the Edit Layout editor, applied as a baseline on top of floatTuning (a user's own saved edits still win).
  • Camera now defaults to Top for every controller (was Player); still persisted per Save last Camera position selected and reopen to it #70, so a user's pick is remembered.

3. Edit Layout — floating numeric editor

The per-axis Position/Rotation fields lived inside the settings panel, which is closed while you drag parts in the 3D view — so the fine-tune controls were effectively invisible. Moved them into a self-contained popup shown when a part is selected:

  • Draggable popup with X / Y / Z axis labels and roomy, readable fields.
  • Shift + ↑/↓ = fine nudge (Position 0.001, Rotation 0.1°); plain ↑/↓ keep the coarse step.
  • Close (×) deselects; Reset this part restores the position editing started from — the baked defaultLayout if the part has one, else the computed floatTuning spot — instead of jumping to a different procedural value.

4. Full "Reset to all defaults"

Window size lives in the Electron main process (window-state.json), not localStorage, so it survived a reset. Added a reset-window-size IPC that drops the persisted size and snaps the window to the mode default (720×540 single / 1100×520 multi); the reset handler awaits it before reloading.

Files

  • packages/visualizer/src/controller-profiles.js — float tuning + defaultLayout
  • packages/visualizer/src/controller-overlay.js — apply defaultLayout, numeric get/set, reset-to-default, clearLayoutSelection
  • apps/overlay/src/index.html + src/js/app.js — popup UI + wiring, Top camera default, reset-window-size call
  • apps/overlay/electron/main.js + preload.jsreset-window-size IPC

Testing

  • All 85 core tests + visualizer unit tests pass; node --check clean on every changed JS file.
  • CI only covers packages/core + visualizer; the overlay UI (popup, window reset) is Electron-only, so verify on the desktop preview build:
    • Steam Controller + Float Controls: bumper/trigger gap and paddle visibility (Top & Player views).
    • Edit Layout → select a trigger → popup appears with X/Y/Z + Shift-fine; drag/edit works; Reset this part returns it to the default.
    • Top is the default camera on a fresh profile.
    • Resize the window, then Reset to all defaults → window returns to default size.

🤖 Generated with Claude Code

…ft paddles (#75)

Issue #61's tighter float spread packed the Steam Controller's popped parts
together: the triggers landed right on top of the bumpers, and the back
paddles dropped so far under the body they were half hidden behind it.

These parts use per-part floatTuning (floatFactor/lateralBias don't apply to
tuned parts), so adjust the tuning:
- Triggers pushed further off the back surface (back 0.22→0.34, up 0.24→0.36)
  to reopen the gap above the bumpers.
- Paddles raised (up -0.14→-0.06) and pulled further toward the camera
  (back -0.45→-0.58) so they clear the body's bottom edge instead of hiding.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

🔎 PR #79 preview — torn down

This PR is closed; its web preview and desktop prerelease have been removed.

@Ivanim13

Copy link
Copy Markdown
image The problem persists. I believe this is a problem best solved without AI, since the overlay already has a way of moving the position of floating buttons. Making manual adjustments and setting those as the new default would be ideal. As of now, changing the position of the floating buttons is difficult because the first time you click on the button you want to move, its orientation is reset, instead of maintaining the original, already intended, orientation. The method of moving the buttons is also not precise enough; it's impossible to change precise positional values that would allow for a more symmetrical layout.

@petegordon

Copy link
Copy Markdown
Member Author

Let’s see if we can extend this PR to start the edit layout control selection from the Chevy position and not reorientation when clicked and add a floating panel when clicked to do numeric values adjusted precisely in addition to the Q/E and arrow keys.

…rotation (#75 PR feedback)

Addresses the editing-UX feedback on PR #79:

1. Selecting/grabbing a part no longer resets its orientation. The override
   was seeded with euler {0,0,0}, discarding the part's intended tilt
   (triggers/bumpers' tiltUp) or camera-facing pose (paddles). It's now seeded
   from the part's current popped orientation (mode-aware), so the first edit
   is visually a no-op. Bare selection is non-destructive — getSelectedLayout()
   derives values read-only without committing an override.

2. A numeric editor in the Edit Layout panel, shown when a part is selected:
   precise X/Y/Z position and pitch/yaw/roll degrees, in addition to drag and
   the Q/E + arrow keys. Fields sync live while dragging/nudging, and edits
   apply per-axis (empty fields are left untouched) via the new
   getSelectedLayout()/setSelectedLayout() overlay API. A tip notes how to set
   mirrored values for a symmetrical layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1

Copy link
Copy Markdown
Member Author

Pushed the editor-UX improvements to this PR:

1. Selecting a part no longer resets its orientation. The override used to seed euler {0,0,0}, throwing away the part's intended tilt (triggers/bumpers) or camera-facing pose (paddles) on first click. It's now seeded from the part's current popped orientation, so the first drag/edit is visually a no-op. Just selecting a part is non-destructive now (no override is committed until you actually move/rotate/type).

2. Precise numeric position + rotation. When a part is selected, the Edit Layout panel now shows X/Y/Z position and pitch/yaw/roll (°) fields alongside the existing drag + Q/E/arrow controls. They update live as you drag/nudge, and apply per-axis. For a symmetric layout, give the left/right parts matching values with X negated (e.g. −0.30 ↔ +0.30).

Best tested on the refreshed preview once this run finishes: https://lab.usersfirst.games/pr-preview/pr-79/overlay/ → Settings → Edit float layout, then click a part.

The float-default tweak from the first commit is still here too, but with the numeric editor you can now dial in exact defaults — happy to bake whatever values you settle on into the profile as the new defaults.


Generated by Claude Code

@petegordon

Copy link
Copy Markdown
Member Author

I think I found a good default trigger/bumper positioning. What do you think?

The ability for the user to edit the layout is still a work in progress and a bit difficult with the fine control--I'm going to test it a bit more and see how it behaves (I used it to find the ideal default positioning--so it's pretty good just not great)

image

petegordon and others added 3 commits June 20, 2026 10:13
- Steam Controller: bake the Edit-Layout trigger/bumper positions into a
  profile `defaultLayout` (applied before any user override) so the popout
  layout matches the hand-tuned spots out of the box.
- Camera: default every controller to the Top view instead of Player
  (still persisted, so a user's pick is remembered).
- Reset all defaults: also reset the window size, which lives in the main
  process (window-state.json), not localStorage — new reset-window-size IPC
  drops the persisted size and snaps the window back to the mode default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The per-axis Position/Rotation fields lived inside the settings panel, which
is closed while you drag parts in the 3D view — so the fine-tune controls were
effectively invisible. Move them into a self-contained popup that appears on
selection, independent of the settings panel.

- Floating, draggable popup (#layout-editor-popup) shown when a part is
  selected; close (×) deselects, "Reset this part" clears just its override.
- X/Y/Z axis labels on each Position/Rotation input; roomy, evenly-sized
  fields so full values stay readable as they change.
- Shift + ↑/↓ in a field does a fine nudge (Position 0.001, Rotation 0.1°);
  plain ↑/↓ keep the coarse step. Documented on the popup.
- New overlay clearLayoutSelection() backs the close button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Reset this part" / "RESET LAYOUT" cleared the override to null, which falls
back to the computed floatTuning offset — a different spot than the hand-tuned
defaultLayout shown when Edit Layout opens. Restore the position editing
started from instead: the profile's defaultLayout if it lists the part
(Steam triggers/bumpers), otherwise null → floatTuning (paddles, other
controllers). So reset undoes the user's tweaks rather than jumping elsewhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@petegordon petegordon changed the title Fix Steam Controller float layout spacing (#75) Steam Controller float layout: spacing fix, defaults & Edit Layout editor (#75) Jun 20, 2026
@petegordon

Copy link
Copy Markdown
Member Author

Hope the defaults are good. The user defined positioning (relative or absolute) is still a bit tricky--can always restore to defaults--and now can do smaller incremental changes to rotation with the shift key down.
image

@petegordon petegordon merged commit 4eae204 into main Jun 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detached buttons are too close together

3 participants