Skip to content

fix(frontend): consistent Search bottom spacing on mobile across pages - #5564

Open
v4nsh0x wants to merge 1 commit into
OWASP:mainfrom
v4nsh0x:fix/search-bottom-spacing-mobile
Open

v4nsh0x wants to merge 1 commit into
OWASP:mainfrom
v4nsh0x:fix/search-bottom-spacing-mobile

Conversation

@v4nsh0x

@v4nsh0x v4nsh0x commented Sep 10, 2026

Copy link
Copy Markdown

Proposed change

Fixes inconsistent vertical spacing below the Search component in mobile viewport.

Pages rendered via SearchPageLayout without filterChildren/sortChildren (Members, Committees) had no gap between the search bar and content, while pages with filters (Chapters, Projects) got spacing from the mobile filter row.

  • Added base mb-4 to the search-bar wrapper (reset at md:)
  • Compensated the mobile filter row's top margin (mt-2-mt-1) so filtered pages don't double-space

Resolves #5148

Checklist

Pages without filter/sort children (Members, Committees) rendered no
vertical gap below the SearchBar in mobile viewport, while pages with
filters (Chapters, Projects) had mt-2 mb-4 spacing from the mobile
filter row. Move a base mb-4 onto the search wrapper (reset at md)
so all pages share the same bottom spacing, and compensate the filter
row's top margin.

Fixes OWASP#5148

Signed-off-by: Vansh Saxena <cyberblink0@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 48b64e54-58c1-4c30-b555-52cab806771e

📥 Commits

Reviewing files that changed from the base of the PR and between 12e607f and f835349.

📒 Files selected for processing (1)
  • frontend/src/components/SearchPageLayout.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Summary by CodeRabbit

  • Style
    • Improved search page spacing across desktop, medium, and mobile screen layouts.

Walkthrough

The search layout now applies consistent responsive spacing. Desktop adds bottom margin below the search bar, while medium screens remove it. Mobile controls use a reduced negative top margin.

Changes

Search spacing

Layer / File(s) Summary
Responsive search margins
frontend/src/components/SearchPageLayout.tsx
The desktop search wrapper adds mb-4 and removes it at the medium breakpoint with md:mb-0. The mobile controls container changes from mt-2 to -mt-1.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to f8353

Search layouts now use consistent mobile spacing below the search control while retaining the prior medium-and-up layout. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: consistent Search spacing on mobile pages.
Description check ✅ Passed The description directly explains the spacing issue, the CSS margin changes, and the resolution of issue #5148.
Linked Issues check ✅ Passed The changes satisfy issue #5148 by adding consistent mobile spacing below the Search component and preventing double spacing on filtered pages.
Out of Scope Changes check ✅ Passed The pull request changes only the SearchPageLayout spacing required for issue #5148. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ 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.

@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 1 file

Confidence score: 5/5

  • frontend/src/components/SearchPageLayout.tsx may leave inconsistent spacing below Search between the two page types because the mobile.filter-row compensation does not fully align with the wrapper’s new mb-4; verify both mobile layouts and adjust the margin if needed.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/SearchPageLayout.tsx">

<violation number="1" location="frontend/src/components/SearchPageLayout.tsx:101">
P3: The mobile.filter-row compensation (`mt-2` → `-mt-1`) leaves the gap below Search inconsistent across the two page types this PR aims to align. With the search wrapper now at `mb-4` (16px), the filter row's `-mt-1` (-4px) yields a 12px search-to-filter gap, while non-filtered pages (Members, Committees) get a 16px search-to-content gap. The prior single-space was 8px (`mt-2`). `-mt-1` matches neither the original 8px (which would need `-mt-2`) nor the non-filtered 16px (which would need `mt-0`), so filtered pages are still spaced differently from non-filtered ones after the fix.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

{(filterChildren || (inlineSort && sortChildren)) && (
<div
className={`mx-auto mt-2 mb-4 flex w-full max-w-md items-stretch md:hidden ${
className={`mx-auto -mt-1 mb-4 flex w-full max-w-md items-stretch md:hidden ${

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.

P3: The mobile.filter-row compensation (mt-2-mt-1) leaves the gap below Search inconsistent across the two page types this PR aims to align. With the search wrapper now at mb-4 (16px), the filter row's -mt-1 (-4px) yields a 12px search-to-filter gap, while non-filtered pages (Members, Committees) get a 16px search-to-content gap. The prior single-space was 8px (mt-2). -mt-1 matches neither the original 8px (which would need -mt-2) nor the non-filtered 16px (which would need mt-0), so filtered pages are still spaced differently from non-filtered ones after the fix.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/SearchPageLayout.tsx, line 101:

<comment>The mobile.filter-row compensation (`mt-2` → `-mt-1`) leaves the gap below Search inconsistent across the two page types this PR aims to align. With the search wrapper now at `mb-4` (16px), the filter row's `-mt-1` (-4px) yields a 12px search-to-filter gap, while non-filtered pages (Members, Committees) get a 16px search-to-content gap. The prior single-space was 8px (`mt-2`). `-mt-1` matches neither the original 8px (which would need `-mt-2`) nor the non-filtered 16px (which would need `mt-0`), so filtered pages are still spaced differently from non-filtered ones after the fix.</comment>

<file context>
@@ -98,7 +98,7 @@ const SearchPageLayout = ({
       {(filterChildren || (inlineSort && sortChildren)) && (
         <div
-          className={`mx-auto mt-2 mb-4 flex w-full max-w-md items-stretch md:hidden ${
+          className={`mx-auto -mt-1 mb-4 flex w-full max-w-md items-stretch md:hidden ${
             inlineSort ? 'gap-0' : 'justify-between gap-4'
           }`}
</file context>

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inconsistent bottom spacing below search component across pages on mobile

1 participant