php-debugbar
php-debugbar copied to clipboard
Dragging Feature
I'm a die-hard fan of the PHP Debugbar package!
The reason for this PR!
In the above image, you can see that I have a menu in the same place as the Debugbar area. Whenever I try to click on the menu, I face issues with the click! I know many people face this problem and may face it in the future!
Therefore, I have tried to implement a feature here that allows the Debugbar to be dragged!
https://github.com/user-attachments/assets/bdbe4f4e-abed-414e-9a78-33388724643a
Great changes @erikn69
@parallels999 & @erikn69
Thank you very much. I really appreciate your help.
@barryvdh hi, it happens, look:
@angeljqv Those are your app contents behind the Laravel Debugbar icon, am i right brother?
Thank you @angeljqv for sharing your scenario. It may help others facing similar situations.
@maximebf Please review it...
I don't really have this issue myself but I can see it being useful. Will try it out.
So tried it, a few things come to mind:
- the left border for the icon is missing
- would it make sense to 'snap' to the right? If I drag it to the right corner, I would expect it to stick, even if I make it larger. It does work when making it smaller, but not larger. Not sure what the cleanest is, but I guess if we could 'flip' the offset from left to right or something?
What do you think about snapping to the right? And maybe the middle?
And I'm getting some misfires for extending, because it probably thinks it's dragging.
What do you think about snapping to the right? And maybe the middle?
I don't think anyone will need to drag it after opening the Debugbar content area/larger. Still, I’m trying to show you something! I can show you something very quickly!
And I'm getting some misfires for extending, because it probably thinks it's dragging.
ups! I will check and fix.......
So tried it, a few things come to mind:
- the left border for the icon is missing
- would it make sense to 'snap' to the right? If I drag it to the right corner, I would expect it to stick, even if I make it larger. It does work when making it smaller, but not larger. Not sure what the cleanest is, but I guess if we could 'flip' the offset from left to right or something?
Something like this for larger?
https://github.com/user-attachments/assets/07f32a32-49dc-4d46-af50-22683f21a33b
Eh no sorry, thats not really what I meant. I just meant that if I drag the button to the right corner and then make the screen larger, I would probably expect the button to stick to the corner, instead of being half way. With sticky/snapping I would mean that if you get within a few pixels of the corner, it woud 'snap' into place in the corner.
Eh no sorry, thats not really what I meant. I just meant that if I drag the button to the right corner and then make the screen larger, I would probably expect the button to stick to the corner, instead of being half way. With sticky/snapping I would mean that if you get within a few pixels of the corner, it woud 'snap' into place in the corner.
Yahoo! I understand! I'm on it now. Thank you brother!
This starting to look nice, thanks :)
Few things I notice
- Sometimes debugbar doesn't open on first click when closed. So might be some incorrect state somewhere?
- I see you change the positioning to a percentage. I'm not 100% sure what makes the most sense yet. When positioning just outside the corner, I suspect you would want to keep it fixed. If it's more to the center, percentage might be more useful (although that seems like an odd place). But not really sure what makes sense.
See #697 https://github.com/user-attachments/assets/6cb0d076-4c3f-4812-a141-28e4f28463ac
Soo I played with it a bit, but not 100% sure. See https://github.com/php-debugbar/php-debugbar/pull/701
I tested this, and I'm not 100% sure about it. I like the idea but it feels really like and edge case. I can see the appeal of moving the debugbar to the right instead of left, but I think that should be either configurable in the UI or as option. The dragging has a bit of a downside of keeping the draggable state when switching tabs or something. Not really sure but it doesn't feel reliable yet.
And to be honest, in the 10+ years of using this, I don't I've heard this feature request yet, so not really sure how necessary this is.
If other feel like they also need this, please let me know.