Open konsumer opened 6 months ago
I think a good ui feature would be the ability to rename fields, would aid in the reversing of protobufs greatly. Would love to contribute to this anywhere possible.
Agreed. Part of the "choices" idea (mentioned in #12) is being able to dial in types for JSON or proto-generation, and I think name-maps would be helpful there, too.
This issue is about the ui (buttons and select for utilizing features in the library) but the feature you are describing is more about the parser/lib, so maybe the discussion should continue at #12 ? I will add it to the list, too, though.
On the UI side, I think I may need to use a modal or something, due to limited space in the tree, visually. I think adding a bunch of selects to every branch will be a bit annoying, but a lil icon-button to popup a modal would be great.
Maybe it's ok for it to only be a UI thing. I was originally thinking that choices
would be integrated with parsing, but I could see parsing just being creating the initial tree, and types/names could be part of the UI. Additionally, you could export that from UI and maybe use them in the lib too (with a simple util that applies names/types.)
I have this idea forming in my head, where you have a standard tree (to describe a message) & can walk that with a little function, and I am going to try to replace the ui code with that (a walker that returns react) once I get it working in lib.
With new ideas, I setup a name/type map system.
Here is an example map:
{
"id": "1.2.4.1:string",
"title": "1.2.4.5:string",
"company": "1.2.4.6:string",
"description": "1.2.4.7:string",
"media": "1.2.4.10",
"dimensions": "1.2.4.10.2",
"width": "1.2.4.10.2.3:uint",
"height": "1.2.4.10.2.4:uint",
"url": "1.2.4.10.5:string",
"type": "1.2.4.10.1:uint",
"bg": "1.2.4.10.15:string"
}
That works nicely with this fairly complex proto.
Although this is less convenient than an inline-editor, I think it will save some space, and keep the UI simple, and isn't too bad.
After it all merges and I get the library published, I can address the other features.
Related to #12 & #13
ui should have these features integrated: