Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

feat(desktop): draw the arrow pointer everywhere and drop the pointer style setting

Luis Ortiz9f3a78bdf09d
diff --git a/apps/desktop/scripts/check-pipeline.ts b/apps/desktop/scripts/check-pipeline.ts
index 43a8f6d..256fe30 100644
--- a/apps/desktop/scripts/check-pipeline.ts
+++ b/apps/desktop/scripts/check-pipeline.ts
@@ -94,18 +94,17 @@ app.whenReady().then(async () => {
const results = await ask<CheckResult[]>(win.webContents, 'mimik:check:verify', guideId, 60_000);
const userSettings = loadSettings();
- const clamped = normaliseSettings({ screenshotDelayMs: 5000, cursorStyle: 'wobble' as never });
+ const clamped = normaliseSettings({ screenshotDelayMs: 5000 });
const stored = saveSettings({ screenshotDelayMs: 750, keepClicksBeyondArea: true });
const reloaded = loadSettings();
results.push({
name: 'settings clamp and persist',
ok:
clamped.screenshotDelayMs === 2000 &&
- clamped.cursorStyle === DEFAULT_CAPTURE_SETTINGS.cursorStyle &&
normaliseSettings({ captureMode: 'sideways' as never }).captureMode === DEFAULT_CAPTURE_SETTINGS.captureMode &&
reloaded.screenshotDelayMs === 750 &&
reloaded.keepClicksBeyondArea === stored.keepClicksBeyondArea,
- detail: `5000 ms clamped to ${clamped.screenshotDelayMs}, unknown style fell back to ${clamped.cursorStyle}, 750 ms reloaded as ${reloaded.screenshotDelayMs}`,
+ detail: `5000 ms clamped to ${clamped.screenshotDelayMs}, 750 ms reloaded as ${reloaded.screenshotDelayMs}`,
});
const knobs = normaliseSettings({
@@ -570,7 +569,7 @@ app.whenReady().then(async () => {
detail: `${elapsed} ms for a 400 ms delay`,
});
- settings = { ...REGION_MODE, showCursor: true, cursorStyle: 'arrow', screenshotDelayMs: 0 };
+ settings = { ...REGION_MODE, showCursor: true, screenshotDelayMs: 0 };
await recorder.capture({ x: region.x + 200, y: region.y + 150 });
const cursorSizes = await ask<number[]>(win.webContents, 'mimik:check:renderedSizes', activeGuide, 30_000);
const bare = cursorSizes[cursorSizes.length - 2] ?? 0;
diff --git a/apps/desktop/src/main/capture/recorder.ts b/apps/desktop/src/main/capture/recorder.ts
index 0aaf6dc..4ec9688 100644
--- a/apps/desktop/src/main/capture/recorder.ts
+++ b/apps/desktop/src/main/capture/recorder.ts
@@ -467,7 +467,7 @@ export class DesktopRecorder {
},
...(inputValue === undefined ? {} : { inputValue }),
...(settings.showCursor && action === 'click'
- ? { cursor: { x: local.x, y: local.y, style: settings.cursorStyle, scale } }
+ ? { cursor: { x: local.x, y: local.y, style: 'arrow', scale } }
: {}),
...(settings.zoomLevel === null ? {} : { zoomLevel: settings.zoomLevel }),
});
diff --git a/apps/desktop/src/main/capture/settings.ts b/apps/desktop/src/main/capture/settings.ts
index 5c43279..d7e3583 100644
--- a/apps/desktop/src/main/capture/settings.ts
+++ b/apps/desktop/src/main/capture/settings.ts
@@ -1,13 +1,9 @@
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
-import type { CursorStyle } from '@mimik/core/screenshot/types';
import { app } from 'electron';
-export type { CursorStyle };
export type CaptureMode = 'window' | 'screen' | 'region';
-const EVERY_CURSOR_STYLE: Record<CursorStyle, true> = { arrow: true, hand: true, dot: true };
-export const CURSOR_STYLES = Object.keys(EVERY_CURSOR_STYLE) as CursorStyle[];
export const CAPTURE_MODES: CaptureMode[] = ['window', 'screen', 'region'];
export const MAX_SCREENSHOT_DELAY_MS = 2000;
const MIN_ZOOM = 1;
@@ -25,7 +21,6 @@ export interface CaptureShortcuts {
export interface CaptureSettings {
captureMode: CaptureMode;
showCursor: boolean;
- cursorStyle: CursorStyle;
screenshotDelayMs: number;
keepClicksBeyondArea: boolean;
recordKeys: boolean;
@@ -39,7 +34,6 @@ export interface CaptureSettings {
export const DEFAULT_CAPTURE_SETTINGS: CaptureSettings = {
captureMode: 'window',
showCursor: true,
- cursorStyle: process.platform === 'darwin' ? 'arrow' : process.platform === 'win32' ? 'arrow' : 'dot',
screenshotDelayMs: 0,
keepClicksBeyondArea: false,
recordKeys: true,
@@ -95,9 +89,6 @@ export function normaliseSettings(input: Partial<CaptureSettings> & LegacySettin
? (input.captureMode as CaptureMode)
: DEFAULT_CAPTURE_SETTINGS.captureMode,
showCursor: typeof input.showCursor === 'boolean' ? input.showCursor : DEFAULT_CAPTURE_SETTINGS.showCursor,
- cursorStyle: CURSOR_STYLES.includes(input.cursorStyle as CursorStyle)
- ? (input.cursorStyle as CursorStyle)
- : DEFAULT_CAPTURE_SETTINGS.cursorStyle,
screenshotDelayMs: Number.isFinite(delay) ? Math.min(Math.max(Math.round(delay), 0), MAX_SCREENSHOT_DELAY_MS) : 0,
keepClicksBeyondArea: flag(
input.keepClicksBeyondArea ?? input.captureOutsideClicks,
diff --git a/packages/core/src/screenshot/types.ts b/packages/core/src/screenshot/types.ts
index 8657392..0d1f0bd 100644
--- a/packages/core/src/screenshot/types.ts
+++ b/packages/core/src/screenshot/types.ts
@@ -140,8 +140,6 @@ export type Annotation =
export type CursorStyle = 'arrow' | 'hand' | 'dot';
-export const CURSOR_STYLES: CursorStyle[] = ['arrow', 'hand', 'dot'];
-
export interface CursorMark {
x: number;
y: number;