Open a .proto from disk, on both schema boxes - #10
Merged
Merged
Conversation
Pasting a schema is fine for a snippet, but anyone arriving with a real .proto on disk had to go via an editor and the clipboard first. Both boxes now take a file directly: next to the sample picker on schema-to-code, and inside the optional schema panel on the decoder. The file is read in the browser, the same way the decoder already reads a raw payload file, so opening one sends nothing anywhere; what happens on generate is unchanged, and the privacy badge still says so. This takes the decoder's "Copy from Schema -> code" button for the slot. It moved text between two boxes that are both editable and both on screen, which is a thing anyone can already do, and it read as a copy-to-clipboard action besides.
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.
Both
.protoboxes now accept a file from disk, so arriving with a real schema no longer means a detour through an editor and the clipboard.Load a sample….The file is read in the browser with
File.text(), exactly as the decoder already reads a raw payload file. Opening one sends nothing anywhere, and what happens on Generate is unchanged — the privacy badge still tells the whole story.The button it replaces
Copy from Schema → codeis gone. It copied the text of one on-screen editable box into another on-screen editable box, which anyone can already do, and the label read like a copy-to-clipboard action rather than a transfer. Its slot is better spent on something you cannot do by hand.schemaViewText()existed only to serve it and goes with it.Notes
my.proto/payload.proto); the opened file's own name is not adopted. Worth considering separately, since it would change generated output names..protowith localimports still will not resolve — that needs multi-file input, which is its own piece of work.Typecheck clean, 27 tests pass, production build fine. Not verified visually in a browser.