Skip to content

Capitalise the first letter of user-entered names and titles - #57

Merged
malinfossum merged 2 commits into
mainfrom
feat/capitalise-first
Aug 21, 2026
Merged

Capitalise the first letter of user-entered names and titles#57
malinfossum merged 2 commits into
mainfrom
feat/capitalise-first

Conversation

@malinfossum

Copy link
Copy Markdown
Member

From Malin's 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.

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: capitalize in 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:

Field Why not
Email The local part is matched literally, and a capitalised address in the field looks like a typo the user made
Password Self-evident, but worth writing down next to the code
Card notes Prose — the writer is entitled to start it however they like

The 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 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:

Input Output
buy milk Buy milk
iOS crash iOS crash
eBay listing eBay listing
ålesund trip Ålesund trip
3 things 3 things
`` (empty) ``

And with fetch intercepted, driving each model directly:

POST /api/boards                  {"title":"Lowercase board"}
POST /api/boards/1/lists          {"title":"Todo list"}
POST /api/lists/1/cards           {"title":"Write the readme"}
POST /api/cards/1/checklist-items {"text":"Check the boxes"}

dotnet test253 passed, 0 failed. Frontend only; the server still stores whatever it is given.

What to check

  • Whether you agree this belongs in the model rather than the controller. It is normalisation of data on its way out, which reads as model work to me, but it is the kind of call worth a second opinion.
  • The iOS guard is a heuristic, not a rule. It handles the common camelCase brands and nothing else — a lowercase proper noun like ålesund still gets capitalised, which here is right.
  • Nothing normalises existing rows. Titles created before this ship keep their original casing.

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.
@malinfossum
malinfossum merged commit 3cd66b1 into main Aug 21, 2026
1 check passed
@malinfossum
malinfossum deleted the feat/capitalise-first branch August 21, 2026 13: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.

1 participant