Skip to content

fix(layout): drop the empty table of contents from pages with no headings - #12692

Open
flagendijk89 wants to merge 1 commit into
mainfrom
devs/frank/fix-empty-toc-rail/I3a14a632ed544b4d7cefe21c7237703a8d919cf7
Open

fix(layout): drop the empty table of contents from pages with no headings#12692
flagendijk89 wants to merge 1 commit into
mainfrom
devs/frank/fix-empty-toc-rail/I3a14a632ed544b4d7cefe21c7237703a8d919cf7

Conversation

@flagendijk89

@flagendijk89 flagendijk89 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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


🤖 Generated with Claude Code

…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
@mergify
mergify Bot deployed to Mergify Merge Protections September 4, 2026 19:11 Active
@mergify

mergify Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = renovate[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team September 4, 2026 19:16
@mergify
mergify Bot requested a review from a team September 5, 2026 09:10
@mergify

mergify Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants