Server admin 8: Form widgets: colour field, tri-state permission buttons, stop slider, multi-line field (#674) #714

Closed
charles wants to merge 0 commits from serveradmin-8-form-widgets into serveradmin
Owner

What this builds

The form widgets for the administration screens (Server administration plan, Task 8; spec §8):

  • widgets::color_field::view(value, on_change) (.label(), .description(), .disabled()): the original's ColorPickerField (feat/ui/components/form/ColorPickerField.{tsx,module.css}). It has a 44 px field with a monospace hex input, the swatch with the eyedropper, the description and the error. The text is committed on Enter or on a press elsewhere (the original commits on blur). parse reads #rgb/#rgba/#rrggbb/#rrggbbaa, rgb()/rgba() (numbers or %, comma or space separated), hsl()/hsla() (deg/rad/grad/turn) and the 148 CSS names plus transparent, and drops alpha. An invalid entry keeps the value, puts its hex back and shows the error (commit). A value of 0 means "no colour": the swatch then shows --text-chat. The swatch opens the original's ColorPickerPopover: the saturation/brightness area, the hue slider and "Reset" (to 0, disabled on #4641D9), 8 px under the field.
  • widgets::tri_state::view(TriState::{Deny, Neutral, Allow}, disabled: Option<&str>, on_change): PermissionStateButtons (DLG/shared/PermissionComponents.{tsx,module.css}). Three 32 px buttons with the active colours: danger 88 %, settings-selected, online 88 %. When disabled they are drawn at half opacity, and a non-empty reason shows as the tooltip. TriState::of is getPermissionState.
  • widgets::slider::stops(value, &stops, format, on_change): evenly spaced stops (slowmode's 14 from SlowmodeControl.tsx, or any range), with the formatted value on the right. nearest_stop gives the stop closest to a value.
  • widgets::text_input::multiline(value, max, on_change) (.label(), .placeholder()): the form Textarea, 2 to 10 rows, with the n/max counter right of the label. Typing or pasting past max is cut.
  • widgets::form::{section, body_text, labelled, switch_row, radio_group, Choice, dropdown, select, filter}: the user settings' rows, moved out of screens/settings/mod.rs, which re-exports them under their old names, so no settings panel changed. select(choices, selected, on_pick) is a new searchable dropdown: its list floats under the field, typing filters it, and Escape or a click elsewhere closes it.
  • widgets::stateful::Stateful (new file, see the deviations below): a widget that keeps its own state in the widget tree. The fields use it to hold the text being typed, the query, whether the list is open, and the editor's cursor, so callers keep only the value, as the Interfaces block asks (view(value, on_change)). A content that owns its data is kept between update and draw, because iced 0.14 widgets read their hover/disabled status from the widget instance.
  • Icons: MinusBold and Eyedropper (Phosphor 2.1.10 path data).

Strings, copied from the fork: "Role color", "Type a color (hex, rgb(), hsl(), or name) or use the picker.", "That doesn't look like a valid color. Try hex, rgb(), hsl(), or a CSS color name.", placeholder "#000000, rgb(...), red", "Reset", "Deny", "Neutral (inherit)", "Allow".

How it was tested

  • tests/form_widgets.rs (headless, iced widget protocol):
    • hex_and_css_colour_parsing_table
    • invalid_colour_keeps_last_value: typing nonsense and pressing Enter sends nothing and shows the error; then #00ff00 is sent.
    • tri_state_click_cycles_to_the_clicked_state
    • disabled_tri_state_emits_nothing_and_has_tooltip
    • stop_slider_snaps
    • multiline_counter_and_max
    • select_filters_by_query: a click opens the list, typing filters it, a click picks and closes it.
    • user_settings_rows_unchanged: every text and its bounds on the Chat, Advanced, Notifications, Appearance and Account settings tabs, recorded before the move in tests/form_widgets_settings_rows.txt, are identical after it.
    • All failed (did not compile) before the implementation and pass now. There are also unit tests in color_field and tri_state.
  • New goldens: color_field, tri_state_buttons, stop_slider, form_rows. They were rendered on lavapipe in fluxer-native-shots:u2204, with references in docs/screenshots/ and rows in its README. A full lavapipe run of the suite passed: 182 passed, so no existing golden (including the settings ones) changed.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed.
  • No FLUXER_DESKTOP_TESTS=1 tests were run (none were added). No side-by-side capture with the Electron app: it is not runnable here.

Deviations from the plan

  • No preset swatches. The original ColorPickerField and its ColorPickerPopover have none: the popover is a saturation/brightness area, a hue slider and "Reset". This field clones that popover instead of inventing presets.
  • New file widgets/stateful.rs, outside the Files list. The fields need state between frames to keep the view(value, on_change) signatures, and iced 0.14's Component is deprecated and behind a feature that pulls in a new dependency.
  • screens/settings/mod.rs modified, outside the Files list. The moved rows are re-exported there, and no other screen file changed.
  • tests/headless/mod.rs: added Harness::overlay_event (it sends an event to the floating list).
  • Textarea counter. It reads n/max as in the original (FormInput.tsx), not n / max.
  • Commit on blur. It is approximated as a press outside the field.
  • Stop slider. It shows the value on the right, not the original's marker labels or drag tooltip.
  • Colour field focus border. It does not change on focus: iced does not tell the wrapper about the input's focus.

Closes #674

🤖 Generated with Claude Code

## What this builds The form widgets for the administration screens (Server administration plan, Task 8; spec §8): - `widgets::color_field::view(value, on_change)` (`.label()`, `.description()`, `.disabled()`): the original's `ColorPickerField` (`feat/ui/components/form/ColorPickerField.{tsx,module.css}`). It has a 44 px field with a monospace hex input, the swatch with the eyedropper, the description and the error. The text is committed on Enter or on a press elsewhere (the original commits on blur). `parse` reads `#rgb`/`#rgba`/`#rrggbb`/`#rrggbbaa`, `rgb()`/`rgba()` (numbers or %, comma or space separated), `hsl()`/`hsla()` (deg/rad/grad/turn) and the 148 CSS names plus `transparent`, and drops alpha. An invalid entry keeps the value, puts its hex back and shows the error (`commit`). A value of 0 means "no colour": the swatch then shows `--text-chat`. The swatch opens the original's `ColorPickerPopover`: the saturation/brightness area, the hue slider and "Reset" (to 0, disabled on `#4641D9`), 8 px under the field. - `widgets::tri_state::view(TriState::{Deny, Neutral, Allow}, disabled: Option<&str>, on_change)`: `PermissionStateButtons` (`DLG/shared/PermissionComponents.{tsx,module.css}`). Three 32 px buttons with the active colours: danger 88 %, settings-selected, online 88 %. When disabled they are drawn at half opacity, and a non-empty reason shows as the tooltip. `TriState::of` is `getPermissionState`. - `widgets::slider::stops(value, &stops, format, on_change)`: evenly spaced stops (slowmode's 14 from `SlowmodeControl.tsx`, or any range), with the formatted value on the right. `nearest_stop` gives the stop closest to a value. - `widgets::text_input::multiline(value, max, on_change)` (`.label()`, `.placeholder()`): the form `Textarea`, 2 to 10 rows, with the `n/max` counter right of the label. Typing or pasting past `max` is cut. - `widgets::form::{section, body_text, labelled, switch_row, radio_group, Choice, dropdown, select, filter}`: the user settings' rows, moved out of `screens/settings/mod.rs`, which re-exports them under their old names, so no settings panel changed. `select(choices, selected, on_pick)` is a new searchable dropdown: its list floats under the field, typing filters it, and Escape or a click elsewhere closes it. - `widgets::stateful::Stateful` (new file, see the deviations below): a widget that keeps its own state in the widget tree. The fields use it to hold the text being typed, the query, whether the list is open, and the editor's cursor, so callers keep only the value, as the Interfaces block asks (`view(value, on_change)`). A content that owns its data is kept between update and draw, because iced 0.14 widgets read their hover/disabled status from the widget instance. - Icons: `MinusBold` and `Eyedropper` (Phosphor 2.1.10 path data). Strings, copied from the fork: "Role color", "Type a color (hex, rgb(), hsl(), or name) or use the picker.", "That doesn't look like a valid color. Try hex, rgb(), hsl(), or a CSS color name.", placeholder "#000000, rgb(...), red", "Reset", "Deny", "Neutral (inherit)", "Allow". ## How it was tested - `tests/form_widgets.rs` (headless, iced widget protocol): - `hex_and_css_colour_parsing_table` - `invalid_colour_keeps_last_value`: typing nonsense and pressing Enter sends nothing and shows the error; then `#00ff00` is sent. - `tri_state_click_cycles_to_the_clicked_state` - `disabled_tri_state_emits_nothing_and_has_tooltip` - `stop_slider_snaps` - `multiline_counter_and_max` - `select_filters_by_query`: a click opens the list, typing filters it, a click picks and closes it. - `user_settings_rows_unchanged`: every text and its bounds on the Chat, Advanced, Notifications, Appearance and Account settings tabs, recorded **before** the move in `tests/form_widgets_settings_rows.txt`, are identical after it. - All failed (did not compile) before the implementation and pass now. There are also unit tests in `color_field` and `tri_state`. - New goldens: `color_field`, `tri_state_buttons`, `stop_slider`, `form_rows`. They were rendered on lavapipe in `fluxer-native-shots:u2204`, with references in `docs/screenshots/` and rows in its README. A full lavapipe run of the suite passed: 182 passed, so no existing golden (including the settings ones) changed. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed. - No `FLUXER_DESKTOP_TESTS=1` tests were run (none were added). No side-by-side capture with the Electron app: it is not runnable here. ## Deviations from the plan - **No preset swatches.** The original `ColorPickerField` and its `ColorPickerPopover` have none: the popover is a saturation/brightness area, a hue slider and "Reset". This field clones that popover instead of inventing presets. - **New file `widgets/stateful.rs`**, outside the Files list. The fields need state between frames to keep the `view(value, on_change)` signatures, and iced 0.14's `Component` is deprecated and behind a feature that pulls in a new dependency. - **`screens/settings/mod.rs` modified**, outside the Files list. The moved rows are re-exported there, and no other screen file changed. - **`tests/headless/mod.rs`**: added `Harness::overlay_event` (it sends an event to the floating list). - **Textarea counter.** It reads `n/max` as in the original (`FormInput.tsx`), not `n / max`. - **Commit on blur.** It is approximated as a press outside the field. - **Stop slider.** It shows the value on the right, not the original's marker labels or drag tooltip. - **Colour field focus border.** It does not change on focus: iced does not tell the wrapper about the input's focus. Closes #674 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The colour field (ColorPickerField with its picker popover), the tri-state
permission buttons (PermissionStateButtons), the slider over stops, the
multi-line field with its n/max counter, and widgets::form: the settings
rows moved out of screens::settings plus a searchable select. The fields
keep their own state through widgets::stateful::Stateful.

Refs #674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Server admin 8 (form widgets)

Reviewed git diff 8c58a73f..origin/serveradmin-8-form-widgets (head 091d6b4e) cold.

Checked and fine

  • All eight tests named in the plan exist, plus the four goldens. The parsing table covers #rgb/#rgba/#rrggbb/#rrggbbaa, rgb(), hsl() and names. The slowmode stops are the spec's 14 values.
  • Interfaces match the plan: color_field::view(u32, on_change), tri_state::view(TriState, Option<&str>, on_change), slider::stops(value, &[u32], format, on_change), text_input::multiline(value, max, on_change), form::{section, labelled, switch_row, radio_group, select}.
  • The settings rows moved over verbatim (diffed line by line), and screens/settings re-exports the old names.
  • No I/O, no new dependency, no secrets. Server values cannot panic these widgets: an empty stops list and out-of-range values are handled.
  • Spot-checked against the fork:
    • parseColor (hex expand, then alpha cut) matches; transparent maps to 0.
    • getPermissionState matches (deny wins, all bits must be set).
    • PermissionComponents.module.css matches: 32 px buttons, 8 px radius, 88 % colour-mix, 0.5 opacity when disabled.
    • The ColorPickerPopover Reset is disabled on #4641D9. The original has no preset swatches, so leaving them out is right.
    • The strings "Deny", "Neutral (inherit)", "Allow", the description, the invalid-colour text and the placeholder are verbatim.
  • Stateful base-content cache (the Review-me item): sound. I traced iced_runtime 0.14 UserInterface::{update,draw}. In draw the base content is drawn before overlay() drops the cache. On the next RedrawRequested, overlay() runs first, then the base update rebuilds the content and sets the statuses before draw. overlay() returns early, keeping the cache, while no overlay is open.

Findings

  1. [blocking] The overlay content loses its widget statuses: the picker's Reset always looks disabled, and the select list never shows hover. Stateful::overlay builds a new overlay Element on every call. UserInterface::draw calls root.overlay() again just before drawing it (iced_runtime 0.14 user_interface.rs ~l.520), so the overlay drawn is a fresh element. Its buttons never received RedrawRequested, and iced_widget 0.14 button.rs:376 draws self.status.unwrap_or(Status::Disabled). In the running app:

    • the colour picker's enabled "Reset" is drawn at the 0.6-alpha disabled colour;
    • the select's rows never get the --background-modifier-hover highlight (Hovered is never seen).

    The goldens don't catch it: color_field.png draws picker() directly, not through the overlay, and no golden shows an open select. Tasks 25, 29, 30 and 31 use these widgets. Fix suggestion: keep the overlay element across calls like the base content (rebuild it only when the state changed / stale). Or add a golden or headless test that opens the overlay through Stateful, sends RedrawRequested with the cursor over a row, then draws.

  2. [minor] The select's empty-list text "No options" is not the original's. FormCombobox.tsx shows NO_RESULTS_FOUND_DESCRIPTOR = "No results found" (Global Constraint: strings are the original's). It also shows "Select…" (SELECT_DESCRIPTOR) as the placeholder when nothing is chosen; the native field shows an empty one.

  3. [minor] The character counter is unformatted. The original prints numberFormat.format(n)/numberFormat.format(max), i.e. 34/1,024 for the topic. The native one prints 34/1024 (see form_rows.png).

  4. [minor] The slider snaps, but the original does not. The original SlowmodeControl uses <Slider equidistant step={1} markers=…> without stickToMarkers: values between the markers are reachable, the value appears in a tooltip, and the markers 0/60/3600/21600 are labelled ("Off", "1 minute", …).

    • The plan asks for snapping, so this is not a blocker for this task.
    • But a server value off the stops (for example 45 s set from Electron) is displayed as the nearest stop. Task 29 should show the real value, or the parity doc should record this as a divergence.
  5. [minor] The colour field commits on a press outside it, but a click on its own swatch does not commit the draft. The original commits on blur, which a swatch click causes. This is part of the documented blur approximation; noting it for completeness.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green in the review worktree (exit 0, 0 failures, screenshot goldens incl. the four new ones and the existing settings goldens pass).

Verdict: changes requested — 1 blocking (overlay statuses), 4 minor.

## Independent review: Server admin 8 (form widgets) Reviewed `git diff 8c58a73f..origin/serveradmin-8-form-widgets` (head 091d6b4e) cold. **Checked and fine** - All eight tests named in the plan exist, plus the four goldens. The parsing table covers `#rgb`/`#rgba`/`#rrggbb`/`#rrggbbaa`, `rgb()`, `hsl()` and names. The slowmode stops are the spec's 14 values. - Interfaces match the plan: `color_field::view(u32, on_change)`, `tri_state::view(TriState, Option<&str>, on_change)`, `slider::stops(value, &[u32], format, on_change)`, `text_input::multiline(value, max, on_change)`, `form::{section, labelled, switch_row, radio_group, select}`. - The settings rows moved over verbatim (diffed line by line), and `screens/settings` re-exports the old names. - No I/O, no new dependency, no secrets. Server values cannot panic these widgets: an empty stops list and out-of-range values are handled. - Spot-checked against the fork: - `parseColor` (hex expand, then alpha cut) matches; `transparent` maps to 0. - `getPermissionState` matches (deny wins, all bits must be set). - `PermissionComponents.module.css` matches: 32 px buttons, 8 px radius, 88 % colour-mix, 0.5 opacity when disabled. - The `ColorPickerPopover` Reset is disabled on `#4641D9`. The original has no preset swatches, so leaving them out is right. - The strings "Deny", "Neutral (inherit)", "Allow", the description, the invalid-colour text and the placeholder are verbatim. - Stateful base-content cache (the Review-me item): sound. I traced iced_runtime 0.14 `UserInterface::{update,draw}`. In draw the base content is drawn *before* `overlay()` drops the cache. On the next RedrawRequested, `overlay()` runs first, then the base `update` rebuilds the content and sets the statuses before draw. `overlay()` returns early, keeping the cache, while no overlay is open. **Findings** 1. **[blocking] The overlay content loses its widget statuses: the picker's Reset always looks disabled, and the select list never shows hover.** `Stateful::overlay` builds a new overlay `Element` on every call. `UserInterface::draw` calls `root.overlay()` again just before drawing it (iced_runtime 0.14 `user_interface.rs` ~l.520), so the overlay drawn is a fresh element. Its buttons never received `RedrawRequested`, and iced_widget 0.14 `button.rs:376` draws `self.status.unwrap_or(Status::Disabled)`. In the running app: - the colour picker's enabled "Reset" is drawn at the 0.6-alpha disabled colour; - the select's rows never get the `--background-modifier-hover` highlight (`Hovered` is never seen). The goldens don't catch it: `color_field.png` draws `picker()` directly, not through the overlay, and no golden shows an open select. Tasks 25, 29, 30 and 31 use these widgets. Fix suggestion: keep the overlay element across calls like the base content (rebuild it only when the state changed / `stale`). Or add a golden or headless test that opens the overlay through `Stateful`, sends RedrawRequested with the cursor over a row, then draws. 2. **[minor] The select's empty-list text "No options" is not the original's.** `FormCombobox.tsx` shows `NO_RESULTS_FOUND_DESCRIPTOR` = "No results found" (Global Constraint: strings are the original's). It also shows "Select…" (`SELECT_DESCRIPTOR`) as the placeholder when nothing is chosen; the native field shows an empty one. 3. **[minor] The character counter is unformatted.** The original prints `numberFormat.format(n)/numberFormat.format(max)`, i.e. `34/1,024` for the topic. The native one prints `34/1024` (see `form_rows.png`). 4. **[minor] The slider snaps, but the original does not.** The original `SlowmodeControl` uses `<Slider equidistant step={1} markers=…>` without `stickToMarkers`: values between the markers are reachable, the value appears in a tooltip, and the markers 0/60/3600/21600 are labelled ("Off", "1 minute", …). - The plan asks for snapping, so this is not a blocker for this task. - But a server value off the stops (for example 45 s set from Electron) is *displayed* as the nearest stop. Task 29 should show the real value, or the parity doc should record this as a divergence. 5. **[minor] The colour field commits on a press outside it, but a click on its own swatch does not commit the draft.** The original commits on blur, which a swatch click causes. This is part of the documented blur approximation; noting it for completeness. **Local gate**: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green in the review worktree (exit 0, 0 failures, screenshot goldens incl. the four new ones and the existing settings goldens pass). **Verdict: changes requested — 1 blocking (overlay statuses), 4 minor.**
Stateful::overlay built a new overlay element on every call, and iced's
runtime asks for the overlay again before drawing it: the drawn overlay
never saw RedrawRequested, so buttons in it drew as disabled (the colour
picker's Reset) or without hover (the select's rows). The overlay element
is now kept, as the owned content is, until the state or the anchor
changes; select_list_hover_survives_the_runtime_redraw opens a select
through Stateful and draws its list as the runtime does.

Also from the review: the select shows "Select…" when nothing is chosen
and "No results found" when nothing matches (FormCombobox); the multi-line
counter groups thousands (1,234/2,000); the stop slider shows the value it
holds rather than its nearest stop (snapping itself: #716); a click on the
colour field's swatch commits the typed text first, as the original's
blur does.

Refs #674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Review round 1 addressed in 116c7e52:

  • Blocking, stateful.rs overlay rebuilt on every call: Stateful now keeps the overlay element (with the anchor it was built for) as it keeps the owned content, and drops both only when the state goes stale or the anchor moves. The overlay that is drawn is the one that saw RedrawRequested, so the picker's enabled Reset no longer draws as disabled and the select rows show hover. overlay() also no longer drops the base content's cache on every call. New test select_list_hover_survives_the_runtime_redraw opens a select through Stateful and runs the overlay as UserInterface does (update with CursorMoved + RedrawRequested, ask for the overlay again, draw), using a new harness helper Harness::overlay_frame. It failed on the old code (identical pixels for the hovered and plain rows) and passes now.
  • Minor, form.rs select texts: the empty list now says "No results found" (form::NO_RESULTS, from NO_RESULTS_FOUND_DESCRIPTOR), and the field shows the placeholder "Select…" (form::SELECT_PLACEHOLDER) in the muted placeholder colour when nothing is chosen. Test: select_placeholder_and_empty_list.
  • Minor, text_input.rs counter: both numbers are grouped as en-US numberFormat groups them (1,234/2,000). Covered in multiline_counter_and_max.
  • Minor, slider.rs snapping: the label now shows the value it was given rather than the nearest stop, so a server value of 45 s reads 45s (stop_slider_snaps updated). Making the slider move between equidistant markers without snapping, as the original does, is follow-up #716 for Task 29 or the parity doc.
  • Minor, color_field.rs swatch click: a click on the swatch commits the typed text before it toggles the picker, as the original's blur would. Test: swatch_click_commits_the_typed_text.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes. All goldens are unchanged.

Review round 1 addressed in 116c7e52: - **Blocking, `stateful.rs` overlay rebuilt on every call:** `Stateful` now keeps the overlay element (with the anchor it was built for) as it keeps the owned content, and drops both only when the state goes stale or the anchor moves. The overlay that is drawn is the one that saw `RedrawRequested`, so the picker's enabled Reset no longer draws as disabled and the select rows show hover. `overlay()` also no longer drops the base content's cache on every call. New test `select_list_hover_survives_the_runtime_redraw` opens a select through `Stateful` and runs the overlay as `UserInterface` does (update with CursorMoved + RedrawRequested, ask for the overlay again, draw), using a new harness helper `Harness::overlay_frame`. It failed on the old code (identical pixels for the hovered and plain rows) and passes now. - **Minor, `form.rs` select texts:** the empty list now says "No results found" (`form::NO_RESULTS`, from `NO_RESULTS_FOUND_DESCRIPTOR`), and the field shows the placeholder "Select…" (`form::SELECT_PLACEHOLDER`) in the muted placeholder colour when nothing is chosen. Test: `select_placeholder_and_empty_list`. - **Minor, `text_input.rs` counter:** both numbers are grouped as en-US `numberFormat` groups them (`1,234/2,000`). Covered in `multiline_counter_and_max`. - **Minor, `slider.rs` snapping:** the label now shows the value it was given rather than the nearest stop, so a server value of 45 s reads `45s` (`stop_slider_snaps` updated). Making the slider move between equidistant markers without snapping, as the original does, is follow-up #716 for Task 29 or the parity doc. - **Minor, `color_field.rs` swatch click:** a click on the swatch commits the typed text before it toggles the picker, as the original's blur would. Test: `swatch_click_commits_the_typed_text`. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes. All goldens are unchanged.
Author
Owner

Independent review: Server admin 8 (form widgets), head 116c7e52

Scope: git diff 8c58a73f..116c7e52.

Tests named by the plan: all present. These are hex_and_css_colour_parsing_table, invalid_colour_keeps_last_value, tri_state_click_cycles_to_the_clicked_state, disabled_tri_state_emits_nothing_and_has_tooltip, stop_slider_snaps (uses the original's 14 SLOWMODE_STOP_SECONDS), multiline_counter_and_max, select_filters_by_query and user_settings_rows_unchanged. The four goldens are also present: color_field, tri_state_buttons, stop_slider and form_rows. There are extra tests for the overlay redraw, the select placeholder and empty list, and the swatch commit.

Interfaces: these exist as written: color_field::view(u32, on_change), tri_state::view(TriState, Option<&str>, on_change), slider::stops(value, &[u32], format, on_change), text_input::multiline(value, max, on_change) and form::{section, labelled, switch_row, radio_group, select}. The user settings re-export the moved rows under their old names.

Invariants: I found no new I/O path in fluxer-ui. The only std::fs is in the test that writes the settings-rows file. There are no panicking unwraps on data. select picks by index into the full list and ignores disabled entries. The stops slider takes empty stops. Colour parsing rejects non-finite numbers and clamps the channels. There are no secrets.

Parity, spot-checked against the fork:

  • parseColor: #rgb and #rgba are expanded and #rrggbbaa is cut to six digits. The placeholder #000000, rgb(...), red, maxLength=64, the description and the error text are the same as ColorPickerField.tsx.
  • PermissionStateButtons: the Deny, Neutral and Allow labels are the same. A click sends the clicked state even when it is already active. Disabled buttons use opacity 0.5. The tooltip is disabled && disabledReason. The 2rem buttons and 0.5rem radius match.
  • FormCombobox "No results found" and "Select…" match. The FormInput counter numberFormat(n)/numberFormat(max) matches.

Review Focus: no item applies to Task 8.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green. All steps passed and the goldens match.

Findings

  • minor: The plan's Interfaces line names "preset swatches" for color_field. The original's ColorPickerField and ColorPickerPopover have none, and I checked this. The module doc says so, and following the original is correct. This is noted only so that later tasks do not look for presets.
  • minor: The multiline counter and the limit count Unicode scalar values. The original's value.length counts UTF-16 units, so text with astral-plane characters (such as emoji) can differ by one unit per character. This does not affect correctness of anything sent: the server validates.

Verdict: APPROVED. There are no blocking findings and local CI is green.

## Independent review: Server admin 8 (form widgets), head 116c7e52 Scope: `git diff 8c58a73f..116c7e52`. **Tests named by the plan:** all present. These are `hex_and_css_colour_parsing_table`, `invalid_colour_keeps_last_value`, `tri_state_click_cycles_to_the_clicked_state`, `disabled_tri_state_emits_nothing_and_has_tooltip`, `stop_slider_snaps` (uses the original's 14 `SLOWMODE_STOP_SECONDS`), `multiline_counter_and_max`, `select_filters_by_query` and `user_settings_rows_unchanged`. The four goldens are also present: `color_field`, `tri_state_buttons`, `stop_slider` and `form_rows`. There are extra tests for the overlay redraw, the select placeholder and empty list, and the swatch commit. **Interfaces:** these exist as written: `color_field::view(u32, on_change)`, `tri_state::view(TriState, Option<&str>, on_change)`, `slider::stops(value, &[u32], format, on_change)`, `text_input::multiline(value, max, on_change)` and `form::{section, labelled, switch_row, radio_group, select}`. The user settings re-export the moved rows under their old names. **Invariants:** I found no new I/O path in fluxer-ui. The only `std::fs` is in the test that writes the settings-rows file. There are no panicking unwraps on data. `select` picks by index into the full list and ignores disabled entries. The stops slider takes empty stops. Colour parsing rejects non-finite numbers and clamps the channels. There are no secrets. **Parity, spot-checked against the fork:** - `parseColor`: `#rgb` and `#rgba` are expanded and `#rrggbbaa` is cut to six digits. The placeholder `#000000, rgb(...), red`, `maxLength=64`, the description and the error text are the same as `ColorPickerField.tsx`. - `PermissionStateButtons`: the Deny, Neutral and Allow labels are the same. A click sends the clicked state even when it is already active. Disabled buttons use opacity 0.5. The tooltip is `disabled && disabledReason`. The 2rem buttons and 0.5rem radius match. - `FormCombobox` "No results found" and "Select…" match. The `FormInput` counter `numberFormat(n)/numberFormat(max)` matches. **Review Focus:** no item applies to Task 8. **Local gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green. All steps passed and the goldens match. ### Findings - **minor:** The plan's Interfaces line names "preset swatches" for `color_field`. The original's `ColorPickerField` and `ColorPickerPopover` have none, and I checked this. The module doc says so, and following the original is correct. This is noted only so that later tasks do not look for presets. - **minor:** The multiline counter and the limit count Unicode scalar values. The original's `value.length` counts UTF-16 units, so text with astral-plane characters (such as emoji) can differ by one unit per character. This does not affect correctness of anything sent: the server validates. **Verdict: APPROVED.** There are no blocking findings and local CI is green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into serveradmin by hand (the merge API returns 405); the commits are in the branch.

Merged into `serveradmin` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-15 22:47:23 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.