Skip to content

Conversation

@astandrik
Copy link
Collaborator

@astandrik astandrik commented Oct 21, 2025

Closes #2990
Stand

Greptile Overview

Updated On: 2025-10-21 15:20:20 UTC

Summary

This PR adds an extensibility point to the AsideNavigation component, allowing consumers to customize footer items through an optional renderFooterItems prop.

Key Changes:

  • Added renderFooterItems prop to interface that accepts default footer items and context (compact state and asideRef)
  • Refactored footer rendering to build defaultFooterItems array with proper React keys for information, user-settings, and user-dropdown
  • Renamed compact parameter to footerCompact within the renderFooter callback for improved clarity
  • Wrapped the footer rendering logic in a conditional that uses custom items if provided, otherwise falls back to defaults

Architecture:
This follows the established Component Registry Pattern and Slots Pattern documented in the codebase. The implementation allows external components (registered via ComponentsProvider) to override AsideNavigation and provide custom footer items while retaining access to the default items for composition.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple, well-implemented extensibility feature that follows established patterns in the codebase. The prop is optional (backward compatible), properly typed, and the refactoring adds React keys that were previously missing. No breaking changes or risky logic introduced.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/containers/AsideNavigation/AsideNavigation.tsx 5/5 Added optional renderFooterItems prop to enable customization of navigation footer items; refactored footer rendering with proper React keys

Sequence Diagram

sequenceDiagram
    participant Consumer as Custom Component
    participant AsideNav as AsideNavigation
    participant AsideHeader as @gravity-ui AsideHeader
    participant Footer as Footer Items

    Consumer->>AsideNav: Render with renderFooterItems prop
    AsideNav->>AsideHeader: Pass renderFooter callback
    AsideHeader->>AsideNav: Call renderFooter({compact, asideRef})
    AsideNav->>AsideNav: Create defaultFooterItems array
    Note over AsideNav: FooterItem(information)<br/>FooterItem(user-settings)<br/>UserDropdown
    alt renderFooterItems provided
        AsideNav->>Consumer: Call renderFooterItems(defaultFooterItems, ctx)
        Consumer->>AsideNav: Return customized footer items
        AsideNav->>Footer: Render custom footer
    else renderFooterItems not provided
        AsideNav->>Footer: Render defaultFooterItems
    end
Loading

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 375 0 1 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 45.86 MB | Main: 45.86 MB
Diff: +1.25 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@astandrik
Copy link
Collaborator Author

greptile-review

@astandrik astandrik requested a review from Copilot October 21, 2025 15:09

This comment was marked as resolved.

@astandrik
Copy link
Collaborator Author

greptile-review

@astandrik astandrik requested a review from Copilot October 21, 2025 15:15
Copy link
Contributor

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

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@astandrik astandrik added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit 1cff57d Oct 22, 2025
8 checks passed
@astandrik astandrik deleted the astandrik.2990 branch October 22, 2025 07:58
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.

feat: render additional footer items in navigation

2 participants