-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: keystroke overlay (record keys + built-in "Keystrokes" extension) #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,9 @@ import { | |
| startCursorSampling, | ||
| stopCursorCapture, | ||
| writeCursorTelemetry, | ||
| loadKeystrokeTelemetry, | ||
| saveKeystrokeTelemetry, | ||
| resetKeystrokeTelemetry, | ||
| } from "../cursor/telemetry"; | ||
| import { getFfmpegBinaryPath } from "../ffmpeg/binary"; | ||
| import { | ||
|
|
@@ -997,6 +1000,12 @@ export function registerRecordingHandlers( | |
| } catch (error) { | ||
| console.warn("Failed to persist cursor telemetry during native stop:", error); | ||
| } | ||
| try { | ||
| await saveKeystrokeTelemetry(finalVideoPath); | ||
| } catch (error) { | ||
| console.warn("Failed to persist keystroke telemetry during native stop:", error); | ||
| } | ||
| resetKeystrokeTelemetry(); | ||
|
Comment on lines
+1003
to
+1008
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reset timing in Windows stop flow can delete the just-saved keystroke sidecar. Line 1008 clears keystrokes before the later Suggested direction try {
await saveKeystrokeTelemetry(finalVideoPath);
} catch (error) {
console.warn("Failed to persist keystroke telemetry during native stop:", error);
}
- resetKeystrokeTelemetry();
+ // Defer keystroke reset until finalizeStoredVideo() after mux/finalization.Also add a reset in terminal failure exits that do not reach 🤖 Prompt for AI Agents |
||
|
|
||
| return { success: true, path: finalVideoPath }; | ||
| } catch (error) { | ||
|
|
@@ -1893,6 +1902,20 @@ export function registerRecordingHandlers( | |
| } | ||
| }); | ||
|
|
||
| ipcMain.handle("get-keystroke-telemetry", async (_, videoPath?: string) => { | ||
| const targetVideoPath = normalizeVideoSourcePath(videoPath ?? currentVideoPath); | ||
| if (!targetVideoPath) { | ||
| return { success: true, events: [] }; | ||
| } | ||
| try { | ||
| const events = await loadKeystrokeTelemetry(targetVideoPath); | ||
| return { success: true, events }; | ||
| } catch (error) { | ||
| console.error("Failed to load keystroke telemetry:", error); | ||
| return { success: false, events: [], error: String(error) }; | ||
| } | ||
| }); | ||
|
|
||
| ipcMain.handle( | ||
| "set-cursor-telemetry", | ||
| async (_, videoPath: string | undefined, samples: CursorTelemetryPoint[]) => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tighten modifier element validation in loader.
Line 376 only checks that
modifiersis an array; non-string elements still pass and can propagate malformed telemetry across the IPC boundary.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents