Skip to content

Keep the footer on the fold when a page does not fill the screen#5

Merged
fritzhand merged 1 commit into
mainfrom
claude/startup-stack-github-scraper-mbp53h
Jul 25, 2026
Merged

Keep the footer on the fold when a page does not fill the screen#5
fritzhand merged 1 commit into
mainfrom
claude/startup-stack-github-scraper-mbp53h

Conversation

@fritzhand

@fritzhand fritzhand commented Jul 25, 2026

Copy link
Copy Markdown
Owner

The bug

Scroll to the bottom of a long page, click a top-level sidebar group. The second click lands on a section landing page, those pages are short — a lede and a few cards — and the footer was left floating wherever the content stopped, with the rail carrying on below it to the bottom of the screen.

Measured on tools.html before the fix:

footerBottom=571  railBottom=913  viewportH=913  gapBelowFooter=342

342px of rail under a detached footer.

Why it was there

Nothing in site.css had ever set a minimum height, so a short page has always ended early. It was invisible while the sidebar was position: sticky, because the rail ended with .layout and the two stopped together. Making the rail fixed — which is what stopped it locking at page bottom — is what exposed it.

So this is the third change in a chain, and worth reading as one: sticky rail locked at page bottom → made it fixed → fixed rail ran under the footer → gave the footer a left margin → fixed rail ran below the footer on short pages → this.

The fix

body is a flex column with min-height: 100dvh, and .layout takes the slack. The footer is pushed to the fold on a short page and behaves normally on a long one.

The sticky topbar stays the first row. Everything fixed — the rail, the scrim, the search modal, the lightbox, back-to-top — is out of flow and unaffected.

Verification

Case Result
tools.html, run-a-portfolio.html (short) gapBelowFooter=0 — footer bottom, rail bottom and viewport all at 913
index.html, what-things-are.html (long) unchanged, footer below the fold
1500px footerLeft=268, railRight=268 — no overlap
900px drawer off-canvas, footer full width
Long page scrolled to bottom rail top 58, first group 87 — the earlier fix still holds

node web/build.mjs clean: 61 pages, 19 prompts, 10 worksheets, 69 search entries.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved page layout behavior so the footer remains anchored to the bottom of the screen when pages have limited content.
    • Ensured the layout adapts correctly to the full available viewport height.

Scroll to the bottom of a long page, click a top-level sidebar group, and the
second click lands you on a section landing page. Those pages are short -- a
lede and a few cards -- and the footer was left floating wherever the content
happened to stop, with the rail carrying on below it to the bottom of the
screen. Measured on tools.html: footer bottom at 571, rail bottom at 913. That
is 342px of rail under a detached footer.

Nothing in this stylesheet had ever set a minimum height, so a short page has
always ended early. It was invisible while the sidebar was sticky, because the
rail ended with the content and the two stopped together. Making the rail fixed
so it would stop locking at page bottom is what exposed it.

Body is now a flex column with a minimum of one viewport, and .layout takes the
slack, so the footer is pushed down to the fold on a short page and behaves
normally on a long one. The sticky topbar stays the first row; everything
fixed -- the rail, the scrim, the modals, the back-to-top -- is out of flow and
unaffected.

Checked after: short pages report gapBelowFooter=0 with the footer bottom, the
rail bottom and the viewport all at the same pixel. Long pages are unchanged.
At 1500px the footer starts at 268 where the rail ends; at 900px the drawer is
off-canvas and the footer runs full width. The page-bottom scroll fix still
holds, with the rail at 58 and its first group at 87.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The page body now uses a vertical flex layout with a minimum dynamic viewport height, while the main layout expands to consume remaining space and keep the footer anchored on short pages.

Changes

Footer anchoring layout

Layer / File(s) Summary
Viewport-filling flex layout
web/assets/site.css
The body uses a column flex layout with min-height: 100dvh, and .layout uses flex: 1 0 auto to fill remaining space.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: keeping the footer at the bottom on short pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/startup-stack-github-scraper-mbp53h

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/assets/site.css`:
- Around line 37-44: Update the explanatory comment above the column flex layout
to state that sticky elements remain in normal flow, while only fixed elements
are removed from flow; preserve the surrounding explanation of the footer and
topbar behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fc18274-d7b7-4567-86e2-a98e6147e3f5

📥 Commits

Reviewing files that changed from the base of the PR and between ac1e81a and e64d90f.

📒 Files selected for processing (1)
  • web/assets/site.css

Comment thread web/assets/site.css
Comment on lines +37 to +44
/* Column flex so the footer is pushed to the bottom of the viewport on a
page whose content does not fill it. Nothing here set a minimum height
before, so a short page left the footer floating wherever the prose
happened to stop — invisible while the rail was sticky and ended with the
content, obvious once it became fixed and ran to the bottom of the screen
regardless. The short section landing pages are where it shows most.
The fixed and sticky children sit outside this flow, except .topbar, which
is sticky and is meant to be the first row. */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the sticky-positioning explanation.

position: sticky elements remain in normal flow; only fixed-position elements are removed from flow. Please update this comment so it does not misdescribe the behavior this layout relies on.

Suggested wording
-     The fixed and sticky children sit outside this flow, except .topbar, which
-     is sticky and is meant to be the first row. */
+     Fixed children sit outside this flow; sticky children remain in flow, with
+     .topbar intentionally occupying the first row. */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* Column flex so the footer is pushed to the bottom of the viewport on a
page whose content does not fill it. Nothing here set a minimum height
before, so a short page left the footer floating wherever the prose
happened to stop — invisible while the rail was sticky and ended with the
content, obvious once it became fixed and ran to the bottom of the screen
regardless. The short section landing pages are where it shows most.
The fixed and sticky children sit outside this flow, except .topbar, which
is sticky and is meant to be the first row. */
/* Column flex so the footer is pushed to the bottom of the viewport on a
page whose content does not fill it. Nothing here set a minimum height
before, so a short page left the footer floating wherever the prose
happened to stop — invisible while the rail was sticky and ended with the
content, obvious once it became fixed and ran to the bottom of the screen
regardless. The short section landing pages are where it shows most.
Fixed children sit outside this flow; sticky children remain in flow, with
.topbar intentionally occupying the first row. */
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/assets/site.css` around lines 37 - 44, Update the explanatory comment
above the column flex layout to state that sticky elements remain in normal
flow, while only fixed elements are removed from flow; preserve the surrounding
explanation of the footer and topbar behavior.

@fritzhand
fritzhand merged commit 276f13d into main Jul 25, 2026
5 checks passed
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.

2 participants