Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-3203] fix: dashboard widgets' empty state content and assets #6450

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

aaryan610
Copy link
Collaborator

@aaryan610 aaryan610 commented Jan 23, 2025

Description

This PR updates-

  1. The UX copy and assets of dashboard widgets.
  2. To-dos' checkbox border color and hover state.

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced empty state descriptions for stickies and home widgets
    • Improved interaction feedback with updated checkbox styling
  • Bug Fixes

    • Improved handling of empty states in various components
    • Refined link and widget rendering logic
  • Style

    • Updated text labels from "Quick links" to "Quicklinks"
    • Refined CSS styling for checkboxes and component layouts
    • Adjusted icon and text styling in multiple components
  • Refactor

    • Renamed several components for clarity
    • Simplified rendering logic in home dashboard widgets
    • Enhanced type safety in workspace services

Copy link
Contributor

coderabbitai bot commented Jan 23, 2025

Walkthrough

This pull request encompasses a series of UI and styling modifications across multiple components in the web application. The changes primarily focus on refining the visual design, renaming components, updating text content, and improving the overall user interface consistency. Key areas of modification include checkbox styling in the .ProseMirror component, renaming of the Toolbar component to StickyEditorToolbar, updates to various empty state components, and adjustments to the home dashboard widgets.

Changes

File Change Summary
packages/editor/src/styles/editor.css Updated checkbox styling with new border and hover colors
web/core/components/editor/sticky-editor/editor.tsx Replaced Toolbar with StickyEditorToolbar
web/core/components/editor/sticky-editor/toolbar.tsx Renamed Toolbar to StickyEditorToolbar, added type="button" to buttons
web/core/components/home/home-dashboard-widgets.tsx Updated quick_links title from "Quick links" to "Quicklinks"
web/core/components/home/widgets/empty-states/index.ts Removed export from ./root, added exports from ./links, ./no-projects, ./recents, and ./stickies
web/core/components/home/widgets/empty-states/links.tsx Restructured JSX layout, updated text and styling
web/core/components/home/widgets/empty-states/no-projects.tsx Renamed EmptyWorkspace to NoProjectsEmptyState, updated titles and descriptions
web/core/components/home/widgets/empty-states/recents.tsx Added getDisplayContent function for display logic
web/core/components/home/widgets/empty-states/stickies.tsx Overhauled JSX structure and styling
web/core/components/home/widgets/links/action.tsx Updated button text from "Add quick Link" to "Add quicklink"
web/core/components/home/widgets/links/create-update-link-modal.tsx Changed "quick link" to "quicklink" in header and button label
web/core/components/home/widgets/links/link-detail.tsx Adjusted imports and restructured CustomMenu usage
web/core/components/home/widgets/links/links.tsx Simplified conditional rendering of links array
web/core/components/home/widgets/links/root.tsx Updated "Quick links" to "Quicklinks" in header and button text
web/core/components/home/widgets/recents/index.tsx Replaced EmptyWorkspace with NoProjectsEmptyState, adjusted filtering logic for recents
web/core/components/stickies/layout/stickies-list.tsx Updated class name for empty state display
web/core/constants/empty-state.tsx Modified descriptions for empty states to enhance clarity
web/core/services/workspace.service.ts Added TActivityEntityData type, updated return type for fetchWorkspaceRecents method

Suggested labels

🎨UI / UX, 🐛bug

Suggested reviewers

  • SatishGandham
  • rahulramesha

Poem

🐰 A Rabbit's Ode to UI Delight

Checkboxes dance with colors bright,
Widgets shimmer, text now just right,
Styling tweaks with playful might,
CodeRabbit's touch makes pixels light!

Hop, hop, hooray! 🎨✨

Possibly related PRs


📜 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 489ba44 and 5366839.

📒 Files selected for processing (1)
  • web/core/components/stickies/layout/stickies-list.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/core/components/stickies/layout/stickies-list.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)

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: 0

🧹 Nitpick comments (8)
web/core/components/editor/sticky-editor/editor.tsx (1)

15-15: LGTM! Consider updating component documentation.

The renaming from Toolbar to StickyEditorToolbar improves component specificity and clarity. The implementation remains functionally unchanged.

Consider adding JSDoc comments to document the component's specific use case within the sticky editor context.

Also applies to: 90-102

web/core/components/home/widgets/empty-states/links.tsx (1)

5-6: Consider standardizing size utility classes.

The component uses both size-[30px] and size-6 classes. Consider standardizing to use Tailwind's built-in size utilities consistently.

-    <div className="flex-shrink-0 size-[30px] grid place-items-center">
-      <Link2 className="size-6 -rotate-45" />
+    <div className="flex-shrink-0 size-8 grid place-items-center">
+      <Link2 className="size-6 -rotate-45" />
web/core/components/home/widgets/empty-states/stickies.tsx (1)

6-7: Maintain consistent size utility classes across components.

Similar to the links component, consider standardizing the size utilities.

-    <div className="flex-shrink-0 size-[30px] grid place-items-center">
-      <RecentStickyIcon className="size-6" />
+    <div className="flex-shrink-0 size-8 grid place-items-center">
+      <RecentStickyIcon className="size-6" />
web/core/components/home/widgets/empty-states/recents.tsx (2)

5-28: Consider using TypeScript enum for type parameter.

The type parameter could benefit from stronger type safety using an enum or union type instead of a string.

type RecentType = 'project' | 'page' | 'issue';

const getDisplayContent = (type: RecentType) => {
  // ... rest of the function
};

35-36: Standardize size utility classes for consistency.

Maintain consistency with size utilities across all empty state components.

-      <div className="flex-shrink-0 size-[30px] grid place-items-center">
-        <displayContent.icon className="size-6" />
+      <div className="flex-shrink-0 size-8 grid place-items-center">
+        <displayContent.icon className="size-6" />
web/core/components/home/widgets/links/link-detail.tsx (2)

Line range hint 41-42: Add error handling for clipboard operations.

The handleCopyText function should handle potential clipboard API failures.

   const handleCopyText = () =>
-    copyTextToClipboard(viewLink).then(() => {
+    copyTextToClipboard(viewLink)
+    .then(() => {
       setToast({
         type: TOAST_TYPE.SUCCESS,
         title: "Link Copied!",
         message: "View link copied to clipboard.",
       });
+    })
+    .catch((error) => {
+      setToast({
+        type: TOAST_TYPE.ERROR,
+        title: "Failed to Copy",
+        message: "Could not copy link to clipboard.",
+      });
     });

80-83: Great UI improvements with room for enhancement.

The transition effects and hover interactions are well implemented. Consider adding focus states for better keyboard accessibility.

-      className="cursor-pointer group flex items-center bg-custom-background-100 px-4 w-[230px] h-[56px] border-[0.5px] border-custom-border-200 rounded-md gap-4 hover:shadow-md transition-shadow"
+      className="cursor-pointer group flex items-center bg-custom-background-100 px-4 w-[230px] h-[56px] border-[0.5px] border-custom-border-200 rounded-md gap-4 hover:shadow-md focus:shadow-md focus:outline-none focus:ring-2 focus:ring-custom-primary-200 transition-all"
web/core/components/home/widgets/links/links.tsx (1)

Line range hint 36-45: Consider performance optimization for large lists.

The ContentOverflowWrapper with flex-wrap might cause performance issues with a large number of links.

Consider implementing virtualization for better performance with large datasets:

import { VirtualizedList } from '@plane/ui';

// Inside the component
return (
  <div className="relative">
    <VirtualizedList
      data={links}
      height={150}
      itemSize={56}
      renderItem={({ index, style }) => (
        <div style={style}>
          <ProjectLinkDetail
            key={links[index]}
            linkId={links[index]}
            linkOperations={linkOperations}
          />
        </div>
      )}
    />
  </div>
);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b53912 and 489ba44.

📒 Files selected for processing (18)
  • packages/editor/src/styles/editor.css (1 hunks)
  • web/core/components/editor/sticky-editor/editor.tsx (2 hunks)
  • web/core/components/editor/sticky-editor/toolbar.tsx (4 hunks)
  • web/core/components/home/home-dashboard-widgets.tsx (1 hunks)
  • web/core/components/home/widgets/empty-states/index.ts (1 hunks)
  • web/core/components/home/widgets/empty-states/links.tsx (1 hunks)
  • web/core/components/home/widgets/empty-states/no-projects.tsx (4 hunks)
  • web/core/components/home/widgets/empty-states/recents.tsx (1 hunks)
  • web/core/components/home/widgets/empty-states/stickies.tsx (1 hunks)
  • web/core/components/home/widgets/links/action.tsx (1 hunks)
  • web/core/components/home/widgets/links/create-update-link-modal.tsx (2 hunks)
  • web/core/components/home/widgets/links/link-detail.tsx (2 hunks)
  • web/core/components/home/widgets/links/links.tsx (1 hunks)
  • web/core/components/home/widgets/links/root.tsx (1 hunks)
  • web/core/components/home/widgets/recents/index.tsx (4 hunks)
  • web/core/components/stickies/layout/stickies-list.tsx (1 hunks)
  • web/core/constants/empty-state.tsx (2 hunks)
  • web/core/services/workspace.service.ts (3 hunks)
✅ Files skipped from review due to trivial changes (4)
  • web/core/components/home/widgets/links/action.tsx
  • web/core/components/home/widgets/links/root.tsx
  • web/core/components/home/home-dashboard-widgets.tsx
  • web/core/components/home/widgets/links/create-update-link-modal.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (23)
web/core/components/editor/sticky-editor/toolbar.tsx (3)

26-26: LGTM! Component name reflects its specific purpose.

The rename from Toolbar to StickyEditorToolbar improves code clarity by explicitly indicating its relationship with the sticky editor.


72-76: Good accessibility improvement with button types.

Adding type="button" to buttons prevents accidental form submissions and follows HTML best practices.

Also applies to: 129-131


102-102: Consistent styling update.

The color class change from text-custom-text-300 to text-custom-text-100/50 aligns with the design system's color hierarchy.

packages/editor/src/styles/editor.css (1)

108-108: Improved visual consistency in checkbox styling.

The changes enhance the checkbox styling by:

  1. Using text color with opacity for borders, creating better visual harmony
  2. Implementing a consistent hover effect that aligns with the text color scheme

Also applies to: 115-115

web/core/services/workspace.service.ts (3)

19-19: LGTM!

The addition of TActivityEntityData type import follows TypeScript naming conventions and is properly placed with other type imports.


333-333: LGTM!

The addition of the return type annotation Promise<TActivityEntityData[]> improves type safety and maintains consistency with the method's implementation.


286-286: Consider updating API endpoints for full consistency.

While the comment has been updated from "quick links" to "quicklinks" for consistency, the API endpoints below still use "quick-links" with a hyphen. Consider updating the endpoints as well to maintain full consistency across the codebase.

Let's check the usage of "quick-links" vs "quicklinks" across the codebase:

web/core/components/home/widgets/empty-states/index.ts (1)

1-4: LGTM! Clean export structure.

The export statements are well-organized, following a modular approach by separating different empty state components into their respective modules.

web/core/components/home/widgets/empty-states/stickies.tsx (1)

9-11: LGTM! Clear and engaging empty state message.

The text content effectively communicates the purpose and encourages user action.

web/core/components/home/widgets/empty-states/recents.tsx (1)

31-39: LGTM! Well-structured component with clear content.

The component is well-organized with the separate getDisplayContent function and maintains consistent styling with other empty states. The messages are clear and informative for each type.

web/core/components/home/widgets/recents/index.tsx (3)

14-14: LGTM! Import changes improve component naming clarity.

The renamed imports (NoProjectsEmptyState, RecentsEmptyState) better reflect their specific purposes.


68-69: LGTM! Empty state handling is more descriptive.

The empty state component change from EmptyWorkspace to NoProjectsEmptyState provides better context to users.


99-100: LGTM! Added null safety with optional chaining.

The addition of optional chaining (?.) before the filter method prevents potential runtime errors when recents is null or undefined.

web/core/components/home/widgets/empty-states/no-projects.tsx (3)

31-32: LGTM! Text content improvements enhance clarity.

The updated text content is more engaging and action-oriented:

  • "Create a project." is more direct
  • "Get started" is more inviting than the previous CTA

Also applies to: 35-35


33-33: LGTM! Consistent icon sizing improves UI.

Icons now use the standardized size-12 class, improving visual consistency across the interface.

Also applies to: 49-49, 59-59


70-76: LGTM! Avatar component implementation is more robust.

The Avatar component now includes proper props for better customization and accessibility:

  • Proper source handling with fallback
  • Name prop for accessibility
  • Size specification
  • Tooltip control
web/core/components/stickies/layout/stickies-list.tsx (1)

87-87: LGTM! Improved empty state container spacing.

Added horizontal margin (mx-2) improves the visual presentation while maintaining the grid layout and centering.

web/core/constants/empty-state.tsx (2)

925-925: LGTM! Enhanced stickies description is more engaging.

The updated description better explains the purpose and value of stickies, making it more relatable to users' needs.


948-949: LGTM! Home widgets empty state message is more positive.

The new message frames the empty state more positively, encouraging users to re-enable widgets rather than focusing on their absence.

web/core/components/home/widgets/links/link-detail.tsx (3)

5-14: LGTM! Clean import organization.

The imports are well-organized into logical groups with clear comments.


Line range hint 21-32: LGTM! Well-structured component implementation.

Good use of observer pattern and proper null checks for linkDetail.


90-119: Improve menu positioning and z-index handling.

The current z-index implementation might cause issues with menu visibility in complex layouts.

Consider the following improvements:

  1. Use a higher z-index value to ensure menu visibility
  2. Add overflow handling for viewport edges
  3. Test menu positioning in different viewport sizes
-        <CustomMenu placement="bottom-end" menuItemsClassName="z-20" closeOnSelect verticalEllipsis>
+        <CustomMenu 
+          placement="bottom-end" 
+          menuItemsClassName="z-[100]" 
+          closeOnSelect 
+          verticalEllipsis
+          containerClassName="relative"
+        >
web/core/components/home/widgets/links/links.tsx (1)

41-43: Consider edge cases in links rendering.

While the simplified rendering logic is cleaner, ensure that links is always an array to prevent runtime errors.

@aaryan610 aaryan610 changed the title fix: dashboard widgets' empty state content and assets [WEB-3203] fix: dashboard widgets' empty state content and assets Jan 24, 2025
@pushya22 pushya22 merged commit d08c03f into preview Jan 24, 2025
10 of 14 checks passed
@pushya22 pushya22 deleted the fix/stickies-ux branch January 24, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants