Skip to content

style: improve navbar spacing and reduce search bar width#949

Open
hk2166 wants to merge 2 commits intoalphaonelabs:mainfrom
hk2166:main
Open

style: improve navbar spacing and reduce search bar width#949
hk2166 wants to merge 2 commits intoalphaonelabs:mainfrom
hk2166:main

Conversation

@hk2166
Copy link

@hk2166 hk2166 commented Feb 24, 2026

  • Increase spacing between nav dropdown menus (space-x-2 → space-x-4)
  • Increase spacing between nav sections (space-x-3 → space-x-6)
  • Increase spacing between utility icons (space-x-2 → space-x-4)
  • Reduce search bar width from 250px to 180px
  • Simplify search placeholder to Search...

These changes reduce visual congestion in the navigation bar while maintaining all existing functionality and menu items.

style(navbar): reduce congestion and optimize spacing

  • Increased spacing between navigation items and utility icons
  • Reduced the width of the search bar to 180px
  • Simplified the search placeholder text to "Search..."
  • Improved visual separation between sections

Related issues

Fixes #946

Checklist

  • [✅] Did you run the pre-commit? (If not, your PR will most likely not pass — please ensure it passes pre-commit)
  • [✅] Did you test the change? (Ensure you didn’t just prompt the AI and blindly commit — test the code and confirm it works)
  • [✅] Added screenshots to the PR description
Screenshot 2026-02-24 at 5 09 46 PM

Summary by CodeRabbit

  • Style
    • Increased horizontal spacing in navigation items and menus for improved visual hierarchy
    • Reduced search bar width and updated search placeholder text for a cleaner interface
    • Adjusted spacing and padding across mobile menu sections
    • Enhanced alignment and visual spacing of header authentication and action elements
    • Fine-tuned overall spacing consistency throughout the header layout

- Increase spacing between nav dropdown menus (space-x-2 → space-x-4)
- Increase spacing between nav sections (space-x-3 → space-x-6)
- Increase spacing between utility icons (space-x-2 → space-x-4)
- Reduce search bar width from 250px to 180px
- Simplify search placeholder to Search...

These changes reduce visual congestion in the navigation bar while
maintaining all existing functionality and menu items.
Copilot AI review requested due to automatic review settings February 24, 2026 11:40
@github-actions github-actions bot added the files-changed: 2 PR changes 2 files label Feb 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Walkthrough

Spacing and sizing adjustments made to the navigation bar template to reduce visual congestion. Increases horizontal spacing in navigation elements, reduces search bar width, adjusts login icon margins, and updates mobile menu section padding.

Changes

Cohort / File(s) Summary
Navigation Bar Spacing & Sizing
web/templates/base.html
Increased horizontal spacing in top nav container (space-x-3 → space-x-6) and main nav items (space-x-2 → space-x-4). Reduced search input persistent width (w-[250px] → w-[180px]), updated placeholder text to "Search...", added w-full and text-sm classes, and adjusted vertical offset (top-2 → top-1). Modified login icon margin (mr-1 → mr-(-1)) and right-side action cluster spacing (space-x-2 → space-x-4). Updated mobile menu section padding (pb-4 → pb-6) for LEARN, COMMUNITY, RESOURCES, and ABOUT sections.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Suggested reviewers

  • A1L13N
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes a .env.example file creation which is unrelated to the navbar spacing and search bar width improvements specified in issue #946. Remove the .env.example file creation or address it in a separate PR focused on environment configuration, keeping this PR focused solely on navbar UI enhancements.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: improving navbar spacing and reducing search bar width, which directly addresses the primary objectives of the PR.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #946: increased spacing between nav items (space-x-2→space-x-4, space-x-3→space-x-6), reduced search width (250px→180px), and simplified search placeholder.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

Copilot AI left a comment

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 aims to reduce visual congestion in the navigation bar by adjusting spacing and reducing the search bar width. The changes address issue #946 which identified that the navbar looked slightly congested. The PR increases spacing between navigation elements and simplifies the search interface to create a cleaner, more spacious design.

Changes:

  • Increased spacing between navigation dropdown menus and sections (space-x-2 → space-x-4, space-x-3 → space-x-6)
  • Reduced search bar width from 250px to 180px with smaller text
  • Simplified search placeholder from "What do you want to learn?" to "Search..."

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.

File Description
web/templates/base.html Updated navbar spacing classes, reduced search bar width, adjusted search input styling, and modified mobile menu spacing
.env.sample Entire file deleted (appears unintentional)

<a href="{% url 'account_login' %}"
class="hover:underline flex items-center p-2 hover:bg-teal-700 rounded-lg">
<i class="fa-solid fa-right-to-bracket mr-1"></i>
<i class="fa-solid fa-right-to-bracket mr-(-1)"></i>
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Invalid Tailwind CSS class syntax. The class mr-(-1) is not valid Tailwind CSS. Tailwind uses negative margins with the format -mr-{size} (e.g., -mr-1, -mr-2), not mr-(-1). If you intended to use a negative right margin of 0.25rem, use -mr-1. If you intended to remove the margin entirely, use mr-0 or remove the class altogether.

