Skip to content

fix spacing and animation again whoops#73

Merged
AustinKelsay merged 1 commit intomainfrom
bugfix/course-sidebar-spacing-glitch
May 12, 2025
Merged

fix spacing and animation again whoops#73
AustinKelsay merged 1 commit intomainfrom
bugfix/course-sidebar-spacing-glitch

Conversation

@AustinKelsay
Copy link
Copy Markdown
Owner

@AustinKelsay AustinKelsay commented May 12, 2025

Summary by CodeRabbit

  • Refactor
    • Improved sidebar animations and visibility handling with distinct behaviors for desktop and mobile views, including enhanced transitions and shadow effects.
  • Style
    • Updated sidebar appearance with smoother animations and visual enhancements for a more polished user experience on both desktop and mobile devices.

@vercel
Copy link
Copy Markdown

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plebdevs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:13pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 12, 2025

Walkthrough

The sidebar rendering logic in the course page was refactored to distinctly handle desktop and mobile views. Desktop uses advanced inline styles for animation and shadow effects, while mobile introduces a new container with specific transitions and an onClose handler. These changes enhance the sidebar's visibility, animation, and responsiveness.

Changes

File(s) Change Summary
src/pages/course/[slug]/index.js Refactored sidebar rendering to separate desktop and mobile logic, updated animation and transition styles, added mobile-specific onClose handler.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CoursePage
    participant Sidebar

    User->>CoursePage: Loads course page
    CoursePage->>Sidebar: Render sidebar (props: isMobile, isVisible, onClose)
    alt Desktop View
        Sidebar-->>CoursePage: Render with inline styles (transform, shadow, etc.)
    else Mobile View
        Sidebar-->>CoursePage: Render in mobile container with transitions
        User->>Sidebar: Triggers onClose
        Sidebar->>CoursePage: Calls onClose handler, hides sidebar, toggles tab
    end
Loading

Poem

In the warren of code, a sidebar appears,
With shadows and slides for desktop frontiers.
On mobile it shrinks, with a magical flair,
A tap and it closes—now gone from the air!
Rabbits rejoice in this animated show,
For sidebars now shimmer wherever you go!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • 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.

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 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
Copy Markdown
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 (1)
src/pages/course/[slug]/index.js (1)

315-318: Consider consolidating transition styles

While the current implementation works well, you might consider extracting these inline transition styles to a Tailwind class or CSS module for better maintainability. This would make future adjustments to animation timings more consistent across components.

- style={{
-   transformOrigin: 'top center',
-   transition: 'opacity 300ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), width 300ms ease-in-out'
- }}
+ className="origin-top-center transition-sidebar"

Then define the transition in your CSS:

.transition-sidebar {
  transition: opacity 300ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), width 300ms ease-in-out;
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 514eeb5 and 113fb78.

📒 Files selected for processing (1)
  • src/pages/course/[slug]/index.js (2 hunks)
🔇 Additional comments (3)
src/pages/course/[slug]/index.js (3)

281-309: Desktop sidebar animation improvements look good!

The updated desktop sidebar styling provides a more refined animation with the combination of translateX, scale transformations, and box-shadow effects. The cubic-bezier timing function creates a smoother, more polished motion.

I particularly like:

  • Using pointer-events-none when hidden to prevent interaction
  • The staggered transition timings (300ms for opacity, 1000ms for transform, 1200ms for shadow)
  • The slight scale reduction (0.97) gives a subtle depth effect

310-334: Mobile sidebar implementation is well-structured

The mobile sidebar implementation properly separates concerns from the desktop version and uses appropriate transitions. The addition of the onClose handler that both hides the sidebar and toggles back to the active tab is a good UX enhancement.

The conditional classes and transitions look good, with appropriate z-index management to ensure proper stacking.


311-314:

Details

✅ Verification successful

Verify mobile view tab naming consistency

The condition activeTab === 'lessons' is used here to show the sidebar, but I don't see 'lessons' in the tab options elsewhere in the file. Verify this is the correct tab name, as the other tabs appear to be 'overview', 'content', and 'qa'.


🏁 Script executed:

#!/bin/bash
# Check if 'lessons' is defined as a tab anywhere in the file or related files
rg -i "lessons.*tab|tab.*lessons" --type js
# Also check the useCourseNavigation hook that's used in this component
fd useCourseNavigation.js -x cat {}

Length of output: 3750


Mobile view ‘lessons’ tab is correctly defined

The lessons tab is inserted by useCourseTabsState (in src/hooks/courses/useCourseTabsState.js) for mobile view and is used in useCourseNavigation to control sidebar visibility. The condition activeTab === 'lessons' is therefore valid—no changes needed.

@AustinKelsay AustinKelsay merged commit 6b35da2 into main May 12, 2025
4 checks passed
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.

1 participant