Skip to content

fix(layout): add bottom padding so content has breathing room#306

Merged
Amund211 merged 1 commit into
mainfrom
layout-bottom-padding
Jun 30, 2026
Merged

fix(layout): add bottom padding so content has breathing room#306
Amund211 merged 1 commit into
mainfrom
layout-bottom-padding

Conversation

@Amund211

@Amund211 Amund211 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Wrap <main>'s children in a box with bottom padding so pages get a real bottom-of-content spacer that scrolls with the content. Padding on <main> itself doesn't work — it's overflow:visible, so the padding ends up flush with the viewport instead of trailing the content.

The wrapper is a flex column (flexGrow:1; display:flex; flexDirection:column) so it fills <main> when content is short — keeping a full-height containing block for routes that center on height:100% (e.g. the home page) — and grows past the viewport when content is long, so the spacer trails the content.

Note: an earlier revision set minHeight: 0 on the wrapper (intended to preserve home-page centering). That turned out to be unnecessary — flexGrow:1 alone provides the full-height containing block — and actively harmful: it clamps the wrapper to the viewport, so on any page that overflows (downloads, history, session, wrapped) the spacer was buried mid-content instead of trailing it. Verified in-browser that removing it fixes the spacer on every scrolling route with no change to home-page centering. Thanks @copilot for flagging.

Extracted from the session detail page work (#256) as an independent change.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying rainbow with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3becc73
Status: ✅  Deploy successful!
Preview URL: https://09677a84.rainbow-ctx.pages.dev
Branch Preview URL: https://layout-bottom-padding.rainbow-ctx.pages.dev

View logs

@Amund211 Amund211 force-pushed the layout-bottom-padding branch from 2518240 to 04967e7 Compare June 28, 2026 15:18
@Amund211 Amund211 marked this pull request as ready for review June 28, 2026 15:58
Copilot AI review requested due to automatic review settings June 28, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the app’s top-level Layout to add a bottom-of-content spacer by wrapping <main>’s children in an inner container, aiming to ensure long pages have “breathing room” that scrolls with the content while preserving full-height layout behavior for centered routes.

Changes:

  • Wrap <main> children in a Box wrapper instead of rendering children directly.
  • Add paddingBottom via the wrapper (instead of padding on <main>) and set the wrapper up as a full-height flex column.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Layout.tsx
@Amund211 Amund211 force-pushed the layout-bottom-padding branch from 04967e7 to bc0914c Compare June 28, 2026 18:57
The main container had matching padding on all sides, but the visual
weight of the header makes the bottom feel cramped — chart tooltips and
the last section sit flush against the viewport edge. Wrap the children
in a box with bottom padding so there's a real bottom-of-content spacer
that scrolls with the content (padding on `<main>` itself doesn't work,
since it's overflow:visible and the padding ends up flush with the
viewport).

The wrapper is a flex column (flexGrow:1) so it fills `<main>` when
content is short — keeping a full-height containing block for routes
that center on `height:100%` (e.g. the home page) — and grows past the
viewport when content is long, so the spacer trails the content.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Amund211 Amund211 force-pushed the layout-bottom-padding branch from bc0914c to 3becc73 Compare June 28, 2026 20:50
@Amund211 Amund211 requested a review from Copilot June 30, 2026 16:09
@Amund211 Amund211 merged commit d14048b into main Jun 30, 2026
9 checks passed
@Amund211 Amund211 deleted the layout-bottom-padding branch June 30, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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