Skip to content

[WEB-4597]fix: project icon render in switcher#7504

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix-switcher_dropdown
Jul 30, 2025
Merged

[WEB-4597]fix: project icon render in switcher#7504
sriramveeraghanta merged 1 commit intopreviewfrom
fix-switcher_dropdown

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Jul 29, 2025

Description

This update fixes the issue where project switcher option is not rendering project icons.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • New Features
    • Added support for selecting between "lucide" and "material" icon styles in switcher components, allowing for more flexible icon appearance in the interface.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

The changes introduce a new optional type prop to the SwitcherIcon and SwitcherLabel components, allowing selection between "lucide" and "material" icon styles. The project.tsx file is updated to pass this new prop when using SwitcherLabel within switcher options for breadcrumbs.

Changes

Cohort / File(s) Change Summary
Switcher Icon and Label Components
apps/web/core/components/common/switcher-label.tsx
Added optional type prop ("lucide" or "material") to SwitcherIcon and SwitcherLabel. Prop is forwarded to logo rendering.
Breadcrumbs Project Switcher
apps/web/ce/components/breadcrumbs/project.tsx
Updated usage of SwitcherLabel to pass type="material" in the switcher options JSX content.

Sequence Diagram(s)

sequenceDiagram
    participant ParentComponent
    participant SwitcherLabel
    participant SwitcherIcon
    participant Logo

    ParentComponent->>SwitcherLabel: Render with type="material"
    SwitcherLabel->>SwitcherIcon: Pass type="material"
    SwitcherIcon->>Logo: Render icon with type="material"
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

ready_to_merge

Suggested reviewers

  • prateekshourya29
  • sriramveeraghanta

Poem

A switch of style, a flick of type,
Lucide or material, both look right!
Breadcrumbs now with icons new,
Labels shining, fresh and true.
With every hop, the rabbit grins—
For code that sparkles always wins! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 e0b0aaf and 365398b.

📒 Files selected for processing (2)
  • apps/web/ce/components/breadcrumbs/project.tsx (1 hunks)
  • apps/web/core/components/common/switcher-label.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: prateekshourya29
PR: makeplane/plane#7188
File: web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/header.tsx:40-45
Timestamp: 2025-06-18T09:46:08.566Z
Learning: When reviewing breadcrumb components that accept projectId or similar props, check if empty strings are being passed during loading states, which can result in invalid URLs. The preferred approach is to handle these loading states internally within the component rather than requiring each consumer to manage the loading logic.
apps/web/ce/components/breadcrumbs/project.tsx (2)

Learnt from: prateekshourya29
PR: #7188
File: web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/header.tsx:40-45
Timestamp: 2025-06-18T09:46:08.566Z
Learning: When reviewing breadcrumb components that accept projectId or similar props, check if empty strings are being passed during loading states, which can result in invalid URLs. The preferred approach is to handle these loading states internally within the component rather than requiring each consumer to manage the loading logic.

Learnt from: prateekshourya29
PR: #7363
File: apps/web/core/components/issues/select/dropdown.tsx:9-11
Timestamp: 2025-07-08T13:41:01.659Z
Learning: The getProjectLabelIds function in the label store handles undefined projectId internally, so it's safe to pass undefined values to it without explicit checks in the calling component.

🧬 Code Graph Analysis (1)
apps/web/ce/components/breadcrumbs/project.tsx (1)
apps/web/core/components/common/switcher-label.tsx (1)
  • SwitcherLabel (46-54)
🔇 Additional comments (3)
apps/web/core/components/common/switcher-label.tsx (2)

11-11: LGTM! Well-implemented type prop addition.

The new optional type prop is properly typed, defaults to "lucide" for backward compatibility, and is correctly passed to the Logo component. This enhancement enables dynamic icon style selection without breaking existing usage.

Also applies to: 19-19, 22-22


43-43: LGTM! Consistent implementation of type prop forwarding.

The SwitcherLabel component correctly accepts and forwards the type prop to SwitcherIcon, maintaining consistency with the same default value and type definition. The implementation follows the established pattern.

Also applies to: 47-47, 50-50

apps/web/ce/components/breadcrumbs/project.tsx (1)

40-42: LGTM! Proper usage of the new type prop.

The addition of type="material" to SwitcherLabel correctly utilizes the new prop to render material-style icons in the project switcher. The JSX formatting with parentheses for the multiline component is appropriate and follows React conventions.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-switcher_dropdown

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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.

@vamsikrishnamathala vamsikrishnamathala changed the title fix: project icon render in switcher [WEB-4597]fix: project icon render in switcher Jul 29, 2025
@vamsikrishnamathala vamsikrishnamathala self-assigned this Jul 29, 2025
@makeplane
Copy link

makeplane bot commented Jul 29, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@vamsikrishnamathala vamsikrishnamathala added the 🐛bug Something isn't working label Jul 29, 2025
@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review July 29, 2025 14:01
@sriramveeraghanta sriramveeraghanta merged commit 876ccce into preview Jul 30, 2025
7 of 9 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-switcher_dropdown branch July 30, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants