Skip to content

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Jan 28, 2025

Description

This PR adds a proper max height to each sticky note along with fixing other overflow issues.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Style Updates

    • Refined styling for sticky editor and toolbar components
    • Adjusted layout and height constraints for sticky notes and inputs
    • Simplified class name configurations across multiple components
  • Improvements

    • Enhanced component responsiveness by adding pathname-based conditional rendering
    • Streamlined toolbar visibility and control flow
    • Removed drop indicators in drag-and-drop functionality
  • Performance

    • Optimized component rendering with more concise class name implementations

@aaryan610 aaryan610 added 🐛bug Something isn't working 🌐frontend labels Jan 28, 2025
@aaryan610 aaryan610 added this to the v0.24.0 milestone Jan 28, 2025
@aaryan610 aaryan610 requested a review from gakshita January 28, 2025 09:48
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2025

Walkthrough

The pull request introduces refinements to several components related to sticky notes and their editor functionality. The changes primarily focus on styling adjustments, layout modifications, and minor improvements to component rendering across multiple files. Key modifications include updating class names, adjusting height and padding settings, and introducing conditional rendering logic for better responsiveness across different page contexts.

Changes

File Change Summary
web/core/components/editor/sticky-editor/editor.tsx - Removed p-3 padding from main div
- Modified toolbar div with fixed h-[60px] and px-4
- Simplified toolbar visibility control
web/core/components/editor/sticky-editor/toolbar.tsx - Removed mt-2 class from toolbar's outer div
web/core/components/stickies/layout/sticky-dnd-wrapper.tsx - Changed minimum height to padding of 8px
- Commented out DropIndicator components
web/core/components/stickies/sticky/inputs.tsx - Added usePathname import
- Introduced isStickiesPage constant
- Updated containerClassName with conditional max-height
- Increased min-h and added scrollbar classes
web/core/components/stickies/sticky/root.tsx - Simplified div class name
- Removed commented-out isStickiesPage line

Possibly related PRs

Suggested Labels

🎨UI / UX

Suggested Reviewers

  • rahulramesha
  • sriramveeraghanta

Poem

🐰 Sticky notes dance with grace,
Code refactored, a gentle embrace
Margins trim, heights align just right
UI polished, a coder's delight!
Rabbit hops through lines so neat 🎨


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 (2)
web/core/components/stickies/sticky/root.tsx (1)

77-77: Consider adding a max-height constraint for better UX.

While adding overflow-y-scroll helps with content overflow, removing the max-height constraint entirely might lead to excessively tall sticky notes. Consider adding a responsive max-height constraint using CSS variables or viewport units.

-        className={cn("w-full h-fit flex flex-col rounded group/sticky overflow-y-scroll", className)}
+        className={cn("w-full h-fit max-h-[80vh] flex flex-col rounded group/sticky overflow-y-scroll", className)}
web/core/components/editor/sticky-editor/editor.tsx (1)

84-87: Improved toolbar visibility transitions.

The toolbar animation and visibility logic has been simplified while maintaining smooth transitions:

  1. Fixed height of 60px ensures consistency
  2. Scale and opacity transitions provide smooth animations
  3. Proper use of invisible class prevents interaction when hidden

Consider adding a comment explaining the transition values for future maintainability.

 className={cn(
   "transition-all duration-300 ease-out origin-top px-4 h-[60px]",
+  // Transition values:
+  // - duration-300: 300ms transition duration
+  // - ease-out: smooth deceleration
+  // - origin-top: scale from top edge
   {
     "max-h-[60px] opacity-100 scale-y-100": isFocused,
     "max-h-0 opacity-0 scale-y-0 invisible": !isFocused,
   }
 )}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe58e0 and 53dba10.

📒 Files selected for processing (5)
  • web/core/components/editor/sticky-editor/editor.tsx (3 hunks)
  • web/core/components/editor/sticky-editor/toolbar.tsx (1 hunks)
  • web/core/components/stickies/layout/sticky-dnd-wrapper.tsx (1 hunks)
  • web/core/components/stickies/sticky/inputs.tsx (3 hunks)
  • web/core/components/stickies/sticky/root.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • web/core/components/stickies/layout/sticky-dnd-wrapper.tsx
  • web/core/components/editor/sticky-editor/toolbar.tsx
🔇 Additional comments (7)
web/core/components/stickies/sticky/root.tsx (1)

Line range hint 77-81: Verify scroll behavior on mobile devices.

The overflow-y-scroll implementation might need additional touch handling for smooth scrolling on mobile devices. Consider testing the scroll behavior across different devices and screen sizes.

✅ Verification successful

Native scroll behavior is sufficient for mobile devices

The current implementation using overflow-y-scroll relies on the browser's native touch handling, which is well-supported across modern mobile devices and provides a smooth scrolling experience out of the box. No additional touch handling is necessary.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any touch event handlers or mobile-specific scroll implementations
rg -g '*.{ts,tsx}' 'touch|scroll|mobile' web/core/components/stickies

Length of output: 609

web/core/components/stickies/sticky/inputs.tsx (4)

2-2: LGTM! Clean import additions.

The new imports are properly organized and necessary for the implemented changes.

Also applies to: 9-9


29-30: LGTM! Good use of Next.js navigation hook.

The usePathname hook is appropriately used to determine the current context.

Also applies to: 35-35


81-86: Verify the max-height values for different contexts.

The conditional max-height implementation looks good, but let's ensure these specific values work well across all scenarios:

  • Default: max-h-[540px]
  • Stickies page: max-h-[588px]

Also, the scrollbar implementation with overflow-y-scroll is a good addition for handling content overflow.

Could you verify if these height values are sufficient for all use cases? For example:

  1. Different screen sizes
  2. Various content lengths
  3. Mobile responsiveness

89-89: LGTM! Clean border removal.

Removing border and padding from the parent container helps maintain consistent styling.

web/core/components/editor/sticky-editor/editor.tsx (2)

6-7: LGTM! Better import organization.

Good categorization of the TSticky type import under "plane types".


62-62: LGTM! Consistent border styling.

The border and rounded corners provide a clean, consistent look while maintaining the sticky note aesthetic.

@sriramveeraghanta sriramveeraghanta merged commit f32635a into preview Jan 28, 2025
12 of 14 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/stickies-height branch January 28, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🌐frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants