Skip to content

Conversation

@tsl-ps2
Copy link
Collaborator

@tsl-ps2 tsl-ps2 commented Apr 1, 2025

Currently, clicking on an item with children in the sidebar navigation (NavVertical) only expands/collapses the children. However, when the sidebar is minimized (NavMini), the children appear on hovering, but clicking on the item navigates to the corresponding page (which might not exist). This PR unifies this behavior, by no longer hyperlinking items in NavMini if they have children.

I also added the lineHeight: 1 as explained here: https://www.loom.com/share/5fa6bbbfde92484782a4986f7281a44f?sid=a3aae763-aa5a-428d-beb7-59ea63fe80ff I'm not exactly sure what is happening there, looks like the 24x24 svg image is rendered one or two pixels lower than its bounding span of height 24 when the lineHeight of the span is 1.5 (maybe the lineHeight is not distributed equally above and below!?)

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced navigation experience: Navigation items with sub-menus now avoid unnecessary visual distractions and offer a streamlined interaction for a smoother, more intuitive user journey.
    • Added a new prop to disable ripple effects for navigation items with child elements, improving user interaction.
  • Bug Fixes

    • Fixed vertical alignment of navigation elements for a more consistent appearance in the user interface.
  • Style

    • Consistent styling for icons in navigation items, ensuring uniform appearance regardless of item type.

@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

⚠️ No Changeset found

Latest commit: b41bf17

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

The changes introduce a new prop disableRipple to the StyledNavItem component, allowing it to disable ripple effects when child elements are present. Additionally, a conditional statement is added to return the content directly if hasChild is true, bypassing the Link component. In a separate file, the sx prop is added to Box components in the NavItem, ensuring consistent styling for icons regardless of whether they are sub-items. A new version is also recorded in the CHANGELOG and package.json files.

Changes

File Change Summary
packages/components/modules/navigations/web/NavMini/NavSectionMini/NavList/NavItem/index.tsx Added disableRipple prop to StyledNavItem and modified rendering logic based on hasChild.
packages/components/modules/navigations/web/__shared__/NavSectionVertical/Group/NavList/NavItem/index.tsx Added sx prop with { lineHeight: 1 } to Box components for consistent icon styling.
packages/components/CHANGELOG.md Added version 1.0.32, detailing patch changes for navigation elements and vertical alignment fixes.
packages/components/package.json Updated package version from "1.0.31" to "1.0.32".

Possibly related PRs

  • BA-2345-change-link-navigation-from-navbar #227: The changes in the main PR are related to the same NavItem component as the retrieved PR, specifically modifying the rendering logic of the Link component based on the presence of child elements.

Suggested labels

needs review

Suggested reviewers

  • deboracosilveira
  • priscilladeroode
  • anicioalexandre

🐇 In the meadow, changes bloom,
A ripple's dance, now finds its room.
Icons styled with care and grace,
In NavItems, a new embrace.
With children near, the links take flight,
Hopping forth, all feels just right! 🌼

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/components/modules/navigations/web/NavMini/NavSectionMini/NavList/NavItem/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
packages/components/modules/navigations/web/__shared__/NavSectionVertical/Group/NavList/NavItem/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@tsl-ps2 tsl-ps2 force-pushed the FEN-192-remove-link-when-collapsed branch from 611dc83 to b41bf17 Compare April 7, 2025 17:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 7, 2025

Copy link

@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 (1)
packages/components/CHANGELOG.md (1)

3-8: Clarify and Enrich the Changelog Entry

The new changelog entry for version 1.0.32 clearly states that it disables links for navigation elements with children and fixes a vertical alignment issue. To improve clarity and traceability, consider referencing the PR ticket (FEN-192) and elaborating that the vertical alignment fix was achieved through setting the lineHeight to 1. This extra context can help future maintainers and users understand the change at a glance.

For example, you might update the entry as follows:

- - Disables link for navigation elements with children and fixes vertical alignment
+ - [FEN-192] Disables hyperlink functionality on navigation items with children and fixes vertical alignment (by setting lineHeight to 1)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 611dc83 and b41bf17.

📒 Files selected for processing (4)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/modules/navigations/web/NavMini/NavSectionMini/NavList/NavItem/index.tsx (2 hunks)
  • packages/components/modules/navigations/web/__shared__/NavSectionVertical/Group/NavList/NavItem/index.tsx (1 hunks)
  • packages/components/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/components/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/modules/navigations/web/shared/NavSectionVertical/Group/NavList/NavItem/index.tsx
  • packages/components/modules/navigations/web/NavMini/NavSectionMini/NavList/NavItem/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Component Test Packages

@tsl-ps2 tsl-ps2 merged commit bb8a540 into master Apr 7, 2025
7 of 8 checks passed
@nossila nossila deleted the FEN-192-remove-link-when-collapsed branch May 26, 2025 21:14
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.

4 participants