Skip to content

Codegen menus (POC)#368

Closed
danvk wants to merge 4 commits into
mainfrom
codegen-menus
Closed

Codegen menus (POC)#368
danvk wants to merge 4 commits into
mainfrom
codegen-menus

Conversation

@danvk

@danvk danvk commented Aug 17, 2023

Copy link
Copy Markdown
Collaborator

Our dream was to define the menu bar on the TypeScript side and have it either get pushed into the system menu bar (for the desktop app) or get rendered in the DOM (for the web UI).

That dream doesn't seem possible at the moment, so instead we have codegen! This PR creates menu.json as a source of truth and generates menu.rs and menu.tsx from it. The menu.rs file is almost byte-for-byte identical with the hand-generated one. menu.tsx doesn't do anything at the moment, but it's what we'd want to render a menu bar in the web version of RefStudio (#347).

Looking at menu.tsx, I'm actually wondering whether this is a good idea after all. A pretty large fraction of the menu items are system-related ones ("Hide Others", "Maximize", "Select All") that might not make sense to show in a DOM UI since they're already part of the browser's system menu bar.

@codecov

codecov Bot commented Aug 17, 2023

Copy link
Copy Markdown

Codecov Report

Merging #368 (6cd0f15) into main (224b1d6) will decrease coverage by 1.02%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #368      +/-   ##
==========================================
- Coverage   84.67%   83.66%   -1.02%     
==========================================
  Files         167      171       +4     
  Lines        9625     9811     +186     
  Branches     1056     1057       +1     
==========================================
+ Hits         8150     8208      +58     
- Misses       1464     1591     +127     
- Partials       11       12       +1     
Files Changed Coverage Δ
python/generate_menus.py 0.00% <0.00%> (ø)
src/components/menu.tsx 0.00% <0.00%> (ø)

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment thread .vscode/settings.json
@danvk

danvk commented Aug 23, 2023

Copy link
Copy Markdown
Collaborator Author

I'm going to close this out.

Another wrinkle from #399 is that keyboard shortcuts might need to be different between Desktop. If we want a menu bar, then two separate implementations might really be the way to go. And, per #384, we may not even want a menu bar at all.

@danvk danvk closed this Aug 23, 2023
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.

2 participants