maximebf / php-debugbar

Debug bar for PHP
phpdebugbar.com
MIT License
4.2k stars 401 forks source link

Dragging Feature #660

Open devzkhalil opened 4 months ago

devzkhalil commented 4 months ago

I'm a die-hard fan of the PHP Debugbar package!

The reason for this PR!

2024-07-09_17-47

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

devzkhalil commented 4 months ago

Great changes @erikn69

devzkhalil commented 4 months ago

@parallels999 & @erikn69
Thank you very much. I really appreciate your help.

angeljqv commented 4 months ago

@barryvdh hi, it happens, look: image

devzkhalil commented 4 months ago

@angeljqv Those are your app contents behind the Laravel Debugbar icon, am i right brother?

devzkhalil commented 4 months ago

Thank you @angeljqv for sharing your scenario. It may help others facing similar situations.

devzkhalil commented 2 months ago

@maximebf Please review it...

barryvdh commented 2 months ago

I don't really have this issue myself but I can see it being useful. Will try it out.

barryvdh commented 2 months ago

So tried it, a few things come to mind:

barryvdh commented 2 months ago

What do you think about snapping to the right? And maybe the middle?

barryvdh commented 2 months ago

And I'm getting some misfires for extending, because it probably thinks it's dragging.

devzkhalil commented 2 months ago

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!

devzkhalil commented 2 months ago

And I'm getting some misfires for extending, because it probably thinks it's dragging.

ups! I will check and fix.......

devzkhalil commented 2 months ago

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

barryvdh commented 2 months ago

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.

devzkhalil commented 2 months ago

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!