Skip to content

[WEB-3422] fix: app sidebar fixes and improvements#6633

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
chore-app-sidebar-improvements
Feb 18, 2025
Merged

[WEB-3422] fix: app sidebar fixes and improvements#6633
sriramveeraghanta merged 2 commits intopreviewfrom
chore-app-sidebar-improvements

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Feb 18, 2025

Description

This PR includes app sidebar fixes and improvements.

Type of Change

  • Bug fix
  • Improvement

References

[WEB-3422]

Summary by CodeRabbit

  • New Features

    • Introduced a new workspace preference option and updated navigation with dynamic "Your Work" and static "Inbox" items.
    • Added a project URL copy functionality with on-screen confirmation.
  • Style

    • Refined sidebar layout with enhanced spacing and conditional horizontal dividers.
    • Improved drag-and-drop visual cues by updating drag handle visibility and icon hover effects.
    • Updated the OverviewIcon for a new visual representation.
    • Removed the extended sidebar toggle button for a streamlined interface.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2025

Walkthrough

This pull request introduces a new enumeration value in the backend workspace preferences and reorganizes several workspace sidebar elements on the frontend. The changes move the "your-work" navigation item from static to dynamic, replace "notifications" with "inbox", and update icon mappings. Additional UI modifications include adding a copy URL function for projects, adjusting padding, and refining conditional rendering of sidebar elements. These changes affect both backend models and multiple frontend components, altering control flows and visual components.

Changes

File(s) Change Summary
apiserver/…/workspace.py Added new enum value YOUR_WORK = "your_work", "Your Work" in WorkspaceUserPreference.
packages/constants/src/workspace.ts,
web/ce/components/workspace/sidebar/helper.tsx,
web/ce/components/workspace/sidebar/sidebar-item.tsx
Reorganized navigation items: moved "your-work" to dynamic items, removed it from static, replaced "notifications" with "inbox", and updated corresponding icon mappings and static items array.
web/app/[workspaceSlug]/…/extended-project-sidebar.tsx,
web/app/[workspaceSlug]/…/extended-sidebar.tsx,
web/app/[workspaceSlug]/…/sidebar.tsx,
web/ce/components/workspace/sidebar/extended-sidebar-item.tsx,
web/core/components/workspace/sidebar/favorites/favorites-menu.tsx,
web/core/components/workspace/sidebar/projects-list-item.tsx,
web/core/components/workspace/sidebar/sidebar-menu-items.tsx
Enhanced sidebar UI functionality: added a copy URL feature for projects; adjusted padding and conditional rendering of elements (e.g., <hr>); modified drag handle visibility; and removed the extended sidebar toggle control.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant S as ExtendedProjectSidebar
    participant C as copyUrlToClipboard
    participant T as ToastNotifier

    U->>S: Click "Copy URL" button
    S->>C: Call copyUrlToClipboard(projectId)
    C-->>S: Return success
    S->>T: Display success toast notification
Loading

Possibly related PRs

Suggested labels

🐛bug, 🌐frontend, 🌟improvement

Suggested reviewers

  • sriramveeraghanta

Poem

I'm a rabbit with code so fleet,
Hopping through changes with nimble feet.
"Your Work" now sings a brand-new tune,
In sidebars where ideas bloom soon.
With a copy click and visual cheer,
This pull request brings joy near! 🐰✨


📜 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 ffdeeb0 and 3f7f026.

📒 Files selected for processing (1)
  • packages/ui/src/icons/overview-icon.tsx (1 hunks)
🔇 Additional comments (2)
packages/ui/src/icons/overview-icon.tsx (2)

6-6: LGTM! SVG implementation follows best practices.

The SVG attributes are well-structured with proper use of fill="none" and className inheritance for color control.


6-12:

Details

❓ Verification inconclusive

Verify visual consistency with other sidebar icons.

The viewBox has been changed to 12x12. Please ensure this maintains visual consistency with other sidebar icons.

Let's check other icon components in the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Check viewBox dimensions of other icon components to ensure consistency

# Search for viewBox attributes in SVG components
rg 'viewBox="[^"]+"' --type tsx --glob 'packages/ui/src/icons/*.tsx'

Length of output: 98


Verify the 12x12 viewBox across sidebar icons manually

The updated icon now uses a 12x12 viewBox, but our initial automated check couldn’t retrieve data from the other icons due to a file type recognition issue. Please re-run the verification using a revised command (or inspect manually) to confirm that all sidebar icons consistently use a 12x12 viewBox. For example, try running:

#!/bin/bash
# Revised check for viewBox attributes in SVG components
rg 'viewBox="[^"]+"' packages/ui/src/icons/

