-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add toolbar collapse button and mobile responsiveness #33
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
Conversation
- Added collapse button to toolbar with directional icons - Implemented CSS for collapsed state across all toolbar positions - Added localStorage persistence for collapsed state - Added comprehensive mobile responsiveness with media queries - Mobile optimizations: - Automatic bottom positioning on mobile - Touch-friendly button sizes (min 32px) - Responsive font sizes and spacing - Optimized panel tables and grids for small screens - Hide non-essential elements on very small screens (<480px) - Support for landscape orientation - JavaScript collapse toggle function with state persistence - All linting checks passed Co-authored-by: JacobCoffee <45884264+JacobCoffee@users.noreply.github.com>
|
|
@copilot fix Nested media query could be cleaner as separate query |
|
@copilot also fix unused toolbar-content div in HTML (CSS references it, but content uses .toolbar-details) |
There was a problem hiding this comment.
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 adds collapse functionality and comprehensive mobile responsiveness to the debug toolbar, addressing issues where the toolbar blocks content and is unusable on mobile devices. The implementation includes position-aware directional icons, localStorage state persistence, and touch-friendly UI elements.
- Added collapse button with position-aware icons (« » ⌃ ⌄) that rotates based on toolbar position
- Implemented mobile-first responsive design with bottom positioning on mobile devices (max-width: 768px)
- Enhanced touch accessibility with 32px minimum touch targets and improved spacing
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/integration/test_litestar_middleware.py | Reordered imports for consistency; removed Response import from line 280 (though still used in line 287) |
| src/debug_toolbar/litestar/routes/handlers.py | Added CSS styles for collapse button with position-aware rotations, comprehensive mobile media queries, and JavaScript for collapse state management with localStorage persistence |
| src/debug_toolbar/litestar/middleware.py | Added collapse button HTML with accessibility attributes and new toolbar-content container div |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixed in 4c03d7d. Removed the unused |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add examples/__init__.py to make examples a proper package - Update Makefile to use `python -m` instead of direct script execution - Fixes relative imports and uvicorn module paths in examples 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When collapsed, now only the expand button is visible - all other elements (brand, time, panels, controls) are hidden. The toolbar shrinks to a small button in the corner instead of a dropdown-style partial collapse. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Right position: » when expanded (collapse), « when collapsed (expand) - Left position: « when expanded (collapse), » when collapsed (expand) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Toolbar Collapsibility and Mobile Responsiveness - Complete
📸 Documentation Screenshot
🎯 Problem Solved
Issue: Debug toolbar blocks content and has poor mobile experience
✨ Features Implemented
1. Collapsible Toolbar ✅
localStoragearia-expandedandaria-labelattributes2. Mobile Responsiveness ✅
Breakpoints:
@media (max-width: 768px)- Main mobile styles@media (max-width: 480px)- Extra small screens (separate query)@media (max-width: 1024px) and (max-height: 600px)- LandscapeFeatures:
3. State Persistence ✅
All preferences saved to localStorage:
📱 Mobile Optimizations
🔧 Technical Changes
Files Modified:
src/debug_toolbar/litestar/middleware.py(+3 lines, -1 line)src/debug_toolbar/litestar/routes/handlers.py(+156 lines)tests/integration/test_litestar_middleware.py(+1 line)Recent Fixes:
@media (max-width: 480px)to separate blocktoolbar-contentdiv and CSSString()conversion for localStorageKey CSS Classes:
.toolbar-collapse-btn- Collapse button styling.collapse-icon- Directional icon transformations@media (max-width: 768px)- Main mobile overrides@media (max-width: 480px)- Extra small screen overrides (separate query)Key JS Functions:
addCollapseButton()- Attaches click handler and sets initial aria attributestoggle()- Toggles state, saves to localStorage, updates aria attributesconstructor()- Loads saved collapsed stateinit()- Applies saved state on page load✅ Testing & Validation
Automated Checks:
Code Quality:
make lint- All checks passedmake fmt- Code formatted🎨 Visual Impact
Desktop - Collapsed State:
↓ Click collapse button ↓
Mobile - Portrait:
🚀 Benefits
📊 Code Statistics
🔍 Review Checklist
🎯 Closes Issue
Resolves the toolbar blocking content and mobile usability issues described in the original enhancement request.
Before: Toolbar blocks content, unusable on mobile
After: Collapsible toolbar with full mobile support and accessibility
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.