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
1 change: 1 addition & 0 deletions .claude/skills/verify/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Each file has an H1, one paragraph on user-visible behavior, then exactly these
- [Style](./style.md): turn cleanup on or off and choose the writing style. Proven end to end on 2026-10-03, when this skill was generated.
- [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`.
- [Last dictation](./last-dictation.md): view and copy the last transcript, raw or cleaned, from Home or the tray.
- [Models](./models.md): see, install, and uninstall the speech and cleanup models from Settings > Models and the Home checklist.
- [Settings](./settings.md): General, System, Shortcuts, and Data and Privacy controls.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/dictionary.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Dictionary lets a user save words and replacements. A word, such as "Worcest
## How to get to it (user POV)

- Voice window sidebar: `Dictionary`, after Snippets.
- Keyboard: Cmd-4 in the Voice nav.
- Keyboard: Cmd-5 in the Voice nav.

## Driving it with voice-verify

Expand Down
36 changes: 36 additions & 0 deletions .claude/skills/verify/features/insights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Insights

The Insights page shows how much a user dictates: words dictated, speaking pace in WPM, fixes made by Voice, the current and longest streak of days with dictation, and a heatmap of words per day that ends today. It counts every session that produced a transcript and ended `inserted` or `notInserted`. A cancelled, too short, or silent session counts nothing. Words come from the raw transcript, so a snippet counts its spoken trigger, not its expansion. Pace leaves out the quiet before and after the user speaks. Counts stay on this Mac in `<userData>/insights.json`, which holds numbers and dates, never dictated words. A user can clear them from Settings.

## Sub-features

- `insights-totals`: the Words, Pace, and Fixes made by Voice cards. Pace says "Dictate to see how fast you speak." until the first counted session. Fixes says "None yet" at zero, and otherwise lists `Words corrected` and `Dictionary fixes`.
- `insights-streak`: the Streak card shows current and longest days. A day with no words yet keeps yesterday's streak.
- `insights-heatmap`: one cell per day, Sunday to Saturday per column, with as many weeks as fit, up to 53. Hovering or focusing a cell shows "<n> words on <weekday, month day>". Tab reaches one cell, today's or the one last focused. Up and Down move a day, Left and Right a week, Home goes to the first day, and End goes to today.
- `insights-live`: an open page updates after each counted session, without a reload.
- `insights-persist`: counts survive a restart.
- `insights-clear`: Settings > Data and Privacy > `Clear…` asks "Clear insights?" and, after `Clear`, deletes the file and resets an open Insights page to zero.

## How to get to it (user POV)

- Voice window sidebar: `Insights`, after Home.
- Keyboard: Cmd-2 in the Voice nav.
- Clearing: Voice window > `Settings` > `Data and Privacy` > Insights > `Clear…`.

## Driving it with voice-verify

Preconditions: baseline on a fresh userData, so the page starts at zero. `dictate` needs the desktop to itself.

- **Open Insights.** `vv click Insights`, then `vv wait hub 'document.querySelector("main h1")?.textContent === "Insights"'`. Then `vv shot insights-empty`. Words reads 0, Pace shows the "Dictate to see" line, and Fixes reads "None yet".
- **Count a session.** `vv dictate short.wav`. Then `vv wait hub 'window.voice.getInsights().then(i => Object.keys(i.days).length === 1)'` and `vv shot insights-counted`. Words equals the word count of `last.raw` from the `dictate` output, Pace shows a WPM, and the current streak is 1 day. Run `vv dictate long.wav` with the page open: Words grows without a reload, and with cleanup on, Words corrected is above zero because cleanup drops "um" and "uh".
- **Stored value.** `cat "<userData>/insights.json"` has `"version": 1`, today's date under `"days"`, and none of the dictated words.
- **Heatmap by keyboard.** `voice-verify` cannot press keys, so check the parts it can reach. `vv eval hub 'document.querySelectorAll("[aria-label=\"Words per day\"] [tabindex=\"0\"]").length'` prints 1, and that cell's `aria-label` names today. Focus it with `.focus()`, then dispatch a bubbling `keydown` with `key: "ArrowLeft"` on `document.activeElement`. The new `document.activeElement` names the same weekday a week earlier. The tooltip opens only on keyboard focus, so a human checks it with Tab.
- **Persistence.** `vv stop --keep-user-data`, then `vv launch --keep-user-data`, then open Insights. The totals match the earlier shot.
- **Clear.** `vv click Settings`, `vv click "Data and Privacy"`, `vv click "Clear…"`, then `vv click Clear`. `ls "<userData>/insights.json"` fails. Click `Back`, then `Insights`, and the page shows zeros. `vv dictate short.wav` afterwards counts from zero.
- **Clear resets an open page.** The Settings path leaves Insights, so with Insights open, run `vv eval hub 'window.voice.clearInsights().then(() => true)'`. The open page drops to zero without a reload.

## Gotchas

- The page reads today's date on each render. A hub left open overnight moves to the new day on the next dictation or when the window regains focus.
- A file Voice cannot read is left alone and nothing is counted until it is cleared. A failed save is logged, and the page still shows the in-memory count.
- The heatmap is hidden until the page knows its width, so wait for the grid before a shot.
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Settings

Settings holds the controls that aren't about style. General has the microphone and its test, the dictation language, copying the transcript to the clipboard, and the update channel. System has open at login, muting while dictating, theme, Show in Dock, and the always-visible Flow Bar. Shortcuts has the hold-to-talk key. Data and Privacy has crash reporting.
Settings holds the controls that aren't about style. General has the microphone and its test, the dictation language, copying the transcript to the clipboard, and the update channel. System has open at login, muting while dictating, theme, Show in Dock, and the always-visible Flow Bar. Shortcuts has the hold-to-talk key. Data and Privacy has crash reporting and clearing Insights.

## Sub-features

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Snippets let a user save a spoken trigger, such as "my email", and the exact tex
## How to get to it (user POV)

- Voice window sidebar: `Snippets`, after Style.
- Keyboard: Cmd-3 in the Voice nav.
- Keyboard: Cmd-4 in the Voice nav.

## Driving it with voice-verify

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/verify/features/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Style lets a user turn text cleanup on or off and choose how cleaned-up dictatio
## How to get to it (user POV)

- Voice window sidebar: `Style`.
- Keyboard: Cmd-2 in the Voice nav jumps to the second sidebar item.
- Keyboard: Cmd-3 in the Voice nav jumps to the third sidebar item.

## Driving it with voice-verify

Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/main/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ describe("createAccount", () => {
onLevel: () => {},
log: () => {},
onSessionDone: () => {},
onDictated: () => {},
copy: () => {},
});
// The same wiring as index.ts: only a callback that changed the account shows the hub.
Expand Down Expand Up @@ -637,6 +638,7 @@ describe("createAccount", () => {
text: "hello world",
audioMs: 800,
asrMs: 1,
speechMs: 600,
});
await flush();
expect(shownDuring).toEqual([]);
Expand Down Expand Up @@ -678,6 +680,7 @@ describe("createAccount", () => {
onLevel: () => {},
log: () => {},
onSessionDone: () => {},
onDictated: () => {},
copy: () => {},
});

Expand Down
10 changes: 10 additions & 0 deletions apps/desktop/src/main/atomic-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { mkdir, rename, writeFile } from "node:fs/promises";
import * as NodePath from "node:path";

export async function writeFileAtomic(file: string, text: string): Promise<void> {
await mkdir(NodePath.dirname(file), { recursive: true });
const temp = `${file}.${process.pid}.tmp`;
// Without the flush, a power loss can land the rename before the data and leave an empty file.
await writeFile(temp, text, { flush: true });
await rename(temp, file);
}
10 changes: 9 additions & 1 deletion apps/desktop/src/main/cleanup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ describe("followSettings", () => {
onLevel: () => {},
log: () => {},
onSessionDone: () => {},
onDictated: () => {},
copy: () => {},
now: () => clock,
});
Expand All @@ -640,7 +641,14 @@ describe("followSettings", () => {
const finish = (id: string, text: string) => {
clock += 800;
dictation.onHelperEvent({ type: "hotkey", action: "up" });
dictation.onHelperEvent({ type: "transcript", id, text, audioMs: 800, asrMs: 100 });
dictation.onHelperEvent({
type: "transcript",
id,
text,
audioMs: 800,
asrMs: 100,
speechMs: 600,
});
};
return { store, cleanup, commands, dictation, setLanguage, record, finish };
}
Expand Down
10 changes: 9 additions & 1 deletion apps/desktop/src/main/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ function harness(initial: DiagnosticsConsent, dsn = DSN, tracesSampleRate = 1) {
onLevel: () => {},
log: () => {},
onSessionDone: diagnostics.sessionDone,
onDictated: () => {},
copy: () => {},
now: () => clock,
});
Expand All @@ -183,7 +184,14 @@ function harness(initial: DiagnosticsConsent, dsn = DSN, tracesSampleRate = 1) {
dictation.onHelperEvent({ type: "capture.started", id, startMs: 40 });
clock += 800;
dictation.onHelperEvent({ type: "hotkey", action: "up" });
dictation.onHelperEvent({ type: "transcript", id, text: RAW, audioMs: 800, asrMs: 120 });
dictation.onHelperEvent({
type: "transcript",
id,
text: RAW,
audioMs: 800,
asrMs: 120,
speechMs: 600,
});
await expect.poll(() => store.state.session.phase).toBe("inserting");
clock += 30;
dictation.onHelperEvent({ type: "insert.result", id, method: "paste", reason: null });
Expand Down
Loading
Loading