Repository navigation
fix(content): start the agent's headings and title with a capital, in the page's language - #1626
Merged
Merged
Conversation
…he page's language
A page the Content Agent wrote had an H2 "latest news ChatGPT": a fan-out
used in its own words, as the fan-out rules ask, and fan-outs come
lowercase.
- A new page's headings (its title, H2s, FAQ heading and questions) start
with a capital when their first word is all lowercase, in the page's
language (Turkish "i" becomes "İ"); a name written lowercase on purpose
("iPhone", "eBay") stays as it is (headingCase, renderPage's language).
Split out of fix/agent-fanout-headings (230f7f54); reading a joined
fan-out as each search is its own branch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The H1 went through headingCase but the title column kept the model's
words as written (clean(written.title)), so a lowercase title read
"latest news…" in the Library and the header while the page's H1 read
"Latest news…". The title is now saved through headingCase in the page's
language too, as the H1 shows it. A test writes an English and a Turkish
("istanbul" → "İstanbul") title and reads both the column and the H1.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 12 tasks
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
I checked headingCase in Turkish: istanbul → İstanbul, ılık süt → Ilık süt, İstanbul/IŞIK/ChatGPT nedir left as they are. az and tr-TR behave like tr. iPhone, eBay, 2026 rehberi and e-posta come out right. draftLanguage returns a code (languageCodeOf), so the locale is always one the runtime reads. It runs linearly on long input. The title column and the H1 match, and the new tests fail without the change.
Follow-ups:
- (medium) Only a new page's write path is covered. On an existing page, the agent's suggestions insert H2s with a fan-out's own words (
FANOUT_RULE), which is where lowercase headings come from most. A whole-page rewrite's headings aren't covered either. ApplyingheadingCaseto theh1–h3an insert or a rewrite brings in would cover both. - (low) With no language,
toLocaleUpperCase(undefined)(content-writer.js:235) uses the server's default locale. PlaintoUpperCase()there doesn't depend on the host. - (low) Edge cases, if they matter:
- It capitalizes the first character, not the first letter, so
¿qué es AEO?and"nasıl" yapılırstay lowercase. - Dutch
ijslandbecomesIjsland, where Dutch writesIJsland. - A brand written all lowercase (
npm) becomesNpm. Leaving the first word alone when it is the brand's name as written would avoid that.
- It capitalizes the first character, not the first letter, so
Before the API deploy: no change. It's a server change.
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
The test page had a heading written in lower case: "latest news ChatGPT".
content-writer.jsgetsheadingCase. It capitalizes the first letter in the page's language (Turkishi→İ), leaving names like "iPhone" and "eBay" as they are.renderPagetakes{ language }and applies it to the H1 and the headings.titlecolumn is saved with the same capital as the H1, so the Library, the CMS name, the slug and the meta title match it.Needs the API deploy.
Related issue
None. From Ansvisor’s production test of the Content Editor and Send to CMS (2026-10-27).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd server && npx vitest run src/lib/content-writer.test.jsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Checked together with the other PRs from the same test (one integration tree of all eleven on main 3f6a4d4):
server/:npm run format,npm run lintandnpm test(3,349 tests).web/:yarn format,yarn lint(0 errors, the 7 earlier warnings),yarn typecheck,yarn test(4,385 tests) andyarn build.🤖 Generated with Claude Code