Skip to content

Conversation

@gocanto
Copy link
Contributor

@gocanto gocanto commented Oct 17, 2025

Summary

  • update the SideNavPartial tests to expect the avatar to be hidden on the home page
  • verify the navigation gains the extra top margin only when the avatar is hidden

Testing

  • make format
  • npm test -- --runInBand (fails: vitest: not found)

https://chatgpt.com/codex/tasks/task_e_68f1c5910ed08333aef061d929430439

Summary by CodeRabbit

  • Bug Fixes
    • Avatar no longer displays on the home page.
    • Navigation layout and spacing now properly adjust based on the current page, with optimized padding for different sections of the app to ensure consistent visual presentation.

@gocanto gocanto marked this pull request as draft October 17, 2025 05:27
@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the display logic of the SideNavPartial component by introducing a condition to hide the user avatar specifically on the home page. Concurrently, it adjusts the top spacing of the navigation menu to compensate for the hidden avatar, maintaining a consistent visual layout. The changes are thoroughly validated with updated and new unit tests.

Highlights

  • Conditional Avatar Display: The sidebar avatar is now conditionally rendered, appearing on all pages except the home page, where it will be hidden.
  • Dynamic Navigation Margin: The navigation element's top margin (mt-2) is dynamically applied only when the sidebar avatar is hidden (i.e., on the home page), ensuring proper spacing and visual consistency.
  • Test Updates: Existing tests for SideNavPartial have been updated to reflect the new behavior of the avatar being hidden on the home page, and a new test was added to verify the conditional application of the top margin.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This PR introduces route-aware sidebar navigation styling. The avatar is conditionally hidden on the home route, and nav padding classes are computed based on the current route. A route name is added to the router configuration to support these route checks.

Changes

Cohort / File(s) Summary
Router configuration
src/router.ts
Added name: 'home' to the root route to enable route-name-based conditionals.
Sidebar avatar and nav layout
src/partials/SideNavPartial.vue
Introduced showSidebarAvatar computed property (hides on home route). Replaced static navPaddingTopClass with navLayoutClasses computed property that applies dynamic padding based on route (home: pt-16 mt-2; post/content routes: pt-12 md:pt-16; others: pt-16).
Component tests
tests/partials/SideNavPartial.test.ts
Updated avatar visibility test on home route (now hidden). Added test asserting no extra top margin on /about route.

Sequence Diagram(s)

sequenceDiagram
    participant Router
    participant SideNav as SideNavPartial
    participant Avatar as AvatarPartial

    Router->>SideNav: currentRoute updates
    activate SideNav
    SideNav->>SideNav: compute showSidebarAvatar<br/>(name !== 'home' ?)
    SideNav->>SideNav: compute navLayoutClasses<br/>(route-specific padding)
    
    alt On Home Route
        SideNav->>Avatar: hidden ✗
        SideNav->>SideNav: apply pt-16 mt-2
    else On Post/Content Routes
        SideNav->>Avatar: shown ✓
        SideNav->>SideNav: apply pt-12 md:pt-16
    else On Other Routes
        SideNav->>Avatar: shown ✓
        SideNav->>SideNav: apply pt-16
    end
    deactivate SideNav
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes are straightforward: a router name addition, two computed properties in the Vue component with clear conditional logic, and corresponding test updates. The modifications are localized, consistent, and follow established patterns.

Possibly related PRs

Poem

A rabbit hops through routes with grace, 🐰
Hiding avatars on the home place,
With padding computed by each path's name,
The sidebar dances—never the same!
Home stays bare, content routes shine bright,
Navigation adjusts to each route's might. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix: Update SideNavPartial tests for hidden home avatar" is clearly related to and partially summarizes the changeset. It accurately describes the test updates (which check that the avatar is hidden on the home route) and references the feature being implemented (hidden avatar on home). While the changeset also includes implementation changes to SideNavPartial.vue and a router configuration update, the title captures a real and important aspect of the change—the test verification of the hidden avatar behavior. The title is specific, clear, and conveys meaningful information about what is being changed.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gus/hide-sidebar-avatar-on-home-page-2025-10-17

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8b2f48 and 3813204.

📒 Files selected for processing (3)
  • src/partials/SideNavPartial.vue (2 hunks)
  • src/router.ts (1 hunks)
  • tests/partials/SideNavPartial.test.ts (2 hunks)
🔇 Additional comments (8)
src/router.ts (1)

25-25: LGTM! Route name addition addresses past feedback.

Adding an explicit name: 'home' to the root route enables more maintainable route checking in components (e.g., currentRoute.name === 'home' instead of hardcoded path checks). This directly addresses the past review comment suggesting the use of route names over path strings.

tests/partials/SideNavPartial.test.ts (3)

88-94: LGTM! Test correctly verifies avatar hidden on home route.

The test expectations are correctly updated to reflect the new behavior where the avatar is hidden on the home route. This aligns with the implementation of showSidebarAvatar in SideNavPartial.vue.


138-149: LGTM! Correctly verifies home route layout classes.

The test correctly verifies that the home route applies:

  • pt-16 (base padding)
  • mt-2 (additional top margin when avatar is hidden)
  • No responsive padding classes (pt-12, md:pt-16)

This matches the implementation in navLayoutClasses for the home route.


151-159: LGTM! New test verifies correct layout when avatar is visible.

This test ensures that the additional top margin (mt-2) is NOT applied on routes where the avatar is visible (e.g., /about). This correctly validates that the margin adjustment is exclusive to the home route where the avatar is hidden.

src/partials/SideNavPartial.vue (4)

5-5: LGTM! Avatar visibility now route-aware.

The avatar is correctly hidden on the home route via the showSidebarAvatar computed property, which uses the route name for robust identification.


13-13: LGTM! Consolidated layout classes improve maintainability.

Binding navLayoutClasses centralizes all dynamic layout logic (both padding and margin) in one computed property. This directly addresses the past review comment about consolidating fragmented layout logic.


116-116: LGTM! Route name check addresses past feedback.

Using currentRoute.name !== 'home' instead of checking the path string makes the component more resilient to future routing changes. This directly addresses the past review comment about using route names over raw path strings.


121-134: LGTM! Consolidated layout logic is clean and correct.

The navLayoutClasses computed property successfully consolidates all layout concerns:

  • Home route: pt-16 mt-2 (extra margin compensates for hidden avatar)
  • Content-aligned routes: pt-12 md:pt-16 (responsive padding aligns with main content)
  • Other routes: pt-16 (default padding)

The logic is clear, handles all cases correctly, and gracefully handles routes without explicit names.


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.

@gocanto gocanto changed the title Update SideNavPartial tests for hidden home avatar fix: Update SideNavPartial tests for hidden home avatar Oct 17, 2025
@gocanto gocanto added testing and removed codex labels Oct 17, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the SideNavPartial component to hide the avatar on the home page and adjusts the navigation margin accordingly. The changes are logical and the accompanying tests correctly verify the new behavior. I have two main points of feedback, both aimed at improving the long-term maintainability and robustness of the code. First, I recommend using route names instead of hardcoded paths to identify routes, which makes the logic more resilient to routing changes. Second, I suggest consolidating the navigation element's layout logic, which is currently fragmented between the template and the script, into a single computed property to improve clarity and reduce the risk of future bugs. Please see the detailed comments for specific suggestions.

@gocanto gocanto marked this pull request as ready for review October 17, 2025 05:44
@gocanto gocanto merged commit e29a7d2 into main Oct 17, 2025
5 checks passed
@gocanto gocanto deleted the gus/hide-sidebar-avatar-on-home-page-2025-10-17 branch October 17, 2025 05:53
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.

2 participants