tldraw/apps/examples/e2e/tests
alex adebb680e5
Component-based toolbar customisation API (#3067)
When we went from overrides-based to component based UI customisation
APIs, we didn't do the toolbar because it had some significant extra
complexity around overflowing the contents of the menu into the
dropdown. This is really hard to do at render-time with react - you
can't introspect what a component will return to move some of it into an
overflow.

Instead, this diff runs that logic in a `useLayoutEffect` - we render
all the items into both the main toolbar and the overflow menu, then in
the effect (or if the rendered components change) we use CSS to remove
the items we don't need, check which was last active, etc. Originally, I
wasn't really into this approach - but i've actually found it to work
super well and be very reliable.

### Change Type

- [x] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Test the toolbar at many different sizes with many different 'active
tools'

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-03-12 16:14:28 +00:00
..
export-snapshots.spec.ts-snapshots Make sure correct dark mode colours get used in exports (#2492) 2024-01-17 14:31:38 +00:00
fixtures Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-canvas-events.spec.ts-snapshots Replace Atom.value with Atom.get() (#2189) 2023-11-13 11:51:22 +00:00
export-snapshots.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-actions-menu.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-camera.spec.ts Add playwright tests (#1484) 2023-05-30 15:28:56 +01:00
test-canvas-events.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-clipboard.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-context-menu.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-focus.spec.ts Component-based toolbar customisation API (#3067) 2024-03-12 16:14:28 +00:00
test-help-menu.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-kbds.spec.ts Component-based toolbar customisation API (#3067) 2024-03-12 16:14:28 +00:00
test-main-menu.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-navigation-panel.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-page-menu.spec.ts Adding a single E2E test per menu (#2954) 2024-02-29 13:21:10 +00:00
test-routes.spec.ts [fix] Routes check on e2e tests (#3022) 2024-03-02 16:42:07 +00:00
test-shapes.spec.ts Component-based toolbar customisation API (#3067) 2024-03-12 16:14:28 +00:00
test-smoke.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-style-panel.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-text.spec.ts tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
test-toolbar.spec.ts E2E Style Panel Tests (#2878) 2024-02-23 14:37:15 +00:00