Codegen menus (POC)#368
Closed
danvk wants to merge 4 commits into
Closed
Conversation
Codecov Report
@@ 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
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
cguedes
reviewed
Aug 18, 2023
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonas a source of truth and generatesmenu.rsandmenu.tsxfrom it. Themenu.rsfile is almost byte-for-byte identical with the hand-generated one.menu.tsxdoesn'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.