Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rinkitadhana
Copy link
Contributor

@rinkitadhana rinkitadhana commented Mar 18, 2025

Fixes #3983

Changes Introduced in This PR:

  • Completely redesigned the navbar for a better UI/UX.
  • Arranged components according to the correct hierarchy.
  • Added Proper space and heading for better readability.
  • Made the navbar fully responsive across all screen sizes.
  • Added hover effects and removed unnecessary elements.

Before:

2025-03-18.22-15-34.mp4

After:

2025-03-18.22-17-00.mp4

Summary by CodeRabbit

  • Style
    • Redesigned the sidebar navigation with enhanced animations, refined visual styling, and improved element alignment for a smoother look.
  • Refactor
    • Reorganized the navigation into clear sections (e.g., Organizations, Projects, Users, Contribute) and streamlined menu options for a cleaner user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

The sidebar navigation in the HTML template has been completely redesigned. The layout and styling have been overhauled with updated CSS classes, transition effects, and fixed dimensions. Internal elements now use a semantic <nav> container and <div> elements instead of list items, ensuring consistent hover and active states. Obsolete links have been removed and the remaining ones are reorganized under clear sections, enhancing readability and control.

Changes

File(s) Change Summary
website/.../sidenav.html Overhauled sidebar layout and styling; replaced list items with divs and introduced a <nav> element; updated CSS classes and transition effects; set explicit dimensions and removed obsolete links.

Assessment against linked issues

