Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Each file has an H1, one paragraph on user-visible behavior, then exactly these
## Features

- [Dictation](./dictation.md): hold the hotkey, speak, release, and the text lands in the focused app. Covers cleanup on and off, Escape, too short, silence, and the Flow Bar states.
- [Style](./style.md): turn cleanup on or off and choose a writing style for each of Personal messages, Work messages, Email, and Other, applied by the app or website you dictate into. The cleanup switch was proven end to end on 2026-10-03; the tabs and the `dictate --app` recipe are not yet run with `voice-verify`.
- [Style](./style.md): turn cleanup on or off and choose a writing style for each of Personal messages, Work messages, Email, and Other, applied by the app or website you dictate into. The cleanup switch was proven end to end on 2026-10-03; the tabs and the `dictate --app` recipe are not yet run with `voice-verify`. The banners were proven on 2026-10-16.
- [Snippets](./snippets.md): save a spoken trigger and the exact text Voice types in its place, then add, edit, validate, and delete snippets from the Snippets page. Add, validate, restart persistence, edit, and delete are proven with `voice-verify`; the dictation step is not yet run.
- [Dictionary](./dictionary.md): save words Voice writes with their saved spelling, ignoring case and accents, and replacements that swap a phrase for saved text, from the Dictionary page. Add, validate, the snippet guard in both directions, edit, and delete are proven with `voice-verify`. The dictation step is not yet run.
- [Insights](./insights.md): words, pace, fixes, streaks, and the daily heatmap from the Insights page, kept across restarts, and cleared from Settings > Data and Privacy. Not yet proven with `voice-verify`.
Expand Down
7 changes: 5 additions & 2 deletions .claude/skills/verify/features/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Style lets a user turn text cleanup on or off and choose how cleaned-up dictatio
## Sub-features

- `style-cleanup-toggle`: the `Clean up text` switch turns cleanup on and off. Turning it off unloads the cleanup model, which then reports `installed`. Turning it on loads the model again.
- `style-tabs`: four tabs, `Personal messages`, `Work messages`, `Email`, and `Other`. Each tab shows a one-line caption naming where it applies and three cards with an example for that category.
- `style-tabs`: four tabs, `Personal messages`, `Work messages`, `Email`, and `Other`. Each tab shows a banner and three cards with an example for that category.
- `style-banners`: each banner reads "This style applies in personal messengers" (workplace messengers, all major email apps, all other apps), then the real icons of the installed built-in apps of that category, up to four, then "+N". Other shows no icons. The list comes from the helper each time the page opens; each icon is rendered the first time a tile shows it, and the tile shows the app's first letter until it arrives.
- `style-pick`: choosing a card on a tab sets that category's style for the next dictation. The other categories keep theirs.
- `style-by-target`: a dictation into Messages uses the Personal style, Slack the Work style, Mail or Gmail in a browser the Email style with the email layout, and anything else the Other style.
- `style-disabled`: with cleanup off, the cards are disabled on every tab and the page explains that the transcript is inserted as recognized.
Expand All @@ -20,7 +21,7 @@ Style lets a user turn text cleanup on or off and choose how cleaned-up dictatio
Preconditions: baseline. Cleanup is on. Personal is Casual and the other three categories are Formal.

- **Open Style.** `vv click Style`, then `vv wait hub 'document.querySelector("main h1")?.textContent === "Style"'`. Then `vv shot style-before`. The `Personal messages` tab is selected.
- **Switch tabs.** `vv click "Work messages"`, then `vv wait hub 'document.querySelector("[role=tab][aria-selected=true]")?.textContent === "Work messages"'`. The caption reads "Used in workplace messengers like Slack and Teams."
- **Switch tabs.** `vv click "Work messages"`, then `vv wait hub 'document.querySelector("[role=tab][aria-selected=true]")?.textContent === "Work messages"'`. The banner reads "This style applies in workplace messengers" and shows the icons of the installed workplace messengers, such as Slack and Microsoft Teams.
- **Pick a style.** On the Work tab, `vv click "Casual"`, then `vv wait hub 'window.voice.getSnapshot().then(s => s.settings.cleanup.styles.work === "casual")'`. Only the active tab's cards are mounted, so a card title is unique. Then `vv click "Personal messages"` and `vv click "Very casual"`, and wait for `s.settings.cleanup.styles.personal === "veryCasual"`. Email and Other stay `formal`.
- **Stored value.** `cat "<userData>/settings.json"` shows `"cleanup"` with `"styles": { "personal": "veryCasual", "work": "casual", "email": "formal", "other": "formal" }` and `"assignments": []`.
- **Style by target.** With the styles above, run `vv dictate short.wav` once with each `--app`. Every run ends with `outcome.kind` `inserted`.
Expand All @@ -34,6 +35,8 @@ Preconditions: baseline. Cleanup is on. Personal is Casual and the other three c

## Gotchas

- The banner icons come from the real `/Applications`, `/System/Applications` and `~/Applications` of the Mac running the instance, so which icons show depends on what that Mac has installed. Each icon's accessible name is the app name: `[...document.querySelectorAll("[role=tabpanel] img, [role=tabpanel] [role=img]")].map(e => e.alt || e.getAttribute("aria-label"))`.

- The switch's accessible name comes from its `<label>`, `Clean up text`. Tabs are named by their labels, and cards by their titles within the active tab.
- The email layout applies only when the dictation has 10 or more words and fits in one cleanup chunk. Shorter dictations into Mail get the Email style on one line. `short.wav` has 17 words.
- The email layout comes from the cleanup model, so the exact line breaks can vary. Check that the greeting is on its own line, not the full text.
Expand Down
27 changes: 24 additions & 3 deletions apps/desktop/src/main/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe("startHelper", () => {
const h = boot({ transcript: "call ada tomorrow", startMs: 20 });
helper = h.helper;
await h.waitFor((e) => e.type === "asr.status");
expect(h.of("ready")[0]?.event).toEqual({ type: "ready", version: 11 });
expect(h.of("ready")[0]?.event).toEqual({ type: "ready", version: 12 });
expect(h.of("log").map((e) => e.event.message)).toContain("hotkey configured: fn");
expect(h.of("permissions")[0]?.event).toEqual({
type: "permissions",
Expand Down Expand Up @@ -203,12 +203,12 @@ describe("startHelper", () => {
helper = h.helper;
await expect
.poll(() => h.logs.join("\n"))
.toMatch(/helper: speaks protocol v2 but this build expects v11; refusing/);
.toMatch(/helper: speaks protocol v2 but this build expects v12; refusing/);
expect(h.entries).toEqual([
{
message: "helper protocol mismatch",
level: "fatal",
attributes: { "helper.protocol_version": 2, "helper.expected_version": 11 },
attributes: { "helper.protocol_version": 2, "helper.expected_version": 12 },
},
]);
await sleep(RESTART_MIN_MS + 150);
Expand Down Expand Up @@ -297,6 +297,27 @@ describe("startHelper", () => {
await expect.poll(() => h.exits.length).toBeGreaterThanOrEqual(1);
});

test("lists fixture apps with a browser flag and answers an icon render by its id", async () => {
const h = boot();
helper = h.helper;
await h.waitFor((e) => e.type === "asr.status");
h.helper.send({ type: "apps.list" });
await h.waitFor((e) => e.type === "apps.listed");
const apps = h.of("apps.listed")[0]?.event.apps ?? [];
expect(apps.map(({ bundleId, browser }) => [bundleId, browser])).toEqual([
["com.apple.MobileSMS", false],
["com.tinyspeck.slackmacgap", false],
["com.google.Chrome", true],
]);
h.helper.send({ type: "icons.render", id: "7", paths: apps.map(({ path }) => path) });
await h.waitFor((e) => e.type === "icons.rendered");
expect(h.of("icons.rendered")[0]?.event).toEqual({
type: "icons.rendered",
id: "7",
icons: [],
});
});

test("drops commands while the helper is down instead of throwing", async () => {
const h = boot({ script: [{ at: 10, action: "exit" }] });
helper = h.helper;
Expand Down
10 changes: 10 additions & 0 deletions apps/desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
type SettingsPatch,
VOICE_URL_SCHEME,
} from "../shared/api.ts";
import { parseBundleIds } from "../shared/app-categories.ts";
import { wantsCleanup } from "../shared/dictation-language.ts";
import { copyText, parseHistoryRetention } from "../shared/history.ts";
import { models, type Model, type ModelId } from "../shared/models.ts";
Expand All @@ -56,6 +57,7 @@ import { startHelper, type Helper } from "./helper.ts";
import { hubMinimumSize, hubWindowSize } from "./hub-window.ts";
import { createHistory } from "./history.ts";
import { createInsights } from "./insights.ts";
import { createInstalledApps, type InstalledApps } from "./installed-apps.ts";
import type { Commands } from "./ipc.ts";
import { denyPermissions, lockNavigation, pageUrl, type Page } from "./lockdown.ts";
import { createApplicationMenu } from "./menu.ts";
Expand Down Expand Up @@ -336,6 +338,7 @@ async function main() {

let dictation: Dictation;
let microphoneTest: MicrophoneTest;
let installedApps: InstalledApps;
const helper: Helper = startHelper({
binary: helperBinary(),
modelsDir,
Expand All @@ -345,6 +348,7 @@ async function main() {
if (lifecycle !== "running") return;
dictation.onHelperEvent(event);
microphoneTest.onHelperEvent(event);
installedApps.onHelperEvent(event);
},
onExit: (exit) => {
if (lifecycle === "running") {
Expand Down Expand Up @@ -423,6 +427,8 @@ async function main() {
},
});

installedApps = createInstalledApps({ send: helper.send });

const updates = createUpdates({
loadEngine:
store.state.updates.status.kind === "disabled"
Expand Down Expand Up @@ -800,6 +806,10 @@ async function main() {
hubCommands.handle(Channel.cancelAccountDeletion, () => account.cancelDeletion());
hubCommands.handle(Channel.retryAccountDeletion, () => account.retryDeletion());
hubCommands.handle(Channel.getInsights, () => insights.get());
hubCommands.handle(Channel.getInstalledApps, () => installedApps.list());
hubCommands.handle(Channel.getAppIcons, (_event, raw: unknown) =>
installedApps.icons(parseBundleIds(raw)),
);
hubCommands.handle(Channel.clearInsights, async () => {
try {
await insights.clear();
Expand Down
Loading
Loading