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

Feautre/cartouche context menu #5993

Merged
merged 8 commits into from
Jun 19, 2024
Merged

Conversation

balazsbajorics
Copy link
Contributor

This PR adds a basic context menu to the Data Reference Cartouche.
image

Most of my evening was spent wrestling ContextMenuWrapper. I decided to "give up" and create a new component which uses a proper portal instead of horrible x-hacks and whatevers.

Commit Details:

  • Renamed ContextMenuWrapper to ContextMenuWrapper_DEPRECATED also marked it as deprecated
  • Added new ContextMenuWrapper which takes way less props, uses less wrapping divs, and uses a Portal.
  • DataCartoucheInner uses ContextMenuWrapper.
  • The only actually working option is Replace... which just opens the data picker
  • Everything else is a placeholder for future capability

Fixes #5972

Copy link
Contributor

github-actions bot commented Jun 18, 2024

Try me

Copy link

relativeci bot commented Jun 18, 2024

#13132 Bundle Size — 62.24MiB (~+0.01%).

563d164(current) vs 6339ece master#13129(baseline)

Warning

Bundle contains 51 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#13132
     Baseline
#13129
Regression  Initial JS 45.3MiB(~+0.01%) 45.3MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 22.21% 21.57%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4302 4302
No change  Duplicate Modules 523 523
Change  Duplicate Code 31.83%(-0.03%) 31.84%
No change  Packages 448 448
No change  Duplicate Packages 51 51
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#13132
     Baseline
#13129
Regression  JS 62.23MiB (~+0.01%) 62.23MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch feautre/cartouche-context-menuProject dashboard

@@ -127,7 +127,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`1007`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like quite a jump.

@bkrmendy bkrmendy merged commit 16381e0 into master Jun 19, 2024
16 checks passed
@bkrmendy bkrmendy deleted the feautre/cartouche-context-menu branch June 19, 2024 09:58
liady pushed a commit that referenced this pull request Dec 13, 2024
This PR adds a basic context menu to the Data Reference Cartouche.
<img width="315" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/2226774/a4f57aae-cc2c-4fce-8389-376e28d3a68c">

Most of my evening was spent wrestling ContextMenuWrapper. I decided to
"give up" and create a new component which uses a proper portal instead
of horrible x-hacks and whatevers.


**Commit Details:**
- Renamed `ContextMenuWrapper` to `ContextMenuWrapper_DEPRECATED` also
marked it as deprecated
- Added new `ContextMenuWrapper` which takes way less props, uses less
wrapping divs, and uses a Portal.
- `DataCartoucheInner` uses `ContextMenuWrapper`. 
- The only actually working option is `Replace...` which just opens the
data picker
- Everything else is a placeholder for future capability

Fixes #5972

---------

Co-authored-by: Berci Kormendy <[email protected]>
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 this pull request may close these issues.

Context menu on data cartouche
3 participants