Skip to content

chnage layout for agorithm and add toggle for right and left side#8

Merged
liamtran96 merged 2 commits intomainfrom
claude/interview-review-app-01XU6xZUKnCCKoGC7dy3qQ3T
Nov 19, 2025
Merged

chnage layout for agorithm and add toggle for right and left side#8
liamtran96 merged 2 commits intomainfrom
claude/interview-review-app-01XU6xZUKnCCKoGC7dy3qQ3T

Conversation

@liamtran96
Copy link
Copy Markdown
Owner

@liamtran96 liamtran96 commented Nov 19, 2025

Summary by CodeRabbit

  • New Features
    • Added "Algorithms" section to main navigation menu with link to algorithms introduction
    • Introduced sidebar toggle functionality on documentation pages to hide or show sidebars

- Added 'Algorithms' navigation item in header
- Positioned between 'Interview Question' and 'Blog'
- Links to /docs/Algorithms/introduction
- Makes algorithm practice easily accessible from top nav
- Created SidebarToggle component with left/right toggle buttons
- Integrated into AlgorithmProblem component
- Floating buttons on left and right edges
- Click to hide/show sidebars for more screen space
- Smooth transitions with visual feedback
- Positioned at top-left and top-right
- Perfect for focusing on algorithm problems
@vercel
Copy link
Copy Markdown

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
interview Ready Ready Preview Comment Nov 19, 2025 2:27am

@liamtran96 liamtran96 merged commit 0dc35bf into main Nov 19, 2025
2 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new "Algorithms" navigation menu item to the Docusaurus navbar configuration, creates a new SidebarToggle component that provides fixed-position buttons to toggle left and right sidebar visibility via DOM manipulation and CSS variables, and integrates the toggle component into the AlgorithmProblem view.

Changes

Cohort / File(s) Summary
Configuration Updates
docusaurus.config.ts
Added navbar item for Algorithms section with link to /docs/Algorithms/introduction positioned on the left side of the navbar
New Component
src/components/SidebarToggle.tsx
Created new React component with sidebar toggle functionality using useState and useEffect to manage sidebar visibility, DOM element queries, and CSS variable updates with SSR safety guard
Component Integration
src/components/AlgorithmProblem.tsx
Imported and rendered SidebarToggle component in the top area of AlgorithmProblem

Sequence Diagram

sequenceDiagram
    actor User
    participant SidebarToggle
    participant State as React State
    participant Effect as useEffect
    participant DOM

    User->>SidebarToggle: Click toggle button
    SidebarToggle->>State: Update hideLeftSidebar/hideRightSidebar
    State->>Effect: Trigger effect
    rect rgb(230, 245, 255)
      note over Effect,DOM: DOM Manipulation Phase
      Effect->>DOM: Query sidebar elements
      Effect->>DOM: Apply display:none/block
      Effect->>DOM: Update --doc-sidebar-width CSS var
    end
    DOM-->>User: Sidebars shown/hidden
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • SidebarToggle.tsx — Verify DOM selectors match Docusaurus internals, CSS variable naming conventions, and that the ExecutionEnvironment guard properly prevents SSR errors
  • Integration point — Ensure SidebarToggle placement in AlgorithmProblem doesn't conflict with existing layout or styling

Possibly related PRs

  • editor #4 — Previous PR that introduced the AlgorithmProblem component; this PR extends it by adding UI controls to the existing component

Poem

🐰 Toggle buttons, left and right,
Sidebars hide into the night!
Algorithms guide the way,
More screen space for solving today. ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/interview-review-app-01XU6xZUKnCCKoGC7dy3qQ3T

📜 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 60e61f1 and 85b2e18.

📒 Files selected for processing (3)
  • docusaurus.config.ts (1 hunks)
  • src/components/AlgorithmProblem.tsx (2 hunks)
  • src/components/SidebarToggle.tsx (1 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

liamtran96 added a commit that referenced this pull request Nov 24, 2025
- Word Search (Medium #7)
- N-Queens (Medium #8)
- N-Queens II (Hard #9)

Complete Batch 10: Backtracking & Greedy with all 9 problems (6 Easy, 2 Medium, 1 Hard)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants