Skip to content

feat(tools): type ? for examples, and fix copied text from the launcher - #68

Merged
JOhnsonKC201 merged 5 commits into
mainfrom
feat/tools-help-textfix
Oct 9, 2026
Merged

JOhnsonKC201 merged 5 commits into
mainfrom
feat/tools-help-textfix

Conversation

@JOhnsonKC201

Copy link
Copy Markdown
Owner

What this does

Two additions to Quick Tools, aimed at people who will never read the docs.

Type ? to see what you can type. Every tool in the launcher is a typed command, so none of them is visible until you already know it. ? (or help, or "What can I type?" at the bottom of the empty list) shows an example of each tool. Enter on an example puts its start in the box (todo , 10m , g ) for you to finish. A command word followed by a space shows that command's example while you type the rest.

Fix the text you just copied. upper, lower, title, plain, one line, count. Typing text lists all six.

Type Result
plain Drops fonts, colours and links, so a paste takes the style of where it lands
one line Joins a paragraph that a PDF or an email broke into short lines
upper, lower, title Changes the case
count The pet says the words, characters and lines; nothing changes

All eight languages.

How it stays inside the launcher's rules

  • fill is a new action type that runs nothing. Main answers launcher:run with a fixed string from its own table; the launcher still sends only a query and an index.
  • The fixers read the clipboard in main, only when one is run. The row is a label, never a preview. The pet does not repeat the text. The write is flagged as ours, so clipboard history does not record it, and the feature works with history off.
  • src/tools/textfix.js is pure: no Electron, no clipboard.

Found while verifying

  • Ranking regression, fixed before commit. The new commands have long titles, and the scattered-letter matcher let them swallow ordinary searches: weather fits inside "lowercase the copied text". Help and the fixers now match on whole-word starts only. Compared against main on about 35 queries; weather, news, hello, excel fall back to search again.
  • A quadratic regex in plain (second commit). 80,000 spaces took about 16 seconds in the main process. Now linear, with a test that runs every fixer on the largest allowed input.
  • Title Case keeps a combining accent inside its word. count does not count a trailing line break as a line.

Test plan

  • npm test: 496 pass, 0 fail, 4 skipped (the POSIX-only iPad terminal tests, skipped on Windows)
  • npx eslint . clean
  • npm run test:boot OK
  • The real launcher.html, renderer, icons and router driven in a throwaway Electron window (English, Japanese, Hindi): ? lists 8 rows with icons, Enter on the to-do row fills todo and shows its example, text lists the 6 fixers, upper + Enter produces { type: 'textfix', op: 'upper' }, no console errors
  • Run the installed app and try plain on text copied from a web page into Word or Mail. The harness stubs the OS side, so the real clipboard round trip has unit tests with a stubbed clipboard but no live run.
  • Not run on macOS

Notes for review

  • The seven non-English locale files were written without a native-speaker review, same as the rest of them.
  • title, count, line and text typed alone now find a fixer first instead of offering a web search. g title still searches.

upper, lower, title, plain, one line and count as plain functions:
text in, text or a count out, no Electron and no clipboard. Refuses
blank input, input over 200,000 characters and unknown fixers
instead of throwing.

Title Case treats an apostrophe and a combining accent as inside a
word. plain turns no-break spaces into spaces, drops zero-width
characters and trims trailing whitespace on each line. count does
not treat a trailing line break as one more line.
plain stripped trailing spaces with a regex that looked ahead for the
line end. Inside one long run of spaces that rescans the run from
every position, so 80,000 spaces took about 16 seconds, and a fixer
runs in the main process, where that freezes the pet, the tray and
every timer. It now trims line by line with trimEnd.

A test runs every fixer on the largest allowed input, shaped as the
worst case for a backtracking regex, and fails past 1.5 seconds.
Every tool in the launcher was a typed command you had to read the
docs to learn. Typing ? or help now lists an example of each. Enter
on an example puts its start in the box (a new fill action that main
answers with a fixed string and that runs nothing), and a command
word followed by a space shows that command's example while you
type the rest. The empty list ends with What can I type?.

upper, lower, title, plain, one line and count are wired in as
launcher commands; text lists all six. Main reads the clipboard only
when one is run. The row is a label, not a preview, the pet never
repeats the text, and the write is flagged as ours so clipboard
history does not record it.

Help and the fixers match on whole-word starts only. Their long
titles let the scattered-letter matcher swallow ordinary searches:
weather fits inside lowercase the copied text.

39 new sentences in each of the eight languages, and a text icon.
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pixelcat Ready Ready Preview Oct 9, 2026 4:09am UTC

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

CI for d237a89: all jobs passed

Job Result Log
boot (windows-latest) passed open
boot (macos-latest) passed open
test passed open
packaged-boot (windows-latest) passed open
packaged-boot (macos-latest) passed open

Tests: 501 passed, 0 failed, 0 skipped, 501 total.

This comment updates itself on every push. Full run.

…ity fixes

A help example was one weight, so todo call the dentist did not say
which word is the command. Main now sends how many leading characters
are the command and the launcher sets them in mono at full strength,
with the words that are yours quieter. The launcher still decides
nothing by reading a title: it gets a length.

- Section headers, the footer and placeholders used a grey that
  measured 3.86:1 on the dark panel and 2.97:1 on the light one.
  Now 5.33:1 and 4.88:1.
- A row with nothing to run (the todo hint, a bad sum) was drawn as
  selected. It is now a plain hint with an outlined tile.
- The text icon had no colour of its own.
@JOhnsonKC201
JOhnsonKC201 merged commit db5b4fa into main Oct 9, 2026
7 checks passed
@JOhnsonKC201
JOhnsonKC201 deleted the feat/tools-help-textfix branch October 9, 2026 04:39

This branch was successfully deployed

1 active deployment
Preview — d237a896 Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant