Disable Continue button styling when New API key form is incomplete
Before:
After:
Description
The Continue button in the "New API key" dialog (orchestration API key dropdown → + New API key…) was already non-functional when required fields were empty (handle_continue early-returns), but it always rendered with the accent blue fill and a pointing-hand cursor, so visually it looked clickable. This PR adds proper disabled styling so the affordance matches the behavior.
Before: button looks active even when name / API key are empty.
After: button renders with the design system's disabled palette (internal_colors::neutral_4 background, neutral_5 text, arrow cursor) until the form is ready to submit.
How
- Add
validated_form_snapshotas a single source of truth for "is this form ready to submit". Both the Continue button's disabled-state check (can_submit_creation_form) andhandle_continueconsume it, so they can't drift. render_buttongains adisabled: boolparam that swaps fill/text colors, switches cursor toArrow, and short-circuits the click handler. MirrorsDisabledThemeinview_components/action_button.rs.- Subscribe to
EditorEvent::Editedon the name + field editors so the button restyles live as the user types.
Continue is disabled when:
- No creation form is open
- A save is already in flight (
is_saving) - The trimmed name is empty
- Any non-optional field is empty after trimming
Linked Issue
Fixes https://linear.app/warpdotdev/issue/QUALITY-752/continue-button-should-be-disabled-in-secrets-popup-if-fields-not
Testing
- [x] I have manually tested my changes locally with
./script/run cargo check -p warp✓cargo clippy -p warp --all-targets --tests✓ (no new warnings)cargo fmt✓
Co-Authored-By: Oz [email protected]
@advait-m
I'm starting a first review of this pull request.
You can view the conversation on Warp.
I completed the review and no human review was requested for this pull request.
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz