Skip to content

Chore: Extract off-canvas drawer pattern into Overlays::DrawerComponent#5312

Merged
KevinMulhern merged 1 commit into
mainfrom
feature/off-canvas-drawer-component
May 21, 2026
Merged

Chore: Extract off-canvas drawer pattern into Overlays::DrawerComponent#5312
KevinMulhern merged 1 commit into
mainfrom
feature/off-canvas-drawer-component

Conversation

@KevinMulhern

Copy link
Copy Markdown
Member

Because the nav, lesson sidebar, and admin sidebar all duplicated the same overlay + slide-in panel + visibility controller wiring, this PR extracts the shared shell into a single reusable ViewComponent. Callers yield their content in and pass a hook class and optional breakpoint.

@github-project-automation github-project-automation Bot moved this to 📋 Backlog / Ideas in Main Site May 3, 2026
@KevinMulhern KevinMulhern force-pushed the feature/lesson-sidebar branch 2 times, most recently from 36de006 to 1eaf3ab Compare May 5, 2026 23:38
@KevinMulhern KevinMulhern force-pushed the feature/lesson-sidebar branch from 1eaf3ab to 1b836db Compare May 16, 2026 13:08
Base automatically changed from feature/lesson-sidebar to main May 19, 2026 05:34
@KevinMulhern KevinMulhern force-pushed the feature/off-canvas-drawer-component branch 2 times, most recently from 295f9e9 to 2672a64 Compare May 19, 2026 05:53
@KevinMulhern KevinMulhern requested a review from Copilot May 19, 2026 05:55
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-5312 May 19, 2026 05:56 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the shared “overlay + slide-in panel + visibility controller” off-canvas drawer shell used across the main nav, lesson sidebar, and admin sidebar into a reusable Overlays::DrawerComponent, letting callers yield their specific sidebar content while standardizing the wrapper behavior.

Changes:

  • Added Overlays::DrawerComponent (Ruby + template) to encapsulate the off-canvas drawer markup and visibility wiring.
  • Refactored the shared mobile nav partial, lesson sidebar, and admin sidebar to render through the new component.
  • Added component specs to cover yielded content, close label rendering, optional aria-label, and breakpoint behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/components/overlays/drawer_component_spec.rb Adds specs for the new drawer component’s key behaviors (content yield, labels, breakpoint classes).
app/views/shared/_off_canvas_menu.html.erb Replaces duplicated off-canvas wrapper markup with Overlays::DrawerComponent and yields the nav content.
app/views/layouts/admin/_sidebar_nav.html.erb Refactors the admin mobile off-canvas sidebar to use the shared drawer component.
app/components/overlays/drawer_component.rb Introduces the new component API (hook class, breakpoint, close label, optional aria label).
app/components/overlays/drawer_component.html.erb Implements the shared drawer shell (overlay, panel, close button, transitions, visibility controller).
app/components/lessons/sidebar_component.html.erb Refactors the lesson mobile sidebar drawer to use the shared drawer component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/components/overlays/drawer_component.rb Outdated
Comment thread app/views/shared/_off_canvas_menu.html.erb Outdated
Comment thread app/views/layouts/admin/_sidebar_nav.html.erb Outdated
@KevinMulhern KevinMulhern force-pushed the feature/off-canvas-drawer-component branch from 2672a64 to 13b12b6 Compare May 19, 2026 07:15
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-5312 May 19, 2026 07:16 Inactive
@KevinMulhern KevinMulhern requested a review from Copilot May 19, 2026 08:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread app/views/shared/_off_canvas_menu.html.erb Outdated
Comment thread app/components/overlays/drawer_component.html.erb Outdated
@KevinMulhern KevinMulhern force-pushed the feature/off-canvas-drawer-component branch from 13b12b6 to 27e8f21 Compare May 19, 2026 08:21
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-5312 May 19, 2026 08:21 Inactive
Because the nav, lesson sidebar, and admin sidebar all duplicated the same overlay + slide-in panel + visibility controller wiring, this PR extracts the shared shell into a single reusable ViewComponent. Callers yield their content in and pass a hook class and optional breakpoint.
@KevinMulhern KevinMulhern force-pushed the feature/off-canvas-drawer-component branch from 27e8f21 to 9149d09 Compare May 19, 2026 08:22
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-5312 May 19, 2026 08:23 Inactive
@KevinMulhern KevinMulhern requested a review from Copilot May 19, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread app/components/overlays/drawer_component.html.erb
@KevinMulhern KevinMulhern merged commit 1dbcc83 into main May 21, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from 📋 Backlog / Ideas to ✅ Done in Main Site May 21, 2026
@KevinMulhern KevinMulhern deleted the feature/off-canvas-drawer-component branch May 21, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants