Server admin 33: ui-sudo-delete-transfer (#701) #769

Closed
charles wants to merge 0 commits from serveradmin-33-ui-sudo-delete-transfer into serveradmin
Owner

What

Server administration Task 33 (spec §3.9, §12): the identity check, delete community and transfer ownership in fluxer-ui.

  • screens/main/modals/sudo.rs: "Verify it's you" (SudoVerificationModal.{tsx,module.css}) over admin::sudo::model. It shows the masked "Password" field, or "Authenticator code" with the "6-digit code" placeholder, or the "No verification methods available" box. The no-methods state has no footer, because Modal.DismissFooter renders nothing on the desktop, so the header X closes it. It also shows the field error under the field and the submitting state (both buttons disabled). Cancel, the X, Escape and the backdrop send SudoAction::Cancel.
  • Secrets: the typed text lives only in sudo::State (Local::sudo) as a SecretString. It leaves the view in the one SudoAction::Submit, and the field is empty afterwards, so a refused answer shows its error under an empty field. State, Message and UiMessage::Sudo have Debug impls that redact the text, and SudoModalModel carries only filled: bool.
  • screens/main/modals/transfer_ownership.rs: "Transfer community ownership" (TransferOwnershipModal.{tsx,module.css}) over admin::guild::transfer_model. It has the warning box, the name and "irreversible" in bold (600, the original's globals.css strong), Cancel and the red "Transfer ownership", both disabled while the request is out. A refused transfer's alert opens on top of the modal, which stays open, as in the original.
  • message_actions/confirm.rs: Confirm::DeleteGuild (GuildDeleteModal.tsx: "I changed my mind" at its natural width, the red "Delete community"), the store's Confirm::TransferOwnership with the same strings, and the admin.error alert titled "Failed to transfer ownership" for a refused transfer (GroupOwnershipTransferFailedModal.tsx).
  • app.rs: the transfer modal and, above everything (settings screens included), the identity check are drawn in view and routed through UiMessage::{Sudo, Transfer}. Local::sudo is synced on each snapshot.

Strings: all come from the fork, either through the core's constants (admin::sudo, admin::guild) or, for the transfer warning's bold word, from TransferOwnershipModal.tsx.

Tests

  • crates/fluxer-ui/tests/sudo_modal.rs (headless): password_field_is_secure_and_not_in_any_model checks that the typed text is not in the model, the State/Local/Message/UiMessage Debug, the drawn texts or the store after submit. Also totp_field_when_method_is_totp, error_shown_and_field_cleared_on_retry, cancel_emits_cancel, no_methods_state, delete_and_transfer_confirm_strings and sudo_modal_is_above_settings_screen (clicks reach the modal, not the settings).
  • Goldens (lavapipe): sudo_modal_password, sudo_modal_totp, sudo_modal_error, delete_community_modal, transfer_ownership_modal, with references in docs/screenshots/ and rows in its README. Dimensions are taken from SudoVerificationModal.module.css (.unavailable), TransferOwnershipModal.module.css (.warningBox) and Modal.module.css. No Electron side-by-side is attached.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally, after merging the latest origin/serveradmin (Task 29). No FLUXER_DESKTOP_TESTS test was needed or run.

Deviations

  • crates/fluxer-ui/src/message.rs is outside the task's file list. It gains the two UiMessage variants that app.rs routes.
  • origin/serveradmin (573324bc) does not compile: Task 29 met Task 27 (#767). Commit b7c8f289 adds the missing waiting: false in entity_settings/channel/mod.rs and sets main::Modal::ALL to 29 entries. Both files are outside this task, and these are the smallest fixes that let the gate run.
  • Escape for both modals goes through widgets::modal::over's key handler, as for the other modals, and not through a new rung in the shell's Escape ladder.
  • "error_shown_and_field_cleared_on_retry" is read as: the text leaves the field with the submit, so the retry starts empty under the error.

Stacked on: origin/serveradmin-19-core-sudo-delete-transfer, origin/serveradmin-23-ui-community-settings-overview, origin/serveradmin-27-ui-menus-moderation-modals (all already on serveradmin)

Closes #701

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What Server administration Task 33 (spec §3.9, §12): the identity check, delete community and transfer ownership in `fluxer-ui`. - `screens/main/modals/sudo.rs`: "Verify it's you" (`SudoVerificationModal.{tsx,module.css}`) over `admin::sudo::model`. It shows the masked "Password" field, or "Authenticator code" with the "6-digit code" placeholder, or the "No verification methods available" box. The no-methods state has no footer, because `Modal.DismissFooter` renders nothing on the desktop, so the header X closes it. It also shows the field error under the field and the submitting state (both buttons disabled). Cancel, the X, Escape and the backdrop send `SudoAction::Cancel`. - Secrets: the typed text lives only in `sudo::State` (`Local::sudo`) as a `SecretString`. It leaves the view in the one `SudoAction::Submit`, and the field is empty afterwards, so a refused answer shows its error under an empty field. `State`, `Message` and `UiMessage::Sudo` have `Debug` impls that redact the text, and `SudoModalModel` carries only `filled: bool`. - `screens/main/modals/transfer_ownership.rs`: "Transfer community ownership" (`TransferOwnershipModal.{tsx,module.css}`) over `admin::guild::transfer_model`. It has the warning box, the name and "irreversible" in bold (600, the original's `globals.css` `strong`), Cancel and the red "Transfer ownership", both disabled while the request is out. A refused transfer's alert opens on top of the modal, which stays open, as in the original. - `message_actions/confirm.rs`: `Confirm::DeleteGuild` (`GuildDeleteModal.tsx`: "I changed my mind" at its natural width, the red "Delete community"), the store's `Confirm::TransferOwnership` with the same strings, and the `admin.error` alert titled "Failed to transfer ownership" for a refused transfer (`GroupOwnershipTransferFailedModal.tsx`). - `app.rs`: the transfer modal and, above everything (settings screens included), the identity check are drawn in `view` and routed through `UiMessage::{Sudo, Transfer}`. `Local::sudo` is synced on each snapshot. Strings: all come from the fork, either through the core's constants (`admin::sudo`, `admin::guild`) or, for the transfer warning's bold word, from `TransferOwnershipModal.tsx`. ## Tests - `crates/fluxer-ui/tests/sudo_modal.rs` (headless): `password_field_is_secure_and_not_in_any_model` checks that the typed text is not in the model, the State/Local/Message/UiMessage `Debug`, the drawn texts or the store after submit. Also `totp_field_when_method_is_totp`, `error_shown_and_field_cleared_on_retry`, `cancel_emits_cancel`, `no_methods_state`, `delete_and_transfer_confirm_strings` and `sudo_modal_is_above_settings_screen` (clicks reach the modal, not the settings). - Goldens (lavapipe): `sudo_modal_password`, `sudo_modal_totp`, `sudo_modal_error`, `delete_community_modal`, `transfer_ownership_modal`, with references in `docs/screenshots/` and rows in its README. Dimensions are taken from `SudoVerificationModal.module.css` (`.unavailable`), `TransferOwnershipModal.module.css` (`.warningBox`) and `Modal.module.css`. No Electron side-by-side is attached. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally, after merging the latest `origin/serveradmin` (Task 29). No `FLUXER_DESKTOP_TESTS` test was needed or run. ## Deviations - `crates/fluxer-ui/src/message.rs` is outside the task's file list. It gains the two `UiMessage` variants that `app.rs` routes. - `origin/serveradmin` (573324bc) does not compile: Task 29 met Task 27 (#767). Commit b7c8f289 adds the missing `waiting: false` in `entity_settings/channel/mod.rs` and sets `main::Modal::ALL` to 29 entries. Both files are outside this task, and these are the smallest fixes that let the gate run. - Escape for both modals goes through `widgets::modal::over`'s key handler, as for the other modals, and not through a new rung in the shell's Escape ladder. - "error_shown_and_field_cleared_on_retry" is read as: the text leaves the field with the submit, so the retry starts empty under the error. Stacked on: origin/serveradmin-19-core-sudo-delete-transfer, origin/serveradmin-23-ui-community-settings-overview, origin/serveradmin-27-ui-menus-moderation-modals (all already on serveradmin) Closes #701 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The identity check modal (SudoVerificationModal.tsx) over every screen, the
typed password or code kept only in the view state as a SecretString and
moved out with SudoAction::Submit; the "Transfer community ownership" modal
(TransferOwnershipModal.tsx); "Delete community" (GuildDeleteModal.tsx) and
the store's transfer confirm through the generic confirm; the refused
transfer's alert titled "Failed to transfer ownership". Goldens
sudo_modal_{password,totp,error}, delete_community_modal,
transfer_ownership_modal.

Refs #701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
# Conflicts:
#	crates/fluxer-ui/src/app.rs
#	crates/fluxer-ui/src/message.rs
Task 29's channel confirm lacked Task 27's ConfirmModel::waiting, and
main::Modal::ALL counted 28 of its 29 layers.

Refs #701

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

Review of Task 33 (ui-sudo-delete-transfer), independent reviewer

Reviewed git diff 5ef97336..origin/serveradmin-33-ui-sudo-delete-transfer, but only this task's own changes (32e6c1e8 and the b7c8f289 fix). Task 29's code that came in through the merge is not reviewed here.

What checks out

  • Tests: all 7 planned tests are in tests/sudo_modal.rs and assert what the plan says. The password test searches the model, the view state, UiMessage, the drawn texts and format!("{app:?}") after the replay. The retry test checks the server's message and an empty field. Cancel, no methods, delete and transfer strings, and the modal over the settings screen (clicks reach the modal, not the settings) are each covered. The 5 goldens are present, with README rows and docs/screenshots copies.
  • Interfaces: the sudo modal has a masked password field, or a TOTP field with the placeholder "6-digit code". It shows the field error, a submitting state that disables both buttons, Cancel, and the "no methods" box with no footer. The text leaves the view state only in SudoAction::Submit. Confirm::{DeleteGuild, TransferOwnership} are drawn and accepted. Crate invariants hold: there is no new I/O, and State, Message and UiMessage::Sudo redact the text in their Debug output.
  • Parity spot checks against the fork:
    • GuildDeleteModal.tsx: the title, the body, "I changed my mind" and the danger button all match.
    • TransferOwnershipModal.tsx: the title, the warning with the name and "irreversible" in bold, and both buttons disabled while the transfer is out all match.
    • GroupOwnershipTransferFailedModal.tsx: the alert is titled "Failed to transfer ownership".
    • SudoVerificationModal.tsx: the strings and the self-hosted text of the unavailable box match.
    • CSS: .unavailable (gap 0.5rem, padding 0.75rem, radius 0.5rem, title 0.9375rem/600) and .warningBox (1px --background-header-secondary, 0.375rem radius, padding 1rem) match.

Findings

  1. [blocking] Secret leak, spec §12 and Review Focus 6: the password can end up in the channel composer. The identity check's field is never focused when the modal opens; the original has autoFocus. Also, neither the sudo modal nor the transfer modal is in main::Modal / open_modals. So when nothing has the keyboard focus, a printable key reaches the shell's WindowEvent::Key path (app.rs around line 1289). That path checks only app.ui.settings (the user settings), so the key goes to main::typing_target, which calls composer.type_text and focuses the composer. Covered passes both events and operations to the screen under the modal. Here is how it happens: you confirm "Delete community" from the community settings, or "Transfer ownership" from a member menu. The server answers SUDO_MODE_REQUIRED and "Verify it's you" opens. You start typing your password without clicking the field first. The characters go into the hidden draft of the selected channel (the store's draft, through edited(...), plus typing events), not into the password field. Once the composer has the focus, Enter sends the password to the channel as a message. Fix inside this task: focus the sudo field when the prompt opens (as autoFocus does), and keep typing away from the composer while the sudo or transfer modal is open (register them in Modal::ALL/is_open, or have typing_target return None while admin.sudo.prompt is set). Add a test that no printable key reaches the composer while the identity check is open.
  2. [blocking] The PR cannot be merged. Forgejo reports mergeable: false. Since this branch was cut, origin/serveradmin has gained Task 25 (the roles tab) and 817d9ce1/dbc6abbb, a separate fix for the same Task 27/29 compile break as b7c8f289. Merging gives conflicts in message_actions/confirm.rs, where Task 25 adds Kind::DeleteRole and RoleAction in the same match arms as Kind::DeleteGuild/TransferOwnership, and in entity_settings/channel/mod.rs. Merge origin/serveradmin, keep both sides in confirm.rs (Confirm::DeleteRole is now Task 25's), drop whichever of the two compile fixes is redundant, and run the gate again.
  3. [minor] Escape needs two presses when the field is focused. iced's text_input takes Escape to unfocus itself, so the backdrop's on_escape sees nothing. With the field focused, the first Escape only unfocuses it and the second cancels. The original closes on the first press.
  4. [minor] The alert over the transfer modal is drawn twice. On the main screen, confirm::over already draws the store's alert under the transfer modal, and transfer_ownership::over draws it again on top. You can't see the extra copy, but it is redundant.
  5. [minor] An unused function. transfer_ownership::escape is never called. Escape goes through the backdrop handler, as the notes say.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on b7c8f289: green on the branch head as pushed (all steps passed, exit 0; screenshot tests included). Not run on a merge with current origin/serveradmin, which conflicts (finding 2).

Verdict: changes requested. Fix findings 1 and 2. 3 to 5 are optional.

## Review of Task 33 (ui-sudo-delete-transfer), independent reviewer Reviewed `git diff 5ef97336..origin/serveradmin-33-ui-sudo-delete-transfer`, but only this task's own changes (32e6c1e8 and the b7c8f289 fix). Task 29's code that came in through the merge is not reviewed here. **What checks out** - Tests: all 7 planned tests are in `tests/sudo_modal.rs` and assert what the plan says. The password test searches the model, the view state, `UiMessage`, the drawn texts and `format!("{app:?}")` after the replay. The retry test checks the server's message and an empty field. Cancel, no methods, delete and transfer strings, and the modal over the settings screen (clicks reach the modal, not the settings) are each covered. The 5 goldens are present, with README rows and docs/screenshots copies. - Interfaces: the sudo modal has a masked password field, or a TOTP field with the placeholder "6-digit code". It shows the field error, a submitting state that disables both buttons, Cancel, and the "no methods" box with no footer. The text leaves the view state only in `SudoAction::Submit`. `Confirm::{DeleteGuild, TransferOwnership}` are drawn and accepted. Crate invariants hold: there is no new I/O, and `State`, `Message` and `UiMessage::Sudo` redact the text in their `Debug` output. - Parity spot checks against the fork: - `GuildDeleteModal.tsx`: the title, the body, "I changed my mind" and the danger button all match. - `TransferOwnershipModal.tsx`: the title, the warning with the name and "irreversible" in bold, and both buttons disabled while the transfer is out all match. - `GroupOwnershipTransferFailedModal.tsx`: the alert is titled "Failed to transfer ownership". - `SudoVerificationModal.tsx`: the strings and the self-hosted text of the unavailable box match. - CSS: `.unavailable` (gap 0.5rem, padding 0.75rem, radius 0.5rem, title 0.9375rem/600) and `.warningBox` (1px `--background-header-secondary`, 0.375rem radius, padding 1rem) match. **Findings** 1. **[blocking] Secret leak, spec §12 and Review Focus 6: the password can end up in the channel composer.** The identity check's field is never focused when the modal opens; the original has `autoFocus`. Also, neither the sudo modal nor the transfer modal is in `main::Modal` / `open_modals`. So when nothing has the keyboard focus, a printable key reaches the shell's `WindowEvent::Key` path (`app.rs` around line 1289). That path checks only `app.ui.settings` (the user settings), so the key goes to `main::typing_target`, which calls `composer.type_text` and focuses the composer. `Covered` passes both events and operations to the screen under the modal. Here is how it happens: you confirm "Delete community" from the community settings, or "Transfer ownership" from a member menu. The server answers `SUDO_MODE_REQUIRED` and "Verify it's you" opens. You start typing your password without clicking the field first. The characters go into the hidden draft of the selected channel (the store's draft, through `edited(...)`, plus typing events), not into the password field. Once the composer has the focus, Enter sends the password to the channel as a message. Fix inside this task: focus the sudo field when the prompt opens (as `autoFocus` does), and keep typing away from the composer while the sudo or transfer modal is open (register them in `Modal::ALL`/`is_open`, or have `typing_target` return `None` while `admin.sudo.prompt` is set). Add a test that no printable key reaches the composer while the identity check is open. 2. **[blocking] The PR cannot be merged.** Forgejo reports `mergeable: false`. Since this branch was cut, origin/serveradmin has gained Task 25 (the roles tab) and 817d9ce1/dbc6abbb, a separate fix for the same Task 27/29 compile break as b7c8f289. Merging gives conflicts in `message_actions/confirm.rs`, where Task 25 adds `Kind::DeleteRole` and `RoleAction` in the same match arms as `Kind::DeleteGuild`/`TransferOwnership`, and in `entity_settings/channel/mod.rs`. Merge origin/serveradmin, keep both sides in confirm.rs (`Confirm::DeleteRole` is now Task 25's), drop whichever of the two compile fixes is redundant, and run the gate again. 3. **[minor] Escape needs two presses when the field is focused.** iced's `text_input` takes Escape to unfocus itself, so the backdrop's `on_escape` sees nothing. With the field focused, the first Escape only unfocuses it and the second cancels. The original closes on the first press. 4. **[minor] The alert over the transfer modal is drawn twice.** On the main screen, `confirm::over` already draws the store's alert under the transfer modal, and `transfer_ownership::over` draws it again on top. You can't see the extra copy, but it is redundant. 5. **[minor] An unused function.** `transfer_ownership::escape` is never called. Escape goes through the backdrop handler, as the notes say. **Local gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on b7c8f289: green on the branch head as pushed (all steps passed, exit 0; screenshot tests included). Not run on a merge with current origin/serveradmin, which conflicts (finding 2). **Verdict: changes requested.** Fix findings 1 and 2. 3 to 5 are optional.
# Conflicts:
#	crates/fluxer-ui/src/screens/entity_settings/channel/mod.rs
#	crates/fluxer-ui/src/screens/main/message_actions/confirm.rs
#	docs/screenshots/README.md
- The identity check's field (sudo::FIELD_ID) takes the keyboard focus when the
  modal opens and after a refused answer (sudo::State::sync names it).
- main::Modal gains Sudo and TransferOwnership, and main::typing_target is None
  while any modal layer is open, so a key typed over "Verify it's you" never
  reaches the channel's composer and keybinds rest.
- Escape cancels the identity check on its first press, before the focused
  field can take it (screenshare::picker::on_escape_first).
- The main screen and the community settings leave the store's alert to the
  transfer modal while it is open, so "Failed to transfer ownership" is drawn
  once; the unused transfer_ownership::escape is gone.
- Merged origin/serveradmin (Task 25's DeleteRole kept beside DeleteGuild and
  TransferOwnership; 817d9ce1 supersedes b7c8f289).

Refs #701

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

Round 1 fixes, in 449f7649 (merge 7a4e4864). Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green.

Blocking: the password could leak into the composer (app.rs)

  • The field now has an id (sudo::FIELD_ID) and takes the keyboard focus when the modal opens, and again when a refused answer comes back. sudo::State::sync returns the id, and the shell's snapshot sync turns it into operation::focus, chained last so nothing else in that batch takes the focus away.
  • main::Modal gains Sudo and TransferOwnership (ALL is now 31), so keybinds rest under both. main::typing_target now returns None while any modal layer is open, so a printable key typed with the field unfocused no longer reaches the composer. This also covers the other modal layers, which had the same gap.
  • New tests in tests/sudo_modal.rs: sudo_modal_keeps_typing_out_of_the_composer (focus on open and after a refusal, open_modals == [Sudo], typing_target/composer_editor are None, the composer takes typing again after Cancel) and transfer_modal_keeps_typing_out_of_the_composer.

Blocking: not mergeable (confirm.rs, channel/mod.rs)

  • Merged origin/serveradmin. confirm.rs keeps both sides: Task 25's RoleAction import, the DeleteRole => role_confirm arm and Kind::DeleteRole, next to DeleteGuild/TransferOwnership => admin. For channel/mod.rs and main/mod.rs, 817d9ce1's version is kept, so b7c8f289's redundant fix drops out of the diff (the branch no longer differs from serveradmin in those files). Also resolved a conflict in docs/screenshots/README.md, where both sides' rows are kept.

Minor: first Escape only unfocused the field (sudo.rs)

  • Fixed. The sudo layer is wrapped in a new screenshare::picker::on_escape_first, which is Intercept with a first flag: it sees Escape before the focused text_input does, so the first press cancels. Test: first_escape_cancels_with_the_field_focused checks that the field has the focus (a typed key is published as Input) and that one Escape publishes Cancel. I checked that this test fails without the fix.

Minor: transfer alert drawn twice (transfer_ownership.rs)

  • Fixed. main's message-actions layer and the community settings now leave out the store's confirm/alert while the transfer modal is open, so only transfer_ownership::over draws it, on top. Removed the unused transfer_ownership::escape: the top layer's backdrop key handler closes it. Test: transfer_failure_alert_drawn_once.

The crate README is updated to match.

Round 1 fixes, in 449f7649 (merge 7a4e4864). Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green. **Blocking: the password could leak into the composer (app.rs)** - The field now has an id (`sudo::FIELD_ID`) and takes the keyboard focus when the modal opens, and again when a refused answer comes back. `sudo::State::sync` returns the id, and the shell's snapshot sync turns it into `operation::focus`, chained last so nothing else in that batch takes the focus away. - `main::Modal` gains `Sudo` and `TransferOwnership` (`ALL` is now 31), so keybinds rest under both. `main::typing_target` now returns `None` while any modal layer is open, so a printable key typed with the field unfocused no longer reaches the composer. This also covers the other modal layers, which had the same gap. - New tests in `tests/sudo_modal.rs`: `sudo_modal_keeps_typing_out_of_the_composer` (focus on open and after a refusal, `open_modals == [Sudo]`, `typing_target`/`composer_editor` are `None`, the composer takes typing again after Cancel) and `transfer_modal_keeps_typing_out_of_the_composer`. **Blocking: not mergeable (confirm.rs, channel/mod.rs)** - Merged origin/serveradmin. confirm.rs keeps both sides: Task 25's `RoleAction` import, the `DeleteRole => role_confirm` arm and `Kind::DeleteRole`, next to `DeleteGuild`/`TransferOwnership => admin`. For channel/mod.rs and main/mod.rs, 817d9ce1's version is kept, so b7c8f289's redundant fix drops out of the diff (the branch no longer differs from serveradmin in those files). Also resolved a conflict in docs/screenshots/README.md, where both sides' rows are kept. **Minor: first Escape only unfocused the field (sudo.rs)** - Fixed. The sudo layer is wrapped in a new `screenshare::picker::on_escape_first`, which is `Intercept` with a `first` flag: it sees Escape before the focused text_input does, so the first press cancels. Test: `first_escape_cancels_with_the_field_focused` checks that the field has the focus (a typed key is published as `Input`) and that one Escape publishes `Cancel`. I checked that this test fails without the fix. **Minor: transfer alert drawn twice (transfer_ownership.rs)** - Fixed. main's message-actions layer and the community settings now leave out the store's confirm/alert while the transfer modal is open, so only `transfer_ownership::over` draws it, on top. Removed the unused `transfer_ownership::escape`: the top layer's backdrop key handler closes it. Test: `transfer_failure_alert_drawn_once`. The crate README is updated to match.
Author
Owner

Review round 2 of Task 33 (ui-sudo-delete-transfer), by an independent reviewer

I reviewed this task's own changes at 449f7649 (git diff origin/serveradmin...origin/serveradmin-33-ui-sudo-delete-transfer). Code from other tasks that came in through the merges is not part of this review.

What checks out

  • Plan tests: all 7 plan tests are in tests/sudo_modal.rs and assert what the plan says, using the spec's and the original's strings. The 4 new round-1 tests are there too: typing is kept out of the composer under the sudo modal and under the transfer modal, the first Escape cancels, and the alert is drawn once. The 5 goldens (sudo_modal_{password,totp,error}, delete_community_modal, transfer_ownership_modal) are in screenshots.rs. Each fixtures/golden image is byte-identical to its docs/screenshots copy, and each has a README row.
  • Interfaces: the masked password field or the TOTP field ("6-digit code") is chosen by the core method. The modal has the field error, the submitting state (both buttons disabled), Cancel, X, Escape and backdrop, and the no-methods box with no footer. Confirm::{DeleteGuild, TransferOwnership} are drawn and accepted.
  • Secrets (spec §12, Review Focus 6): the typed text lives only in sudo::State as a SecretString and leaves it in the single SudoAction::Submit. Debug of State, Message, UiMessage::Sudo and Local redacts it, and the test searches the model, the drawn texts and {app:?}. Round 1's blocking leak is fixed: FIELD_ID takes the focus when the modal opens and after a refusal (chained last), Modal::{Sudo, TransferOwnership} are modal layers, and typing_target is None while any modal layer is open. on_escape_first captures Escape, so the settings screen's OnEscape does not also close the settings.
  • Invariants: no new I/O path in fluxer-ui, no new dependency (secrecy was already a workspace dependency), and no fixtures or tokens added.
  • Parity spot checks against the fork:
    • GuildDeleteModal.tsx: the title, the body, "I changed my mind" and the danger button match.
    • TransferOwnershipModal.{tsx,module.css}: the title, the warning with <strong> on the name and on "irreversible", the .warningBox values (1px --background-header-secondary, 0.375rem, 1rem), and both buttons disabled while the transfer is out all match.
    • SudoVerificationModal.tsx: "Verify it's you", the description, "6-digit code", "Enter your password." and the self-hosted text of the unavailable box match. The server's message is shown under the field, as FormUtils.handleError does. Modal.DismissFooter returns null when !MobileLayout.enabled, which confirms that the no-methods state has no footer.
    • GroupOwnershipTransferFailedModal.tsx: the alert is titled "Failed to transfer ownership".
  • Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci reports all steps passed (exit 0).

Findings

  1. [minor] confirm.rs draws "Delete community" with waiting: false, and the core (Task 19) closes the confirm as soon as it is accepted. The original keeps GuildDeleteModal open with submitting on the danger button until the request settles, so the sudo modal opens over it. Ours closes first. The user-visible difference is small, and the spec only asks for "a plain confirm", so this is not blocking.

Verdict: approved. There are no blocking findings, and the local CI is green.

## Review round 2 of Task 33 (ui-sudo-delete-transfer), by an independent reviewer I reviewed this task's own changes at 449f7649 (`git diff origin/serveradmin...origin/serveradmin-33-ui-sudo-delete-transfer`). Code from other tasks that came in through the merges is not part of this review. **What checks out** - **Plan tests:** all 7 plan tests are in `tests/sudo_modal.rs` and assert what the plan says, using the spec's and the original's strings. The 4 new round-1 tests are there too: typing is kept out of the composer under the sudo modal and under the transfer modal, the first Escape cancels, and the alert is drawn once. The 5 goldens (`sudo_modal_{password,totp,error}`, `delete_community_modal`, `transfer_ownership_modal`) are in `screenshots.rs`. Each `fixtures/golden` image is byte-identical to its `docs/screenshots` copy, and each has a README row. - **Interfaces:** the masked password field or the TOTP field ("6-digit code") is chosen by the core method. The modal has the field error, the submitting state (both buttons disabled), Cancel, X, Escape and backdrop, and the no-methods box with no footer. `Confirm::{DeleteGuild, TransferOwnership}` are drawn and accepted. - **Secrets (spec §12, Review Focus 6):** the typed text lives only in `sudo::State` as a `SecretString` and leaves it in the single `SudoAction::Submit`. `Debug` of `State`, `Message`, `UiMessage::Sudo` and `Local` redacts it, and the test searches the model, the drawn texts and `{app:?}`. Round 1's blocking leak is fixed: `FIELD_ID` takes the focus when the modal opens and after a refusal (chained last), `Modal::{Sudo, TransferOwnership}` are modal layers, and `typing_target` is `None` while any modal layer is open. `on_escape_first` captures Escape, so the settings screen's `OnEscape` does not also close the settings. - **Invariants:** no new I/O path in fluxer-ui, no new dependency (`secrecy` was already a workspace dependency), and no fixtures or tokens added. - **Parity spot checks against the fork:** - `GuildDeleteModal.tsx`: the title, the body, "I changed my mind" and the danger button match. - `TransferOwnershipModal.{tsx,module.css}`: the title, the warning with `<strong>` on the name and on "irreversible", the `.warningBox` values (1px `--background-header-secondary`, 0.375rem, 1rem), and both buttons disabled while the transfer is out all match. - `SudoVerificationModal.tsx`: "Verify it's you", the description, "6-digit code", "Enter your password." and the self-hosted text of the unavailable box match. The server's message is shown under the field, as `FormUtils.handleError` does. `Modal.DismissFooter` returns null when `!MobileLayout.enabled`, which confirms that the no-methods state has no footer. - `GroupOwnershipTransferFailedModal.tsx`: the alert is titled "Failed to transfer ownership". - **Local gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` reports all steps passed (exit 0). **Findings** 1. [minor] `confirm.rs` draws "Delete community" with `waiting: false`, and the core (Task 19) closes the confirm as soon as it is accepted. The original keeps `GuildDeleteModal` open with `submitting` on the danger button until the request settles, so the sudo modal opens over it. Ours closes first. The user-visible difference is small, and the spec only asks for "a plain confirm", so this is not blocking. **Verdict: approved.** There are no blocking findings, and the 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-17 05:04:15 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.