Skip to content

fix: defer provider name trimming to submission time#12903

Merged
kangfenmao merged 1 commit intomainfrom
kangfenmao/provider-name-trim
Feb 13, 2026
Merged

fix: defer provider name trimming to submission time#12903
kangfenmao merged 1 commit intomainfrom
kangfenmao/provider-name-trim

Conversation

@kangfenmao
Copy link
Copy Markdown
Collaborator

What this PR does

Before this PR:

  • Provider name input was trimmed on every keystroke during typing
  • Users couldn't type spaces between words without them being immediately removed
  • Button disabled state checked raw name length

After this PR:

  • Provider name input preserves spaces during typing
  • Name is trimmed only when submitting (both onOk and onClose)
  • Button disabled state correctly checks trimmed name length
  • Improved UX while maintaining data integrity

Fixes #

Why we need it and why it was done in this way

This improves the user experience by allowing natural typing behavior. Users can now type spaces between words (e.g., "My Provider") without the spaces being immediately stripped.

The following tradeoffs were made:

  • Trade-off: Users can now see leading/trailing spaces in the input field during typing, but this is acceptable as the final value is properly trimmed on submission

The following alternatives were considered:

  • Trimming only leading/trailing spaces on input: This would be more complex and still interfere with natural typing
  • Not trimming at all: This would allow invalid provider names with whitespace

Links to places where the discussion took place:
N/A

Breaking changes

None. This is a pure UX improvement with no API or data model changes.

Special notes for your reviewer

  • The change ensures both onOk (submit) and onClose paths trim the name
  • The buttonDisabled logic now correctly checks if the trimmed name is empty
  • No changes to data models or IndexedDB schema

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

Improved provider name input UX by allowing spaces during typing. Names are now trimmed only on submission.

Improve UX by allowing users to type spaces while editing provider names.
The name is now trimmed only when submitting, not on every keystroke.
@kangfenmao kangfenmao merged commit 6ae1cb0 into main Feb 13, 2026
7 checks passed
@kangfenmao kangfenmao deleted the kangfenmao/provider-name-trim branch February 13, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants