DevToys icon indicating copy to clipboard operation
DevToys copied to clipboard

Auto initialize input and output fields

Open manulaiko opened this issue 2 years ago • 1 comments

Initialize every input and output fields whenever it's possible with the contents of the clipboard or random data in order to reduce the amount of clicks needed to use the tools.

Whenever you switch to a tool that has an input/output field, they should be autoinitialized, the input field should have the contents of the clipboard and the output field the result of executing the tool with the default values.

In case the contents of the clipboard are not compatible with the tool, don't show any warnings and clear the input field.

Here's an example list of fields that shows which fields could be autoinitialized:

Converters

  • JSON <> YAML: Initialize "Input" with the contents of the clipboard.
  • Timestamp: NO CHANGE.
  • Number Base: Initialize "Decimal" with the contents of the clipboard.
  • Cron parser: Initialize "Cron expression to parse" with the contents of the clipboard.

Encoders / Decoders

  • HTML: Initialize "Input" with the contents of the clipboard.
  • URL: Initialize "Input" with the contents of the clipboard.
  • Base64 Text: Initialize "Input" with the contents of the clipboard.
  • Base64 Image: NO CHANGE.
  • GZip: Initialize "Input" with the contents of the clipboard.
  • JWT Decoder: Initialize "Jwt Token" with the contents of the clipboard.

Formatters

  • JSON: Initialize "Input" with the contents of the clipboard.
  • SQL: Initialize "Input" with the contents of the clipboard.
  • XML: Initialize "Input" with the contents of the clipboard.

Generators

  • Hash: Initialize "Input" with the contents of the clipboard.
  • UUID: Initialize "Output" with the result of running the tool with the default values.
  • Lorem Ipsum: NO CHANGE.
  • Checksum: NO CHANGE.

Text

  • Escape / Unescape: Initialize "Input" with the contents of the clipboard.
  • Inspector & Case Converter: Initialize "String" with the contents of the clipboard.
  • Regex Tester: Initialize "Regular Expression" with the contents of the clipboard.
  • Text Diff: Initialize "Old text" with the contents of the clipboard.
  • XML Validator: Initialize "XML" with the contents of the clipboard.
  • Markdown Preview: Initialize "Markdown" with the contents of the clipboard.

Graphics

No change since there are no text input fields.

manulaiko avatar Jul 31 '22 10:07 manulaiko

A future revision of this issue would be to be able to initialize the fields that require an image or a file with the contents of the clipboard as well, but right now you can't paste an image from the clipboard, only from the filesystem.

manulaiko avatar Jul 31 '22 10:07 manulaiko

Sounds similar to #737

veler avatar Mar 20 '23 00:03 veler

Happens when the other one is newer than this one

manulaiko avatar Mar 22 '23 02:03 manulaiko