If discrepancies are found, adjust the icons to ensure visual consistency.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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. (Beta)
  • @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.

Copy link
Contributor

@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: 2

🧹 Nitpick comments (2)
web/app/[workspaceSlug]/(projects)/sidebar.tsx (1)

93-95: LGTM! Consider extracting the repeated HR styles.

The conditional rendering of the horizontal rule in collapsed state improves visual clarity. However, the same HR styles are used in multiple places.

Consider extracting the repeated HR styles to a reusable constant or component:

+const SIDEBAR_HR_CLASSES = "flex-shrink-0 border-custom-sidebar-border-300 h-[0.5px] w-3/5 mx-auto my-1";

 {sidebarCollapsed && (
-  <hr className="flex-shrink-0 border-custom-sidebar-border-300 h-[0.5px] w-3/5 mx-auto my-1" />
+  <hr className={SIDEBAR_HR_CLASSES} />
 )}
web/ce/components/workspace/sidebar/sidebar-item.tsx (1)

45-45: Consider enhancing type safety for static items.

The static items array would benefit from type safety and could be moved to constants.

Consider this improvement:

-const staticItems = ["home", "inbox", "pi-chat", "projects"];
+const STATIC_SIDEBAR_ITEMS = ["home", "inbox", "pi-chat", "projects"] as const;
+type TStaticSidebarItem = typeof STATIC_SIDEBAR_ITEMS[number];
+
+// Move this to constants file and use:
+const staticItems: readonly TStaticSidebarItem[] = STATIC_SIDEBAR_ITEMS;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1478e66 and ffdeeb0.

📒 Files selected for processing (11)
  • apiserver/plane/db/models/workspace.py (1 hunks)
  • packages/constants/src/workspace.ts (4 hunks)
  • web/app/[workspaceSlug]/(projects)/extended-project-sidebar.tsx (3 hunks)
  • web/app/[workspaceSlug]/(projects)/extended-sidebar.tsx (1 hunks)
  • web/app/[workspaceSlug]/(projects)/sidebar.tsx (1 hunks)
  • web/ce/components/workspace/sidebar/extended-sidebar-item.tsx (2 hunks)
  • web/ce/components/workspace/sidebar/helper.tsx (1 hunks)
  • web/ce/components/workspace/sidebar/sidebar-item.tsx (1 hunks)
  • web/core/components/workspace/sidebar/favorites/favorites-menu.tsx (1 hunks)
  • web/core/components/workspace/sidebar/projects-list-item.tsx (1 hunks)
  • web/core/components/workspace/sidebar/sidebar-menu-items.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • web/app/[workspaceSlug]/(projects)/extended-sidebar.tsx
  • web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
🔇 Additional comments (6)
web/ce/components/workspace/sidebar/helper.tsx (1)

9-10: LGTM! Clean implementation of the inbox icon mapping.

The replacement of notifications with inbox is implemented correctly and maintains consistency with the sidebar reorganization.

web/ce/components/workspace/sidebar/extended-sidebar-item.tsx (2)

172-172: Improved drag handle discoverability.

The drag handle is now always visible instead of being hidden by default, making the drag functionality more discoverable for users.


202-203: Enhanced icon styling consistency.

The Eye and EyeClosed icons now have consistent size classes and improved hover states, enhancing visual feedback and accessibility.

Also applies to: 209-210

packages/constants/src/workspace.ts (1)

262-267: Improved sidebar navigation organization.

The navigation structure has been enhanced by:

  1. Moving "your-work" to dynamic navigation items, making it more flexible
  2. Renaming "notifications" to "inbox", which is a more intuitive term

Also applies to: 296-296, 308-313

apiserver/plane/db/models/workspace.py (1)

399-399: Added user preference support for "Your Work".

The addition of the YOUR_WORK enum value enables user preference persistence for the "Your Work" navigation item, aligning with the frontend changes.

web/core/components/workspace/sidebar/projects-list-item.tsx (1)

241-241: Enhanced drag handle visibility in extended sidebar.

The drag handle is now visible when the sidebar is in extended mode, improving consistency and usability of drag-and-drop functionality.

@sriramveeraghanta sriramveeraghanta merged commit 23b0d43 into preview Feb 18, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-app-sidebar-improvements branch February 18, 2025 15:19
@coderabbitai coderabbitai bot mentioned this pull request Feb 19, 2025
1 task
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: app sidebar improvements

* chore: overview icon updated
@anmolsinghbhatia anmolsinghbhatia restored the chore-app-sidebar-improvements branch August 26, 2025 12:25
@sriramveeraghanta sriramveeraghanta deleted the chore-app-sidebar-improvements branch September 4, 2025 12:51
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.

3 participants