Skip to content

Disable Continue button styling when New API key form is incomplete#11802

Merged
advait-m merged 1 commit into
masterfrom
advait/ftux-continue-button-disabled-state
May 29, 2026
Merged

Disable Continue button styling when New API key form is incomplete#11802
advait-m merged 1 commit into
masterfrom
advait/ftux-continue-button-disabled-state

Conversation

@advait-m
Copy link
Copy Markdown
Member

@advait-m advait-m commented May 28, 2026

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

  • 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 oz-agent@warp.dev

The Continue button in the auth-secret FTUX dialog (orchestration API
key dropdown -> '+ New API key...') already early-returned when
required fields were empty, but it always rendered with the accent
blue fill and a pointing-hand cursor, so visually it looked clickable.

- Add `validated_form_snapshot` as a single validation source consumed
  by both the disabled-state check and `handle_continue`, so the two
  can't drift.
- Disable Continue (gray fill via `internal_colors::neutral_4`,
  muted text via `neutral_5`, arrow cursor, no-op click) when name or
  any required field is empty, or while the save is in flight.
- Subscribe to `EditorEvent::Edited` on the name + field editors so
  the button restyles as the user types.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 28, 2026
@advait-m advait-m marked this pull request as ready for review May 28, 2026 01:59
@advait-m advait-m requested a review from cephalonaut May 28, 2026 01:59
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 28, 2026

@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

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR disables the Continue affordance in the New API key flow until the creation form has a trimmed non-empty name, all required fields are non-empty, and no save is in flight. The implementation reuses the same validation snapshot for rendering and submit handling, updates the button live on editor edits, and includes before/after screenshots for the user-facing styling change.

Concerns

  • No blocking correctness, security, or spec-alignment concerns found.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@advait-m advait-m merged commit 8901a2f into master May 29, 2026
60 of 64 checks passed
@advait-m advait-m deleted the advait/ftux-continue-button-disabled-state branch May 29, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants