I want you to write a PoC demo for a single page web app providing various text tools.
The code should be simple and "vanilla", without external dependencies.
This is a research poc where I want to analyse the user experience and the interface.
Unlike other "developer tools" apps, this one only deals with a single text input. So there should be a textarea that should be focused by default.
Full space should be utilised, screen should be divided in sections and there should be no padding on the body.
When the text (or selection) is changed, detection should take place to find what we could do with it. Generally we'd find:
-
displayed "computed" values, like if an arithmetic expression is matched, it could display the result
these can be grouped by "tools" that might display multiple results, like the arithmetic tool might display value in decimal and hex for example
and generally, we'd want to get that value somehow, like copy it, which should somehow be possible using the keyboard, yet noting that multiple tools can display multiple values
-
buttons to perform some decoding, like if the text/selection matches base64, then we'd add a button to decode base64
here we should somehow be able to activate those with the keyboard (activating/clicking a decoder/encoder replaces the text or selection)
all these need to be displayed after matching.
Naturally matching would work only for some subset of tools available in the app, so there should be a way to somehow find manual decode tool.
And obviously the app should support encoders, and they can't be detected, but some top common encoders (like base64) must be visible by default somewhere.
Needless to say, encoders/decoders can sometimes have options, like whether to use url variant of base64..
Importantly, when we decode something, or encode it, the app would know that there exists an opposite operation so should somehow make it easier to reverse this operation (for example after modifying the value), perhaps there should be a space for "inverse" buttons, and after performing a reversible operation, a button would be added to this stack of inverse operations.
What doesn't seem to fit here is hashing, since eventually the app would implement many hashing functions, and every text input can be hashed.. so there's no point in displaying these by default, however, the user should be able to view them if they want to, and just like with other displayed values, somehow it should be possible to reach these values using only keyboard..
Tools can have options, and I'm not sure how that would work with potential Cmd+Shift+P, but if you know I'd be happy to see it.
In this demo there's no need to implement any actual tools, only things that would demonstrate how tools fit in the app:
- \d+\d expression solver
- base64, but using builtin atob and btoa
- dummy hash, it could even return first X characters, just for the demo
First state how the interface would work including keyboard control.
Then output a HTML file where UI interactions should work, but no actual tools beside dummy examples are implemented.
Once again, keyboard interactions are important. I've written something similar, but it was missing easy keyboard support and I see it can't be something "added later", the app needs to be designed with this in mind.