Skip to content
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

Floating canvas toolbar should use the new insert menu #5443

Closed
Rheeseyb opened this issue Apr 30, 2024 · 2 comments · Fixed by #5746
Closed

Floating canvas toolbar should use the new insert menu #5443

Rheeseyb opened this issue Apr 30, 2024 · 2 comments · Fixed by #5746
Assignees
Milestone

Comments

@Rheeseyb
Copy link
Contributor

Rheeseyb commented Apr 30, 2024

The floating canvas toolbar includes a search bar with a dropdown list for insertable components. This should be replaced with the new insert menu (https://github.com/concrete-utopia/utopia/blob/master/editor/src/components/navigator/navigator-item/component-picker-context-menu.tsx and https://github.com/concrete-utopia/utopia/blob/master/editor/src/components/navigator/navigator-item/component-picker.tsx).

@Rheeseyb
Copy link
Contributor Author

@maltenuhn do we have any designs for how to combine these?

@Rheeseyb
Copy link
Contributor Author

The current progress on this is in #5746, but it needs design work, and I've is blocked by #5696, as the new insert menu doesn't yet support wrapping of multiple elements.

liady pushed a commit that referenced this issue Jun 3, 2024
Blocked waiting on #5794

**Problem**
We were still using the old insert menu in the canvas toolbar

**Fix**
Use the new component picker in the canvas toolbar. The main changes
here are in `editor/src/components/editor/canvas-toolbar.tsx` (where the
old dropdown list was replaced with the new component picker) and
`editor/src/components/navigator/navigator-item/component-picker.tsx`
(as I've had to update the props so that they styling is different when
the picker is rendered inside the toolbar).

This PR has ripped out a lot of now dead code around the old dropdown,
but hasn't removed the (already dead but still used in some tests)
insert menu pane.

Note that this PR has removed the `g` shortcut (which was an alias for
the `w` to 'wrap in' shortcut but opened the old menu rather than the
new one - `cmd`+`g` still exists). I can put that back if we still want
it. I just deleted it whilst I was flushing out dead code.

Also note that with the old insert menu we had the ability to wrap in
certain elements that cannot be inserted normally (e.g. the `Group`
element). That functionality no longer exists.

<img width="297" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/1044774/4268a4b5-39a8-4042-9eea-c4d3c1c5a96f">
<img width="287" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/1044774/477fda9c-53ac-4fb5-8c48-268bc4df3857">

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Preview mode

Fixes #5443

---------

Co-authored-by: Federico Ruggi <1081051+ruggi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants