Repository navigation
Capitalize sign-in error reasons before reporting them - #6
Merged
Merged
Conversation
Clients such as Zed prepend their own lead-in ("Sign-in did not
complete:"), so embedding the reason in a second sentence read
awkwardly. Report the reason as a standalone, capitalized sentence
instead.
Co-Authored-By: OndeCode v1.1.1-acp <noreply@ondeinference.com>
There was a problem hiding this comment.
This change reworks sign-in error messages so the reason reads as a standalone, capitalized sentence instead of being embedded mid-sentence. The authenticate and browser_auth::begin error paths now call a new capitalize helper that uppercases only the first character (Unicode-aware via to_uppercase), and a unit test covers already-capitalized input, Unicode (élan → Élan), and the empty string. The helper and message rewrites are correct and well-tested; the empty-string case is explicitly covered by the test and yields a leading period, which is an acceptable edge case for an error reason that is never empty in practice.
Automated review by siGit Code Review · commit 71f75f8 · see the review dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sign-in error reasons were embedded mid-sentence (
"Sign-in did not complete ({reason}). Try again, …"). Clients such as Zed prepend their own lead-in ("Sign-in did not complete:"), so the message read as a duplicated, awkwardly-cased sentence.This PR reports the reason as a standalone, capitalized sentence instead:
authenticatefailure:"{Reason}. Try again, or run \onde-code --setup` in a terminal to paste a key."`browser_auth::beginfailure:"{Reason}. Run \onde-code --setup` in a terminal to paste a key instead."`Adds a small
capitalizehelper that uppercases only the first character (Unicode-aware viato_uppercase).Testing
capitalize_uppercases_only_the_first_character(covers already-capitalized input, Unicodeélan→Élan, and empty string).cargo fmt --checkclean;cargo testincrates/agent— 18 passed, 0 failed.