Skip to content

fix: align docs footer with content and fix mobile text truncation#110

Open
KhaledSaeed18 wants to merge 1 commit into
ui-layouts:mainfrom
KhaledSaeed18:fix/docs-footer-alignment
Open

fix: align docs footer with content and fix mobile text truncation#110
KhaledSaeed18 wants to merge 1 commit into
ui-layouts:mainfrom
KhaledSaeed18:fix/docs-footer-alignment

Conversation

@KhaledSaeed18

@KhaledSaeed18 KhaledSaeed18 commented May 8, 2026

Copy link
Copy Markdown

Summary

Fixed two layout bugs in the docs page footer ("Built by naymur. The source code is available on GitHub."):

  • Large screens: footer was rendered outside the <section> that holds all doc content, so it didn't inherit the mx-auto + responsive max-w-* constraints causing it to overflow to the left and misalign with the content above it.
  • Mobile: text-balance was collapsing the available line width, cutting the text off mid-sentence at the bottom.

Changes

  • apps/ui-layout/app/(docs-page)/components/[...slug]/page.tsx: moved <Footer /> inside the <section> so it shares the same mx-auto and max-w-* alignment as all content above it
  • apps/ui-layout/components/website/footer.tsx: removed text-balance, added proper vertical padding

Before / After

Large Screen

Before After
large-before large-after

Mobile Screen

Before After
mobile-before Screenshot 2026-05-08 at 4 26 35 AM

Root Cause

<Footer /> was placed after the closing </section> tag in page.tsx. The section uses mx-auto with breakpoint-specific max-w-* values (lg:max-w-140, xl:max-w-190, 2xl:max-w-210) to center and constrain content, but the footer sat in the parent div with no such constraints, stretching full width and starting at the left edge regardless of the content offset.

Type of Change

  • Bug fix (non-breaking, layout only)

Checklist

  • Footer aligns with doc content on all breakpoints
  • Full footer text visible on mobile
  • No regressions to content layout or prose styles (not-prose preserved)

Summary by CodeRabbit

  • Style

    • Updated footer styling with adjusted spacing and padding.
  • Refactor

    • Repositioned footer component within the page layout structure.

@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

@KhaledSaeed18 is attempting to deploy a commit to the UI-Layouts OSS Program Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request refines the footer component by repositioning it within the page section's DOM hierarchy and updating its Tailwind styling. The footer now nests directly inside the main <section> after the content, and its spacing and text alignment classes are adjusted.

Changes

Footer Layout and Styling Update

Layer / File(s) Summary
Layout Structure
apps/ui-layout/app/(docs-page)/components/[...slug]/page.tsx
Footer component moved inside the <section> block, positioned immediately after <Content /> and before the section closes.
Footer Component Styling
apps/ui-layout/components/website/footer.tsx
Footer element's Tailwind classes updated: py-6 replaces previous xl:pb-2 p-2 mt-8 rounded-md; paragraph element changed from text-balance to text-center.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A footer finds its home within the fold,
Nestled snug where the content does hold,
With padding refined and text centered bright,
The layout now flows in perfect sight!
twitch nose

🚥 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 accurately describes the main changes: aligning the footer with content by moving it inside the section, and fixing mobile text truncation by adjusting Tailwind classes.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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

🧹 Nitpick comments (1)
apps/ui-layout/components/website/footer.tsx (1)

5-29: 💤 Low value

Unnecessary <> Fragment wrapping a single element.

The component returns exactly one <footer>, so the enclosing Fragment adds no value.

♻️ Proposed simplification
-  return (
-    <>
-      <footer className='mt-8 not-prose py-6'>
-        ...
-      </footer>
-    </>
-  );
+  return (
+    <footer className='mt-8 not-prose py-6'>
+      ...
+    </footer>
+  );
🤖 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 `@apps/ui-layout/components/website/footer.tsx` around lines 5 - 29, The
fragment wrapper `<>...</>` around the single <footer> element is unnecessary;
update the component (the JSX return that currently wraps <footer> with a
fragment) to return the <footer> directly by removing the surrounding fragment
tokens so the component returns the footer element alone.
🤖 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.

Nitpick comments:
In `@apps/ui-layout/components/website/footer.tsx`:
- Around line 5-29: The fragment wrapper `<>...</>` around the single <footer>
element is unnecessary; update the component (the JSX return that currently
wraps <footer> with a fragment) to return the <footer> directly by removing the
surrounding fragment tokens so the component returns the footer element alone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac3f4ca6-169f-4c2f-b045-ec2913796006

📥 Commits

Reviewing files that changed from the base of the PR and between bd62672 and 081eca3.

📒 Files selected for processing (2)
  • apps/ui-layout/app/(docs-page)/components/[...slug]/page.tsx
  • apps/ui-layout/components/website/footer.tsx

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.

1 participant