warp icon indicating copy to clipboard operation
warp copied to clipboard

Disable Continue button styling when New API key form is incomplete

Open advait-m opened this issue 6 months ago • 1 comments

Before: image

After: image

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_snapshot as a single source of truth for "is this form ready to submit". Both the Continue button's disabled-state check (can_submit_creation_form) and handle_continue consume it, so they can't drift.
  • render_button gains a disabled: bool param that swaps fill/text colors, switches cursor to Arrow, and short-circuits the click handler. Mirrors DisabledTheme in view_components/action_button.rs.
  • Subscribe to EditorEvent::Edited on 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 avatar May 28 '26 01:05 advait-m

@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

warp-for-oss[bot] avatar May 28 '26 02:05 warp-for-oss[bot]