Skip to content

Fixture power budget is editable: Power slot editor + tappable readout - #273

Merged
Yona-Appletree merged 7 commits into
mainfrom
claude/fixture-power-limit-edit-6ed049
Aug 2, 2026
Merged

Fixture power budget is editable: Power slot editor + tappable readout#273
Yona-Appletree merged 7 commits into
mainfrom
claude/fixture-power-limit-edit-6ed049

Conversation

@Yona-Appletree

Copy link
Copy Markdown
Member

Problem

The power-limiting slice shipped with no way to edit `FixturePower` anywhere in Studio. The slot renders as an opaque struct in the advanced drawer (the generic slot editor has no struct editing), and the fixture face's readout is display-only — so every fixture is stuck at the 1000 mA default guard unless its project JSON is hand-edited. This breaks the power ADR's own correction story ("a budget set too low dims the show, says so on the fixture card, and is corrected in seconds") and the plan's phase-4 assumption that the budget editor came free with the generic slot editor.

Fix

Follows the `Dim2u`/`Dimensions` precedent exactly:

  • `ValueEditorHint::Power` (model + static mirror), set on `FixturePower`'s shapes; schema dumps regenerated.
  • `PowerSlotField` (studio-web): lamp-type picker (`LampType::ALL` / `display_name()` were built "for building pickers" and never used) + budget mA input. Editing either component read-modify-writes the whole struct through one `SetValue`. Zero stays enterable — it is the documented unlimited opt-out — and the read-only form says "unlimited" rather than "0 mA". Option-presence cell reserves the ExtraWide tier.
  • Tappable readout: the fixture face's power line ("≈420/1000 mA (42%) · limiting to 62%") now opens the advanced drawer via the existing core-owned `SetDrawer` op — the person the readout just warned can reach the editor from it. No new chrome; stories stay inert (no node path).
  • e2e: absent power option → `EnsurePresent` materializes the server default → value carries the `Power` hint → whole-struct `SetValue` → saved to `fixture.json`.
  • Stale docs corrected: `FixtureDef.power` claimed "absent means never limited" (engine actually applies the 1000 mA default guard per the ADR); `UiFixturePower`'s module doc claimed default-guarded fixtures get no readout (they do; only the zero opt-out hides it).

Validation

  • `just check test` green (including schema drift gate), re-run after merging main
  • New unit tests: `slot_power_field` compose/parse (4), e2e `power_option_gains_the_editor_and_round_trips_save`
  • Stories added: `power_field`, `power_field_read_only`

🤖 Generated with Claude Code

Yona-Appletree and others added 6 commits August 1, 2026 17:48
The power slot shipped with ValueEditorHint::Plain, and struct-shaped
values render read-only in the generic slot editor — so a fixture's lamp
type and budget could not be edited anywhere in Studio, breaking the
power ADR's own correction story ('a budget set too low ... is corrected
in seconds'). The plan assumed the generic editor would provide this for
free; it never handled structs.

Add a Power variant to both hint enums (the Dim2u/Dimensions precedent),
set it on FixturePower's shapes, teach lp-cli's debug formatter the new
variant, and regenerate the schema dumps. Also correct the stale
FixtureDef doc that still claimed absent-means-unlimited.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PowerSlotField renders a Power-hinted FixturePower struct as a lamp-type
picker (LampType::ALL was built 'for building pickers' and never used)
plus a budget mA input, read-modify-writing the whole struct through one
SetValue exactly like DimensionsSlotField. Zero stays enterable — it is
the documented unlimited opt-out — and the read-only form says
'unlimited' rather than '0 mA'. The option-presence cell reserves the
ExtraWide tier so presence flips stay geometry-stable. Stories cover the
editable and read-only states.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The readout is where limiting announces itself ('limiting to 62%'); the
editor now lives in the advanced drawer's power row. Tapping the readout
dispatches the existing core-owned SetDrawer op so the person the
readout just warned can reach the editor from it. No new chrome — the
line keeps its quiet form, gains a pointer cursor, a hover lift, and a
title hint. Stories pass no node path, so the readout stays inert there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Covers the whole previously-broken path: the absent power option gains
the server default via EnsurePresent, the present value carries the
Power editor hint, and a whole-struct SetValue composed the way
PowerSlotField composes it lands in fixture.json on save. Also corrects
UiFixturePower's stale module doc (default-guarded fixtures do get the
readout; only the zero opt-out hides it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…limit-edit-6ed049

# Conflicts:
#	lp-app/lpa-studio-core/src/lib.rs
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

CI refreshed the story baselines on this branch

The validate-stories job detected drift and committed the fresh set: 6 added
in fe4a66d.

Review every PNG in the PR's Files changed view (swipe / onion-skin).
Your local branch is now behind — git pull before pushing again.

Story Before After
studio__node__slot-value-editor__power-field-read-only__lg.png studio__node__slot-value-editor__power-field-read-only__lg.png@fe4a66dccf
studio__node__slot-value-editor__power-field-read-only__md.png studio__node__slot-value-editor__power-field-read-only__md.png@fe4a66dccf
studio__node__slot-value-editor__power-field-read-only__sm.png studio__node__slot-value-editor__power-field-read-only__sm.png@fe4a66dccf
studio__node__slot-value-editor__power-field__lg.png studio__node__slot-value-editor__power-field__lg.png@fe4a66dccf
studio__node__slot-value-editor__power-field__md.png studio__node__slot-value-editor__power-field__md.png@fe4a66dccf
studio__node__slot-value-editor__power-field__sm.png studio__node__slot-value-editor__power-field__sm.png@fe4a66dccf

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Yona-Appletree
Yona-Appletree marked this pull request as ready for review August 2, 2026 18:41
@Yona-Appletree
Yona-Appletree merged commit 561b47b into main Aug 2, 2026
11 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.

1 participant