-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Feature/floating draggable position #1831
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
base: master
Are you sure you want to change the base?
Feature/floating draggable position #1831
Conversation
Allow users to drag the debugbar anywhere on screen by setting 'position' => 'floating' in config. Features include snap-to-edge zones, position persistence in localStorage, and touch support.
Unit tests for configuration and browser tests for drag behavior, snap zones, position persistence, and settings panel integration.
|
Thanks, I’ll look into this. I was in the progress of updating php-debugbar, so might be better to do this upstream. And would probably add it to the settings panel, where the current options for left/right are. |
|
Also see php-debugbar/php-debugbar#660 and php-debugbar/php-debugbar#697 but reverted in php-debugbar/php-debugbar#701 because I wasn’t too happy with the UX, but maybe this Pr solves that :) |
|
Oh you have the panel integration already, nevermind :) |
|
I struggled with this a bit too, because it's tricky to differentiate between drag/drop start or a click on the tabs. Might be solved by adding a drag button, if floating is enabled? Or adding a drag radius before activating dragging. Also it seems a bit funky about resizing, especially on the right top. |
|
Thanks for the feedback @barryvdh! I've addressed all the issues: Fixes:
New:
Let me know if anything else needs tweaking! |
|
Hmm yeah I tested this, looks better but not 100% sure convinced about the dragging. I kinda get it if you want the toolbar on top, but not sure why you ever want it floating? If I wanted to have it floating, I think I'd rather have a popup that I can actually move outside the window (which might not be a bad idea, but a bit more to have communication between tab/debugbar). I DO like the blue areas for dragging, but probably more so for the icon itself (which also has 4 places). I kinda would expect that if I drag the icon to top right, it should stay there. For the fixed top:
When floating
|
|
Done i thins this done |
|
Hi @, thanks for reviewing. This PR . CI/checks are <passing/green>. Please merge if there are no further comments. Thanks! |
See my last reply |
|
Yes true |
|
Ok |
|
I added the top bar position here: #1831 It should probably be simpler to add the dragging there, just for the closed button. I don't really see a use for the floating though, sorry. Maybe if others do it might change though. |

Add Floating/Draggable Position Mode
Summary
This PR introduces a new
floatingposition mode that allows users to drag the debugbar anywhere on the screen, providing a more flexible debugging experience especially when working with full-height layouts or when the bottom-fixed debugbar obscures important UI elements.Motivation
The current debugbar is fixed to the bottom of the viewport, which can be problematic when:
Features
Configuration
Snap Zones
When dragging near screen edges, users see a preview of where the debugbar will snap:
Technical Implementation
src/Resources/draggable.js(766 lines) - Standalone draggable functionalityScreenshots
Testing
Unit tests:
FloatingPositionTest.php(14 tests)Browser tests:
FloatingDebugbarBrowserTest.php(16 tests)# Run tests ./vendor/bin/phpunit tests/FloatingPositionTest.php tests/FloatingDebugbarBrowserTest.phpBreaking Changes
None. Default behavior remains unchanged (
'position' => 'bottom').Checklist