Capitalise the first letter of user-entered names and titles - #57
Merged
Conversation
Malin's request from her first real session with the app: typing "buy
milk" and getting a card called "buy milk" reads as sloppy next to the
ones she typed properly.
One shared helper in js/text.js, called from the models - the models own
the data going to the server, and this is data shaping, not presentation.
Doing it in CSS with text-transform would have changed only how it looks
and left the stored value lowercase.
Applied to board titles, list titles, card titles, checklist items, label
names and the registration display name. NOT applied to:
* email addresses - the local part is matched literally, and a
capitalised address in the field looks like a typo the user made
* passwords - self-evident, but worth writing down next to the code
* card notes - prose, and the writer is entitled to start it however
they like
One guard: a word whose second letter is a capital was deliberate, so
iOS, eBay and iPhone are left alone. "IOS crash" is worse than the
lowercase it would replace. Beyond that the rule stays simple - guessing
at proper nouns is a bigger promise than this feature is worth.
Verified in the browser against the running app: the helper maps "buy
milk" to "Buy milk", leaves "iOS crash" and "eBay listing" untouched,
handles "alesund trip" with the Norwegian A-ring, and returns "" for the
empty string. Driving each model with fetch intercepted shows the
capitalised value in the request body for boards, lists, cards and
checklist items.
253/253 green - the change is frontend only, and the server still stores
whatever it is given.
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.
From Malin's first real session with the app: typing
buy milkand getting a card called "buy milk" reads as sloppy next to the ones she typed properly.Independent of the auth stack — base is
main, and it touches only the Slice 1 models plus the register model. No conflict with #53–#56.Where it happens
One shared helper,
js/text.js, called from the models. The models own the data going to the server, and this is data shaping rather than presentation —text-transform: capitalizein CSS would have changed only how it looks and left the stored value lowercase.Applied to: board titles, list titles, card titles, checklist items, label names, registration display name.
Deliberately not applied to:
The one guard
A word whose second letter is a capital was deliberate, so
iOS,eBayandiPhoneare left alone. "IOS crash" is worse than the lowercase it would have replaced. Beyond that the rule stays simple; guessing at proper nouns is a bigger promise than this feature is worth.Verification
Run against the live app in the browser:
buy milkBuy milkiOS crashiOS crasheBay listingeBay listingålesund tripÅlesund trip3 things3 thingsAnd with
fetchintercepted, driving each model directly:dotnet test→ 253 passed, 0 failed. Frontend only; the server still stores whatever it is given.What to check
iOSguard is a heuristic, not a rule. It handles the common camelCase brands and nothing else — a lowercase proper noun likeålesundstill gets capitalised, which here is right.