Repository navigation
feat(tools): snippets, text you save once and get back by name - #70
Merged
Merged
Conversation
Copy an address, a sign-off or a meeting link, type save sig, and from then on ;sig copies it again. ; lists them, save sig replaces one, forget sig deletes one. Thirty at most, 2,000 characters each, a name is one word. Saving reuses the text fixers' rule: the launcher sends a name, and main reads the clipboard itself when the row is run. The pet never says the text back, and a copy made from a snippet is flagged as ours so clipboard history does not record it. Snippets live at the top level of the config, like to-dos. Settings saves the whole tools object from its own copy, so a snippet saved while Settings was open would have been overwritten there. They are plain text on disk, so text in a known key or token format is refused. The check is the pattern list only: the broader guess used for clipboard history turns away a mixed-case email address and a meeting link, which are what people save. Several words after save or forget are left to the web search. The ? list trades its unit conversion row for a snippet row, since it holds eight; conversions are now named on the calculator row.
…ist all thirty Found in review, before any release. - Settings sends back its whole copy of the config on every save. A copy from before a snippet was saved put the old list back, and thirty full snippets (about 74 KB) pushed every save past the 64 KB junk limit, so toggles silently did nothing. settings:save now drops the snippets key, which Settings has no editor for. - A name could not contain a combining mark, which ruled out every Hindi word with a vowel sign. Marks are allowed after the first character, and names are NFKC folded so look-alikes are one name. - forget followed by a word that is no snippet (forget password) is left to the web search again. - ; showed eight snippets at most, and it is the only place to see them all. It lists all thirty; the launcher list scrolls. - save ;sig is the same as save sig. - Refuse a few more credential shapes with no vendor prefix: a connection string with a password in it, a password: or api_key= line, Stripe, GitLab and npm tokens, a Bearer header.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
CI for e81642c: all jobs passed
Tests: 516 passed, 0 failed, 0 skipped, 516 total. This comment updates itself on every push. Full run. |
This branch was successfully deployed
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.
What this does
Text you type again and again, saved once and copied back by name.
save sig;sig(or replaces it);sig;forget sigThirty at most, 2,000 characters each. A name is one word. In all eight languages, and in the
?list.How it fits the launcher's rules
settings.json, unlike clipboard history, which is memory only. Text in a known key or token format is refused, along with connection strings that carry a password,password:andapi_key=lines, and a few more vendor prefixes. This is deliberately narrower than the clipboard-history filter, which would refuse a mixed-case email address and a meeting link. No check recognises every password, and the docs say so.settings:savenow ignores thesnippetskey. See below.Found in review, fixed in the third commit
forget passwordproduced a dead-end row. It is a web search again.;showed only eight snippets and is the only place to see them all.Behaviour changes to know about
savefollowed by one word is now the snippet command, sosave fileoffers to save a snippet namedfilewhere it used to offer a web search. Several words aftersavestill search. An accidental save is undone withforget.?list holds eight rows. Its unit-conversion row made way for the snippet row, and conversions are now mentioned on the calculator row.;shows a preview of each snippet's text on screen.Test plan
npm test: 512 pass, 0 fail, 4 skipped (POSIX only)npx eslint .clean?,;,;ad,save,save phone,save sig(offers Replace),save a;b,forget sig,;zzz. Icons, colours and hint rows as intended, no console errors. That run was before the review fixes; the fixes are covered by unit tests only.save sig, copy something else,;sig, paste.The seven non-English locale files were written without a native-speaker review, as before.