Improve curtailment workflow UX#443
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM Findings[MEDIUM] Site-scoped response profiles can be applied while the target control still shows miner selection
NotesReviewed Generated by Codex Security Review | |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aee00b0e8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Improves the curtailment workflow UX across the ProtoFleet client and supporting server surfaces by enabling CTA-driven validation feedback (instead of disabled actions), restoring/clearing scope state when switching response profiles, and aligning curtailment “MQTT” copy to “MaestroOS” for operator-facing messaging.
Changes:
- Client: Enable Save/Run/Test CTAs while surfacing required-field validation on click (including Enter-to-save handling) and remove focus highlights for read-only inputs.
- Client: Restore saved response-profile scope when switching profiles (clearing stale miner selections for whole-fleet profiles) and adjust curtailment polling to continue while non-terminal history is visible.
- Server: Update various curtailment source/automation error strings and admin-action copy from “MQTT” to “MaestroOS”, with tests updated/added accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/internal/handlers/curtailment/handler.go | Updates admin-action copy to “MaestroOS” for source-management messages. |
| server/internal/domain/curtailment/mqttingest/subscriber.go | Updates broker-transport validation error copy to “MaestroOS”. |
| server/internal/domain/curtailment/mqttingest/settings_service.go | Updates MaestroOS source error copy for test/reconcile/quiesce/store mapping. |
| server/internal/domain/curtailment/mqttingest/settings_service_test.go | Adds/updates tests asserting new MaestroOS-facing error strings. |
| server/internal/domain/curtailment/automation.go | Updates automation validation/errors to refer to MaestroOS sources. |
| server/internal/domain/curtailment/automation_test.go | Updates assertions for updated MaestroOS-facing automation messages/reason strings. |
| client/src/shared/components/Input/Input.tsx | Suppresses focus styling for read-only inputs and adjusts cursor behavior. |
| client/src/shared/components/Input/Input.test.tsx | Adds coverage for read-only focus styling suppression. |
| client/src/protoFleet/features/settings/components/Curtailment/keyboard.ts | Adds shared key handler helper for Enter-to-save within curtailment modals. |
| client/src/protoFleet/features/settings/components/Curtailment/CurtailmentSettingsPage.tsx | Reworks source modal validation to show errors on CTA click; adds Enter-to-save. |
| client/src/protoFleet/features/settings/components/Curtailment/CurtailmentSettingsPage.test.tsx | Updates tests for CTA-enabled validation behavior and Enter-to-save. |
| client/src/protoFleet/features/settings/components/Curtailment/CurtailmentAutomations.tsx | Enables Save CTA while showing validation on click; adds Enter-to-save. |
| client/src/protoFleet/features/settings/components/Curtailment/CurtailmentAutomations.test.tsx | Updates tests for CTA-enabled validation behavior and Enter-to-save. |
| client/src/protoFleet/features/energy/CurtailmentStartModal.tsx | Restores response-profile scope correctly and shows local validation on CTA click. |
| client/src/protoFleet/features/energy/CurtailmentStartModal.test.tsx | Adds/updates tests for scope restoration and CTA-enabled required-field validation. |
| client/src/protoFleet/features/energy/CurtailmentManagementPanel.tsx | Continues polling while visible history includes non-terminal events. |
| client/src/protoFleet/features/energy/CurtailmentManagementPanel.test.tsx | Adds test ensuring polling continues with non-terminal history after active clears. |
rongxin-liu
left a comment
There was a problem hiding this comment.
Looks good overall! Some minor issues worth fixing before merging.
| return; | ||
| } | ||
|
|
||
| if (!canSave) { |
There was a problem hiding this comment.
In edit mode with a saved password, changing a credential field (e.g. changing username) makes passwordRequired true, so clicking Save lands here with saveValidationErrors.password set — but the input keeps rendering the ...... placeholder, so the field looks filled while the error says it's empty. The Test connection path already clears the placeholder for exactly this case (from the earlier review round);
Save needs the same treatment:
if (!canSave) {
if (showSavedPasswordPlaceholder && saveValidationErrors.password) {
setPasswordPlaceholderActive(false);
}
setValidationIntent("save");
return;
}(plus saveValidationErrors / showSavedPasswordPlaceholder in the useCallback deps).
Summary
Screen.Recording.2026-06-12.at.10.29.00.AM.mov
Screen.Recording.2026-06-12.at.10.30.39.AM.mov
Screen.Recording.2026-06-12.at.10.31.30.AM.mov
Untitled.mov
Test plan