Objective Addressed Explanation
Update sidebar navigation layout and styling (#3983)

Suggested reviewers

  • DonnieBLT

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (10)
website/templates/includes/sidenav.html (10)

7-9: Sidebar Container: Responsiveness & Transition Effects
The sidebar container is now set with a fixed width (w-[350px]) and its height is calculated using calc(100vh-4rem), which clearly expresses the intended design. The use of utility classes for the transform and transition (e.g. -translate-x-full, transition-all duration-300 ease-in-out) is well thought out for smooth toggle animations.
However, using a hard-coded width might not be optimal on very small screens. Consider using responsive width utilities (for example, setting a max-width or adjusting the width for smaller breakpoints) to further improve mobile usability.


12-16: Organizations Section Header Styling Conflict
In the header for the Organizations section (line 15), the element has both text-red-500 and text-gray-500 classes. This likely causes a conflict in text color styling. Please verify if the intention was to override one color with the other or if one of them should be removed to avoid visual inconsistency.


114-124: Projects Section: Layout & Header Consistency
The Projects section header and its primary link follow a similar structure as the Organizations section. Note that the header again includes both text-red-500 and text-gray-500, which could lead to a conflicting color result. Confirm whether the intended design is to mix these or if one should be removed. The conditional active-state logic applied to the project link is clear and consistent.


127-163: Projects Submenu Items: Repetition & Maintainability
The submenu under Projects (including links like Repositories, Bid on Issues, Funding, and BACON) consistently applies conditional styling and similar layouts. The repetition of similar utility classes across multiple links suggests that a refactor into a reusable component, template snippet, or macro could help improve maintainability over time.


165-221: Users Section: Structure & Accessibility Considerations
The Users section (header and submenu items like Messaging, Challenges, Leaderboard, Contributors, Takedowns, Badges) is well organized with consistent styling and hover effects. For a future enhancement, consider adding ARIA roles or labels to the navigation links and icons to improve accessibility for screen readers.


223-259: Teams Section: Consistency & Responsive Behavior
The Teams section follows the established pattern with a clear header and submenu items. The styling (including active state indications) is consistent with earlier sections. Similar to previous comments, if the sidebar is to be used on mobile devices, ensure that nested submenus (e.g. “Your Team”, “Challenges”, “Leaderboard”) remain easily navigable.


260-272: About Us Section: Clarity & Icon Semantics
The About Us link is styled similarly to other sections. Consider augmenting the icon markup with ARIA labels or providing visually hidden text to improve accessibility, ensuring that the purpose of the icon is clear to all users.


313-386: Contribute Section: External Links & Structural Clarity
The Contribute section groups several external and internal links (such as Documentation, Developer API, Education, etc.) in a well-structured submenu. External links use appropriate attributes (like target="_blank") for safe browsing. Verify that the URL conditionals remain robust if routes change in the future. Additionally, if this section broadens further, consider grouping similar items together for enhanced clarity.


521-575: Footer Links Section: Navigation & Future Scalability
The “Site Info” footer links (including Sitemap, Roadmap, Status, Stats, etc.) are arranged using the same conditional styling and layout structure. As the list of footer links grows, you might consider grouping or collapsing items into smaller segments to avoid overcrowding, especially on smaller screens.


589-615: Language Selector: Enhancing Accessibility
The language selector form is implemented functionally with a dropdown and proper form submission using Django’s CSRF token. For better accessibility, consider adding a label (or an aria-label) to clearly indicate the purpose of the dropdown for screen readers. This small improvement can help ensure that the interface is accessible to all users.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4394457 and 9d1017d.

📒 Files selected for processing (1)
  • website/templates/includes/sidenav.html (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (python)
  • GitHub Check: docker-test
🔇 Additional comments (6)
website/templates/includes/sidenav.html (6)

17-23: Organizations Link Active State Logic & Consistency
The anchor for the Organizations link uses a conditional to check if the current URL contains “/organizations/” to apply active state styling. This approach is consistent throughout the sidebar and helps highlight the active section. Just ensure that this condition handles edge cases (such as query parameters or deeper URL paths) as intended.


24-32: Organizations Submenu Implementation
The submenu items under Organizations (e.g. Domains, Map, Feed, Hackathons) use consistent utility classes for spacing and hover/active states. The use of conditional classes is well applied here. It might be worthwhile to verify on different screen sizes that the submenu behaves as expected (e.g. proper spacing and overflow handling).


387-438: GitHub Section: External Integration & Security
The GitHub section is neatly arranged, including a prominent external link to the GitHub repository with proper security attributes (noopener noreferrer). The submenu items for additional GitHub-related links maintain consistency in styling. No immediate changes are necessary here.


459-479: Apps Section: External Link Consistency
The Apps section provides links to the iPhone App and the Chrome Extension. The utility classes and hover effects are consistent with other sections. Double-check that external links (and their associated icons) render well on all device sizes.


481-520: Social Links Section: Design & Interaction
The Social Links section, featuring Twitter and Facebook links, applies similar styling to previous sections and includes proper external link attributes. The design appears consistent; just ensure that icon contrast and text truncation behave as intended across various screen resolutions.


576-588: Legal Section: Simple & Consistent
The Terms link under the Legal section follows the established design and is implemented correctly. There are no immediate concerns with this section.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

I think if you have the headers, we don't need the duplicates, so maybe you can have the organization header and under it say "view organizations" and similar for the rest. Also since you have the headers we may not need the indentation anymore and it may look more consistent

@DonnieBLT DonnieBLT dismissed coderabbitai[bot]’s stale review March 18, 2025 16:59

some changes requested

@rinkitadhana
Copy link
Contributor Author

rinkitadhana commented Mar 18, 2025

I added two headers because the second header, like in the Organization section, is a link. I wanted to keep them separate. And in the Image below, earlier these components didn't have headers, so I added an extra red header for better readability.

I think I should remove the red headers for sections that already have a header and keep them for sections that don't, like social links.

image

@DonnieBLT
Copy link
Collaborator

I like the headers with no indentation

@DonnieBLT
Copy link
Collaborator

Would be cool if they all look like that last image

@DonnieBLT DonnieBLT merged commit ceed16a into OWASP-BLT:main Mar 18, 2025
10 checks passed
Comment on lines -127 to -174
class="flex items-center w-full no-underline p-2 {% if request.path == '/trademarks/' %}text-black{% else %}hover:text-[#e74c3c] text-black{% endif %}">
<div class="w-6 mr-4 text-[#e74c3c]">
<i class="fas fa-registered fa-lg"></i>
</div>
<span>Trademarks</span>
</a>
</li>
<li class="mb-2 {% if request.path == '/similarity-scan/' %}bg-gray-200{% endif %}">
<a href="{% url 'similarity_scan' %}"
class="flex items-center w-full no-underline p-2 {% if request.path == '/similarity-scan/' %}text-black{% else %}hover:text-[#e74c3c] text-black{% endif %}">
<div class="w-6 mr-4 text-[#e74c3c]">
<i class="fas fa-clone fa-lg"></i>
</div>
<span>SimilarityScan</span>
</a>
</li>
<li class="mb-2 {% if request.path == '/discussion-rooms/' %}bg-gray-200{% endif %}">
<a href="{% url 'rooms_list' %}"
class="flex items-center w-full no-underline p-2 {% if request.path == '/discussion-rooms/' %}text-black{% else %}hover:text-[#e74c3c] text-black{% endif %}">
<div class="w-6 mr-4 text-[#e74c3c]">
<i class="fas fa-door-open fa-lg"></i>
</div>
<span>Rooms</span>
</a>
</li>
<li class="mb-2">
<a href="{% url 'video_call' %}"
class="flex items-center w-full no-underline p-2 {% if request.path == '/video-call/' %}text-black{% else %}hover:text-[#e74c3c] text-black{% endif %}">
<div class="w-6 mr-4 text-[#e74c3c]">
<i class="fas fa-video fa-lg"></i>
</div>
<span>Video Call</span>
</a>
</li>
<li class="mb-2 {% if request.path == '/banned-apps/' %}bg-gray-200{% endif %}">
<a href="{% url 'banned_apps' %}"
class="flex items-center w-full no-underline p-2 {% if request.path == '/banned-apps/' %}text-black{% else %}hover:text-[#e74c3c] text-black{% endif %}">
<div class="w-6 mr-4 text-[#e74c3c]">
<i class="fas fa-ban fa-lg"></i>
</div>
<span>Banned Apps</span>
</a>
</li>
</ul>
<!-- Spacer -->
<div class="my-4 border-t border-gray-300"></div>
<!-- Projects Header Link -->
<li class="mb-2 {% if request.path == '/projects/' %}bg-gray-200{% endif %}">
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rinkitadhana can you add these back please, I missed this during review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I think the links got removed accidentally. I will add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I remember, I was making a separate section for these links because they were not related to the organization, and I forgot to add them back.

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.

Current side navbar

2 participants