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): name the mode while recording and rest the mascot when paused

Luis Ortizd9cfd7f20af1
diff --git a/apps/desktop/scripts/check-overlay.ts b/apps/desktop/scripts/check-overlay.ts
index b081129..e6bb5a0 100644
--- a/apps/desktop/scripts/check-overlay.ts
+++ b/apps/desktop/scripts/check-overlay.ts
@@ -201,6 +201,24 @@ app.whenReady().then(async () => {
idle.tip === 'Your first click will show up here.' && idle.hint === 'Tip: you can press Alt+Shift+C to capture without clicking.',
`tip: ${idle.tip}, hint: ${idle.hint}`,
);
+ const badgeWhileRecording = await card("badge: !document.querySelector('#badge').hidden && document.querySelector('#badge').textContent");
+ overlay.pause();
+ await settle();
+ const resting = await card(
+ "tip: document.querySelector('#tip').textContent, intro: !document.querySelector('#intro').hidden, resting: document.body.classList.contains('resting'), hint: document.querySelector('#keyHint').hidden",
+ );
+ overlay.record();
+ await settle();
+ check(
+ 'recording names its mode, and an empty pause is not a blank card',
+ typeof badgeWhileRecording.badge === 'string' &&
+ badgeWhileRecording.badge.length > 0 &&
+ resting.tip === 'Nothing is recorded while paused.' &&
+ resting.intro === true &&
+ resting.resting === true &&
+ resting.hint === true,
+ `badge ${badgeWhileRecording.badge}, paused tip ${resting.tip}, mascot shown ${resting.intro}`,
+ );
overlay.showStep({ id: 'one', index: 1, title: 'Click "Save"', src, source: 'heuristic', pending: false, app: 'Explorer' });
await settle();
diff --git a/apps/desktop/src/renderer/overlay.css b/apps/desktop/src/renderer/overlay.css
index 26cf46f..32cbe85 100644
--- a/apps/desktop/src/renderer/overlay.css
+++ b/apps/desktop/src/renderer/overlay.css
@@ -546,6 +546,27 @@ body.controls .flash {
animation: camflash 3s ease infinite;
}
+body.controls.resting #mascot svg {
+ animation: rest 3.2s ease-in-out infinite;
+}
+
+body.controls.resting .flash {
+ animation: none;
+ opacity: 0;
+}
+
+@keyframes rest {
+ 0%,
+ 100% {
+ transform: translateY(0);
+ opacity: 0.7;
+ }
+ 50% {
+ transform: translateY(-4px);
+ opacity: 1;
+ }
+}
+
@keyframes camflash {
0%,
88%,
diff --git a/apps/desktop/src/renderer/overlay/controls.ts b/apps/desktop/src/renderer/overlay/controls.ts
index d0a4097..03adf21 100644
--- a/apps/desktop/src/renderer/overlay/controls.ts
+++ b/apps/desktop/src/renderer/overlay/controls.ts
@@ -89,11 +89,13 @@ export function controls(): void {
const recording = state === 'recording';
const paused = state === 'paused';
const waiting = recording && !step && !busy;
+ const resting = paused && !step && !busy;
const pending = Boolean(step?.pending);
document.body.setAttribute('data-state', state);
document.body.classList.toggle('collapsed', collapsed);
- document.body.classList.toggle('waiting', waiting);
+ document.body.classList.toggle('waiting', waiting || resting);
+ document.body.classList.toggle('resting', resting);
document.body.classList.toggle('busy', busy);
label.textContent = starting ? 'Starting…' : recording ? 'Recording' : paused ? 'Paused' : 'Ready';
@@ -107,7 +109,7 @@ export function controls(): void {
const shown = MODES.find((candidate) => candidate.id === modeId) ?? MODES[0];
badge.replaceChildren(icon(shown.glyph, 12), shown.label);
}
- badge.hidden = !armed;
+ badge.hidden = paused || collapsed;
pillWriting.hidden = !(collapsed && pending);
const chevron = collapsed ? 'up' : 'down';
@@ -138,13 +140,17 @@ export function controls(): void {
source.className = step?.source === 'ai' ? 'ai' : 'basic';
metaText.textContent = [step ? `Step ${step.index}` : '', step?.app ?? ''].filter(Boolean).join(' · ');
- intro.hidden = !(armed || waiting);
- tip.textContent = armed ? 'Each click is saved as a step.' : 'Your first click will show up here.';
+ intro.hidden = !(armed || waiting || resting);
+ tip.textContent = armed
+ ? 'Each click is saved as a step.'
+ : resting
+ ? 'Nothing is recorded while paused.'
+ : 'Your first click will show up here.';
const key = armed ? shortcuts.startStop : shortcuts.capture;
- hint.hidden = intro.hidden || !key;
+ hint.hidden = intro.hidden || resting || !key;
hintKey.textContent = key ?? '';
hintText.textContent = armed ? ' to start and stop.' : ' to capture without clicking.';
- body.hidden = collapsed || (paused && !step);
+ body.hidden = collapsed;
modes.hidden = collapsed || !paused;
for (const button of modeButtons) button.classList.toggle('active', button.dataset.mode === modeId);