Skip to content

Make account name optional and default to email#106

Merged
emreertunc merged 3 commits into
Lampese:mainfrom
Bl0ck154:feat/optional-account-name
Jul 24, 2026
Merged

Make account name optional and default to email#106
emreertunc merged 3 commits into
Lampese:mainfrom
Bl0ck154:feat/optional-account-name

Conversation

@Bl0ck154

Copy link
Copy Markdown
Contributor

Improves account setup UX by allowing the name to be left blank. OAuth and auth.json imports now use the account email when available, with a short account-ID fallback otherwise; explicit names and existing accounts remain unchanged. Added focused Rust coverage for OAuth/import name resolution.

@emreertunc emreertunc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the implementation. I found one issue that needs to be fixed before approval.

The OAuth and auth.json import flows now pass the raw account name instead of the previously trimmed value. For example, " Work " was previously stored as "Work", but this PR preserves the surrounding whitespace.

Since duplicate-name validation uses exact string comparison, "Work" and " Work " can be added as separate accounts even though they appear identical in the UI.

Please keep the name optional while continuing to normalize explicit names with name.trim(), either before sending them or in the backend.

@Bl0ck154

Copy link
Copy Markdown
Contributor Author

Thanks for catching this. Explicit account names are now trimmed centrally in the Rust account-creation path, while blank names still resolve to email/account-ID fallback. I also updated the focused test to cover whitespace normalization. Frontend production build and rustfmt check pass; focused Rust tests remain blocked locally by the missing MSVC link.exe toolchain component.

@emreertunc emreertunc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the original whitespace issue. The explicit account name is now normalized correctly, but centralizing the trim in StoredAccount introduces an inconsistency in slim backup imports.

Slim payload validation and active_name comparisons still use the original untrimmed names, while restored accounts now have trimmed names. For example, if " Second " is the active account, it is restored as "Second". The active-name lookup then fails and silently selects the first account instead.

Duplicate-name validation has the same normalization mismatch.

Please apply the same name normalization consistently to slim account names, active_name, existing-name checks, and restored names, or limit trimming to the new OAuth/auth.json input paths.

@Bl0ck154

Copy link
Copy Markdown
Contributor Author

Fixed in df8f81a. Trimming is now limited to the OAuth and auth.json entry points, so slim backup names and active-name matching remain unchanged. Added an auth.json trim test; frontend build and rustfmt pass.

@emreertunc
emreertunc merged commit 52cee5f into Lampese:main Jul 24, 2026
@emreertunc

Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

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