Suggested change
<i class="fa-solid fa-right-to-bracket mr-(-1)"></i>
<i class="fa-solid fa-right-to-bracket mr-2"></i>

Copilot uses AI. Check for mistakes.
<div class="space-y-4">
<!-- LEARN Section -->
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
<div class="border-b border-gray-200 dark:border-gray-700 pb-6">
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Minor discrepancy with PR scope. This change increases mobile navigation section padding (pb-4 → pb-6), but the PR description focuses exclusively on desktop navbar spacing improvements. While this change is positive for consistency, it extends beyond the stated scope of the PR which only mentions changes to "navigation bar" spacing, typically referring to the desktop header navbar.

Copilot uses AI. Check for mistakes.
Comment on lines +350 to +352
class="rounded-full w-full bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-teal-300 dark:focus:ring-teal-700" />
<button type="submit"
class="absolute right-3 top-2 text-gray-500 dark:text-gray-300">
class="absolute right-3 top-1 text-gray-500 dark:text-gray-300">
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Undocumented change. The search button position was adjusted from top-2 to top-1, and the input received a text-sm class. While these changes make sense for the reduced search bar width and improved centering, they were not mentioned in the PR description. The PR description should document all visual changes for complete transparency.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/templates/base.html`:
- Line 559: The mobile accordion spacing is inconsistent: the LEARN section uses
class "pb-6" while COMMUNITY, RESOURCES, and ABOUT still use "pb-4"; update the
other accordion container divs that currently have "pb-4" (the COMMUNITY,
RESOURCES, and ABOUT section divs) to use "pb-6" so all mobile sections match,
or alternatively change the LEARN div's "pb-6" back to "pb-4" to keep the
original spacing—ensure all accordion container divs use the same "pb-4" or
"pb-6" Tailwind padding class for consistency.
- Around line 345-355: The search button (the button element inside the form
with classes "absolute right-3 top-1") is vertically misaligned because the
input uses py-1.5; change the positioning to restore vertical centering by
replacing "top-1" with "top-2" on the button, or convert the form layout to a
flex container (make the form a flex row, align-items center, remove absolute
positioning on the button) so the input and the button are vertically centered;
update the button class reference ("absolute right-3 top-1") and/or the form
element to implement the chosen fix.
- Around line 521-522: Replace the invalid Tailwind class mr-(-1) on the icon
element with the correct negative-margin syntax -mr-1; locate the <i> element
using the class string "fa-solid fa-right-to-bracket mr-(-1)" and update its
class list to use -mr-1 so the icon has the intended right spacing from the
"Login" <span> on sm+ breakpoints.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20cc175 and f17aa80.

📒 Files selected for processing (2)
  • .env.example
  • web/templates/base.html

Comment on lines +345 to 355
<div class="relative hidden lg:inline-block w-[180px]">
<form action="{% url 'course_search' %}" method="get" class="m-0">
<input type="text"
name="q"
placeholder="What do you want to learn?"
class="rounded-full w-[250px] bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-teal-300 dark:focus:ring-teal-700" />
placeholder="Search..."
class="rounded-full w-full bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-teal-300 dark:focus:ring-teal-700" />
<button type="submit"
class="absolute right-3 top-2 text-gray-500 dark:text-gray-300">
class="absolute right-3 top-1 text-gray-500 dark:text-gray-300">
<i class="fas fa-search"></i>
</button>
</form>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Search button may be visually misaligned after top-2top-1 change.

With py-1.5 on the input (~26px total height), top-1 (4px) positions the search icon above the vertical center. The previous top-2 (8px) was closer to center for this input height. Consider keeping top-2 or switching to a flex-based centering approach:

🎨 Proposed fix for button alignment
-<button type="submit"
-        class="absolute right-3 top-1 text-gray-500 dark:text-gray-300">
+<button type="submit"
+        class="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-300">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/templates/base.html` around lines 345 - 355, The search button (the
button element inside the form with classes "absolute right-3 top-1") is
vertically misaligned because the input uses py-1.5; change the positioning to
restore vertical centering by replacing "top-1" with "top-2" on the button, or
convert the form layout to a flex container (make the form a flex row,
align-items center, remove absolute positioning on the button) so the input and
the button are vertically centered; update the button class reference ("absolute
right-3 top-1") and/or the form element to implement the chosen fix.

Comment on lines +521 to 522
<i class="fa-solid fa-right-to-bracket mr-(-1)"></i>
<span class="hidden sm:inline">Login</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check if the file exists and examine the relevant lines
file="web/templates/base.html"
if [ -f "$file" ]; then
  echo "=== Lines 515-530 of $file ==="
  sed -n '515,530p' "$file" | cat -n
else
  echo "File not found. Let's search for it."
  find . -name "base.html" -type f
fi

Repository: alphaonelabs/alphaonelabs-education-website

Length of output: 1010


🏁 Script executed:

# Also check for any Tailwind configuration that might define custom utilities
find . -name "tailwind.config.*" -o -name "tailwind.json" -o -name ".tailwindrc*"

Repository: alphaonelabs/alphaonelabs-education-website

Length of output: 69


🏁 Script executed:

# Search the codebase for mentions of mr-(-1) to see if it's used elsewhere
rg "mr-\(\-[0-9]\)" --type html

Repository: alphaonelabs/alphaonelabs-education-website

Length of output: 179


🏁 Script executed:

# Check for CSS files and any definitions of mr-(-1)
find . -name "*.css" -type f | head -20

Repository: alphaonelabs/alphaonelabs-education-website

Length of output: 154


🏁 Script executed:

# Search for any CSS that might define mr-(-1)
rg "mr-\(\-" --type css

Repository: alphaonelabs/alphaonelabs-education-website

Length of output: 69


🌐 Web query:

Tailwind CSS negative margin syntax validation

💡 Result:

In Tailwind CSS, negative margin utilities are valid when you prefix the entire margin class with a leading dash (-):

  • Scale-based negatives: -m-4, -mx-2, -mt-8, -mb-px (pattern: -m{side?}-{size} / -m-<number> / -m-px) [1]
  • Custom/arbitrary values: m-[5px] is valid for custom margins, and negatives follow the same rule by prefixing with -, e.g. -m-[5px] / -mt-[12px] [1]

Common invalid forms:

  • m--4 / mt--8 (double dash in the middle) — use -m-4 / -mt-8 instead [1]

Source: Tailwind CSS “margin” documentation (negative values + custom values) [1].

References
[1] Tailwind CSS Docs — Margin: https://tailwindcss.com/docs/margin


mr-(-1) is not a valid Tailwind CSS class — remove and use correct negative margin syntax.

Tailwind requires a leading-dash prefix for negative values (-mr-1), not parenthesis syntax (mr-(-1)). The class mr-(-1) generates no CSS, leaving the icon with zero right margin instead of the intended spacing. This violates the guideline: "Use Tailwind CSS classes only in templates."

On sm+ breakpoints where the "Login" text displays inline, the icon and label will sit flush without the intended gap adjustment.

Fix
-<i class="fa-solid fa-right-to-bracket mr-(-1)"></i>
+<i class="fa-solid fa-right-to-bracket -mr-1"></i>
📝 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
<i class="fa-solid fa-right-to-bracket mr-(-1)"></i>
<span class="hidden sm:inline">Login</span>
<i class="fa-solid fa-right-to-bracket -mr-1"></i>
<span class="hidden sm:inline">Login</span>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/templates/base.html` around lines 521 - 522, Replace the invalid Tailwind
class mr-(-1) on the icon element with the correct negative-margin syntax -mr-1;
locate the <i> element using the class string "fa-solid fa-right-to-bracket
mr-(-1)" and update its class list to use -mr-1 so the icon has the intended
right spacing from the "Login" <span> on sm+ breakpoints.

<div class="space-y-4">
<!-- LEARN Section -->
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
<div class="border-b border-gray-200 dark:border-gray-700 pb-6">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent bottom padding in mobile accordion sections.

Only the LEARN section was updated to pb-6 (Line 559); the COMMUNITY (Line 615), RESOURCES (Line 676), and ABOUT (Line 719) sections remain at pb-4. This creates uneven spacing between accordion items in the mobile menu. Either update all sections consistently or revert LEARN to pb-4.

🎨 Proposed fix — align all mobile accordion sections
-<div class="border-b border-gray-200 dark:border-gray-700 pb-6">  <!-- LEARN -->
+<div class="border-b border-gray-200 dark:border-gray-700 pb-4">  <!-- LEARN -->

Or apply pb-6 to COMMUNITY, RESOURCES, and ABOUT as well:

 <!-- COMMUNITY Section -->
-<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
+<div class="border-b border-gray-200 dark:border-gray-700 pb-6">
 <!-- RESOURCES Section -->
-<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
+<div class="border-b border-gray-200 dark:border-gray-700 pb-6">
 <!-- ABOUT Section -->
-<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
+<div class="border-b border-gray-200 dark:border-gray-700 pb-6">

As per coding guidelines: "Use consistent spacing with gap-{size} and space-{y|x}-{size} Tailwind classes."

📝 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
<div class="border-b border-gray-200 dark:border-gray-700 pb-6">
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/templates/base.html` at line 559, The mobile accordion spacing is
inconsistent: the LEARN section uses class "pb-6" while COMMUNITY, RESOURCES,
and ABOUT still use "pb-4"; update the other accordion container divs that
currently have "pb-4" (the COMMUNITY, RESOURCES, and ABOUT section divs) to use
"pb-6" so all mobile sections match, or alternatively change the LEARN div's
"pb-6" back to "pb-4" to keep the original spacing—ensure all accordion
container divs use the same "pb-4" or "pb-6" Tailwind padding class for
consistency.

@Shrey1006
Copy link
Contributor

Hey @hk2166 , refer #948
You can redesign the Navbar... Make sure the color matches with the webpage pages
and follow the Readme.md file for performing the tests

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

Labels

files-changed: 2 PR changes 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navbar Looks Slightly Congested – UI Enhancement

3 participants