Skip to content

feat(navbar-vertical): improve animations#1415

Draft
dauriamarco wants to merge 2 commits intomainfrom
feat/navbar-animations
Draft

feat(navbar-vertical): improve animations#1415
dauriamarco wants to merge 2 commits intomainfrom
feat/navbar-animations

Conversation

@dauriamarco
Copy link
Member

Improves initial animations and adds new badges transitions in the vertical navbar.


@dauriamarco dauriamarco added this to the 49.x milestone Feb 2, 2026
@dauriamarco dauriamarco self-assigned this Feb 2, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dauriamarco, 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 significantly refines the NavbarVertical component by enhancing its animation capabilities and introducing a new hideBadgeWhenCollapsed property. These changes provide developers with greater flexibility in managing badge visibility and ensure a more polished and responsive user interface, particularly during navbar collapse and expansion.

Highlights

  • New hideBadgeWhenCollapsed Property: Introduced a new property hideBadgeWhenCollapsed to the NavbarVerticalItemBase interface, allowing badges to be conditionally hidden when the vertical navbar is in a collapsed state.
  • Improved Navbar Animations: Enhanced the initial load animations and added new transition effects for badges within the vertical navbar, resulting in a smoother and more polished user experience.
  • Dedicated Badge Testing: Added a new suite of Playwright E2E tests specifically for vertical navbar badges, covering their behavior and appearance in both expanded and collapsed states.
  • Refactored Badge Rendering Logic: The HTML and SCSS for si-navbar-vertical-item were updated to support the new badge visibility logic and animation, including the introduction of new CSS classes like badge-text-only and badge-collapsed.
  • New Badge Example: A new example (si-navbar-vertical-badges) was created to showcase various badge configurations and their behavior, including the hideBadgeWhenCollapsed feature.
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.

Copy link
Contributor

@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 improves animations and adds new badge transition features to the vertical navbar. The changes include updates to the component logic, templates, and styles to support these new features, along with new examples and updated tests. The code is well-structured, and the new features are covered by tests. I found one issue in a test case for the new hideBadgeWhenCollapsed feature, where the test logic does not match its description. My review includes a suggestion to fix this. Overall, this is a good improvement to the navbar component.

Comment on lines +314 to +334
it('should not affect emphasis badges', () => {
const emphasisColors = ['primary-emphasis', 'danger-emphasis', 'warning-emphasis'];

emphasisColors.forEach(badgeColor => {
badgeTestComponent.item.set({
type: 'link',
label: 'Test',
href: '#',
badge: 5,
badgeColor
});
badgeTestFixture.detectChanges();

const linkElement = badgeTestFixture.nativeElement.querySelector('a.navbar-vertical-item');
expect(linkElement.classList.contains('hide-badge-collapsed')).toBe(false);

const badgeElement = badgeTestFixture.nativeElement.querySelector('.badge');
expect(badgeElement).toBeTruthy();
expect(badgeElement.classList.contains(`bg-${badgeColor}`)).toBe(true);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This test case appears to be flawed. The title should not affect emphasis badges suggests it's testing that hideBadgeWhenCollapsed does not apply to emphasis badges. However, the test implementation never sets hideBadgeWhenCollapsed: true on the test item. As a result, it only asserts that the hide-badge-collapsed class is not present when the property is falsy, which is expected but doesn't test the intended interaction with emphasis badges.

To properly test this, hideBadgeWhenCollapsed: true should be set. If the intended behavior is that emphasis badges are not hidden, the component's hideBadgeCollapsed logic should be updated to exclude them, and this test should verify that behavior.

    it('should not add hide-badge-collapsed class for emphasis badges when hideBadgeWhenCollapsed is true', () => {
      const emphasisColors = ['primary-emphasis', 'danger-emphasis', 'warning-emphasis'];

      emphasisColors.forEach(badgeColor => {
        badgeTestComponent.item.set({
          type: 'link',
          label: 'Test',
          href: '#',
          badge: 5,
          badgeColor,
          hideBadgeWhenCollapsed: true
        });
        badgeTestFixture.detectChanges();

        const linkElement = badgeTestFixture.nativeElement.querySelector('a.navbar-vertical-item');
        // This assertion assumes that emphasis badges are never hidden.
        // This would require updating the `hideBadgeCollapsed` computed property in the component
        // to not add the class for emphasis badges.
        expect(linkElement.classList.contains('hide-badge-collapsed')).toBe(false);

        const badgeElement = badgeTestFixture.nativeElement.querySelector('.badge');
        expect(badgeElement).toBeTruthy();
        expect(badgeElement.classList.contains(`bg-${badgeColor}`)).toBe(true);
      });
    });

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Code Coverage

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

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