fix(layout): drop the empty table of contents from pages with no headings - #12692
Open
flagendijk89 wants to merge 1 commit into
Open
fix(layout): drop the empty table of contents from pages with no headings#12692flagendijk89 wants to merge 1 commit into
flagendijk89 wants to merge 1 commit into
Conversation
…ings The homepage's "On this page" rail held a single entry, "Overview", pointing at `#overview` — an id that does not exist there. It was the only dead link on the site. `generateToc` always prepends that entry, and the id it targets lives on the `<h1>` `PageContent` renders. A page with `suppressTitle` emits no `<h1>`, so the entry has nothing to scroll to. Those pages now get no rail, and the column it reserved goes back to the content: the homepage gains 336px of width it was holding for an 18rem aside with one broken link in it. Two things this turned up. `margin-inline-start` has to be restored to the sidebar width when the rail is gone. The left sidebar is `position: fixed`, so nothing in flow clears it; above 82em the column's own margin drops to a 3rem gutter because `#right-sidebar` — a flex item that precedes `#main-content` in the DOM and is then shifted right by `left: 100%` — reserves the width instead. Removing the rail without restoring that margin slid the content under the sidebar above 1312px only. `.main-column-footer` already compensates the same way for living outside `.layout`. The changelog index and every changelog entry also set `suppressTitle`. They never had a table of contents, but they did carry PageFeedback in that rail, and the article-footer copy is hidden above 82em precisely because the rail was assumed to have one — which left roughly 200 pages with no feedback widget at all on desktop. That rule is now scoped to pages that actually render a rail. Presence is passed explicitly rather than read from `Astro.slots.has()`, which reports a slot as present even when the expression filling it evaluated to nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Change-Id: I3a14a632ed544b4d7cefe21c7237703a8d919cf7 Claude-Session-Id: 18413631-aa75-4182-9e79-4c1ce31bb683
Contributor
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
sileht
approved these changes
Sep 5, 2026
jd
approved these changes
Sep 5, 2026
Contributor
Merge Queue Status
|
63 tasks
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.
Part of MRGFY-8998 — design polish review, August 2026. One of four independent PRs from that pass.
The homepage's "On this page" rail held a single entry, "Overview",
pointing at
#overview— an id that does not exist there. It was theonly dead link on the site.
generateTocalways prepends that entry, and the id it targets lives onthe
<h1>PageContentrenders. A page withsuppressTitleemits no<h1>, so the entry has nothing to scroll to. Those pages now get norail, and the column it reserved goes back to the content: the homepage
gains 336px of width it was holding for an 18rem aside with one broken
link in it.
Two things this turned up.
margin-inline-starthas to be restored to the sidebar width when therail is gone. The left sidebar is
position: fixed, so nothing in flowclears it; above 82em the column's own margin drops to a 3rem gutter
because
#right-sidebar— a flex item that precedes#main-contentinthe DOM and is then shifted right by
left: 100%— reserves the widthinstead. Removing the rail without restoring that margin slid the
content under the sidebar above 1312px only.
.main-column-footeralready compensates the same way for living outside
.layout.The changelog index and every changelog entry also set
suppressTitle.They never had a table of contents, but they did carry PageFeedback in
that rail, and the article-footer copy is hidden above 82em precisely
because the rail was assumed to have one — which left roughly 200 pages
with no feedback widget at all on desktop. That rule is now scoped to
pages that actually render a rail.
Presence is passed explicitly rather than read from
Astro.slots.has(),which reports a slot as present even when the expression filling it
evaluated to nothing.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
🤖 Generated with Claude Code