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

[feat] JS window menu API #6617

Closed
KaKi87 opened this issue Apr 3, 2023 · 12 comments · Fixed by #7709
Closed

[feat] JS window menu API #6617

KaKi87 opened this issue Apr 3, 2023 · 12 comments · Fixed by #7709

Comments

@KaKi87
Copy link

KaKi87 commented Apr 3, 2023

Describe the problem

Window menu can't be set from JS.

Describe the solution you'd like

A JS window menu API would allow setting window menu from JS.

Alternatives considered

None

Additional context

None


Thanks

@TechStudent10
Copy link

Is this being implemented or...

@KaKi87
Copy link
Author

KaKi87 commented Apr 26, 2023

No, backlog = to-do.

https://en.wikipedia.org/wiki/Product_backlog

@TechStudent10
Copy link

No, backlog = to-do.

https://en.wikipedia.org/wiki/Product_backlog

I didn't see that, I was on mobile. (GitHub doesn't show Project updates on mobile, for whatever reason)

@wusyong wusyong moved this from 📋 Backlog to 📬Proposal in Roadmap Apr 29, 2023
@danvk
Copy link

danvk commented Aug 16, 2023

Full control of the menu bar from JS would be a great feature to have. I'd like to be able to define the menu bar on the JS side and have it be a native menu for desktop but a DOM element if I'm building for the web. Something like:

<Menu name="file">
  <MenuItem name="Save As" id="save-as" />
  <MenuSeparator />
  <MenuItem name="Quite" id="quit" />
</Menu>

the only missing piece is some way to set menus programmatically in Tauri.

@amrbashir
Copy link
Member

I don't think we will providing that, we will only provide a programmatic JS menu api (around native menu APIs) that will work only in tauri. A fallback to a JS implementation and DOM elements for web sounds cool but it will probably be an unofficial plugin.

@danvk
Copy link

danvk commented Aug 17, 2023

@amrbashir we'll certainly be building this ourselves, we just need some way of programmatically setting the menu (either from Rust or JS) to make it possible.

@KaKi87
Copy link
Author

KaKi87 commented Nov 19, 2023

So, this will only be available in v2 ?

@amrbashir
Copy link
Member

yeah, only v2, we don't have enough resources to backport it to v1 and probably can't as it includes many breaking changes in the underlying windowing crate (tao)

@KaKi87
Copy link
Author

KaKi87 commented Nov 19, 2023

I see. Not pointing fingers, but when told that v1 would continue being maintained when v2 development started, I didn't think it meant bugfixes only.

With all the good stuff only being added to v2, it's like v1 already outlived its usefulness and we're waiting again.

@amrbashir
Copy link
Member

v1 is still maintained and most of new features and bug fixes will be backported if possible without breaking changes, which is not the case for the new menu APIs (Rust and JS)

@KaKi87
Copy link
Author

KaKi87 commented Nov 19, 2023

Well, I'm unlucky then, because every feature I requested is only planned for v2. :/

@amrbashir
Copy link
Member

amrbashir commented Nov 19, 2023

We may have missed on backporting some features, get in touch with us on discord and we can discuss it if you feel some need to be backported

@amrbashir amrbashir moved this from 📬Proposal to ✅ Done in Roadmap Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants