tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.
https://tldraw.dev
Other
33.39k stars 1.99k forks source link

Fix toolbar duplicate tools bug #3757

Closed engin-can closed 1 week ago

engin-can commented 2 weeks ago

Solves issue where toolbar overflow menu has duplicate tools from main toolbar.

Before image

After CleanShot 2024-05-14 at 14 56 52

Change Type

vercel[bot] commented 2 weeks ago

@ecan-dearx is attempting to deploy a commit to the tldraw Team on Vercel.

A member of the Team first needs to authorize it.

huppy-bot[bot] commented 2 weeks ago

Hey, thanks for your pull request! Before we can merge your PR, you will need to sign our Contributor License Agreement by posting a comment that reads:

I have read and agree to the Contributor License Agreement.

engin-can commented 2 weeks ago

I have read and agree to the Contributor License Agreement.

steveruizok commented 1 week ago

Wow, how did I never notice this one? If we do remove a shape like this, I suppose that means we can restore one of the commented out tools, too.

mimecuvalo commented 1 week ago

@steveruizok i'm closing this one - it's superseded by https://github.com/tldraw/tldraw/pull/3779 i'll pull over your re-ordering commit to the other PR

steveruizok commented 1 week ago

Correction, this isn't a bug! And if we remove the duplicated tool then actually the menu gets too shuffled. Sorry @engin-can, closing this one!

ecan-dearx commented 1 week ago

So are you saying you are keeping duplicate tools in this case? This doesn't make any sense... CleanShot 2024-05-22 at 19 12 05

mimecuvalo commented 1 week ago

It's only an issue if there's one item in the overflow menu (and that's been resolved in this PR: https://github.com/tldraw/tldraw/pull/3779)

The popout menu is meant to be stable and not shift as you select an item. (otherwise it would get confusing as items moved around) The item that is 'duplicated' is a slot that is the most-recent item selected from that menu.

It may seem strange but it's the intended design.