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 📖

fix(guideme): clear a stale roadblock across page loads and drop the extra button

Luis Ortizcce7d98b296f
diff --git a/src/core/guideme/content.ts b/src/core/guideme/content.ts
index ca4ea4b..59e9dad 100644
--- a/src/core/guideme/content.ts
+++ b/src/core/guideme/content.ts
@@ -17,7 +17,6 @@ export class GuideMeController {
private currentTarget: HTMLElement | null = null;
private currentStepIndex = -1;
private watchTimer: ReturnType<typeof setInterval> | null = null;
- private blocked: number | null = null;
constructor() {
if (window.self !== window.top) return;
@@ -58,7 +57,6 @@ export class GuideMeController {
this.stopWatching();
this.removeActionDetection();
this.destroyOverlay();
- this.blocked = null;
return;
}
@@ -97,8 +95,6 @@ export class GuideMeController {
}
private setBlocked(stepIndex: number | null) {
- if (this.blocked === stepIndex) return;
- this.blocked = stepIndex;
browser.storage.local
.set({ [BLOCKED_KEY]: stepIndex })
.catch((err) => logger.warn('Failed to flag guide me roadblock', err));
diff --git a/src/locales/en.yml b/src/locales/en.yml
index 7064f7d..5ea4c93 100644
--- a/src/locales/en.yml
+++ b/src/locales/en.yml
@@ -46,11 +46,11 @@ guideme:
live: Live
roadblock: "We hit a roadblock. Try taking action on the screen to move forward."
manualStep: "This step was edited, so it cannot be detected automatically. Mark it complete when you are done."
- markComplete: "Mark as complete"
stepOf: "Step $1 of $2"
noDescription: No description
prev: Prev
next: Next
+ finish: "Finish"
exitTitle: Heading out?
exitMessage: Your walkthrough will stop and the page overlay will be removed.
stay: Stay
diff --git a/src/locales/es.yml b/src/locales/es.yml
index cd0c95d..341d4b5 100644
--- a/src/locales/es.yml
+++ b/src/locales/es.yml
@@ -46,11 +46,11 @@ guideme:
live: En vivo
roadblock: "Nos encontramos con un obstáculo. Actúa en la pantalla para avanzar."
manualStep: "Este paso fue editado, así que no se puede detectar automáticamente. Márcalo como completado cuando termines."
- markComplete: "Marcar como completado"
stepOf: "Paso $1 de $2"
noDescription: Sin descripción
prev: Anterior
next: Siguiente
+ finish: "Finalizar"
exitTitle: "¿Ya te vas?"
exitMessage: Se detendrá el recorrido y se quitará la guía de la página.
stay: Quedarme
diff --git a/src/locales/fr.yml b/src/locales/fr.yml
index ec0ba92..a0518c4 100644
--- a/src/locales/fr.yml
+++ b/src/locales/fr.yml
@@ -46,11 +46,11 @@ guideme:
live: En direct
roadblock: "Nous avons rencontré un obstacle. Agissez à l'écran pour continuer."
manualStep: "Cette étape a été modifiée, elle ne peut donc pas être détectée automatiquement. Marquez-la comme terminée une fois faite."
- markComplete: "Marquer comme terminé"
stepOf: "Étape $1 sur $2"
noDescription: Aucune description
prev: "Préc."
next: Suiv.
+ finish: "Terminer"
exitTitle: "Vous partez déjà ?"
exitMessage: "La visite guidée va s'arrêter et le calque sera retiré de la page."
stay: Rester
diff --git a/src/locales/pt-BR.yml b/src/locales/pt-BR.yml
index 40eb7ff..043e442 100644
--- a/src/locales/pt-BR.yml
+++ b/src/locales/pt-BR.yml
@@ -46,11 +46,11 @@ guideme:
live: Ao vivo
roadblock: "Encontramos um obstáculo. Aja na tela para avançar."
manualStep: "Esta etapa foi editada, então não pode ser detectada automaticamente. Marque como concluída quando terminar."
- markComplete: "Marcar como concluído"
stepOf: "Passo $1 de $2"
noDescription: Sem descrição
prev: Anterior
next: Próximo
+ finish: "Concluir"
exitTitle: "Vai sair?"
exitMessage: O passo a passo vai parar e o destaque vai sumir da página.
stay: Ficar
diff --git a/src/ui/sidepanel/GuideMeView.tsx b/src/ui/sidepanel/GuideMeView.tsx
index 9908eea..21fbf9b 100644
--- a/src/ui/sidepanel/GuideMeView.tsx
+++ b/src/ui/sidepanel/GuideMeView.tsx
@@ -191,19 +191,10 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
)}
{isBlocked && (
- <div className="mx-4 mb-3 rounded-lg bg-secondary p-3">
- <p className="flex items-start gap-2 text-[12px] leading-relaxed text-foreground">
- <TriangleAlert size={14} className="shrink-0 mt-0.5 text-accent" />
- {isManualStep ? i18n.t('guideme.manualStep') : i18n.t('guideme.roadblock')}
- </p>
- <button
- onClick={() => sendMessage('guideMeStepCompleted', { stepIndex: activeStepIndex }).catch(() => {})}
- className="mt-2.5 flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-[12px] font-semibold text-foreground hover:border-accent hover:text-accent transition-colors"
- >
- <Check size={13} strokeWidth={3} />
- {i18n.t('guideme.markComplete')}
- </button>
- </div>
+ <p className="mx-4 mb-3 flex items-start gap-2 rounded-lg bg-secondary p-3 text-[12px] leading-relaxed text-foreground">
+ <TriangleAlert size={14} className="shrink-0 mt-0.5 text-accent" />
+ {isManualStep ? i18n.t('guideme.manualStep') : i18n.t('guideme.roadblock')}
+ </p>
)}
<div className="flex items-center justify-between px-4 pb-3">
@@ -216,11 +207,20 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
{i18n.t('guideme.prev')}
</button>
<button
- onClick={() => setViewedStepIndex((i) => Math.min(totalSteps - 1, i + 1))}
- disabled={viewedStepIndex === totalSteps - 1}
+ onClick={() => {
+ if (viewedStepIndex === activeStepIndex) {
+ sendMessage('guideMeStepCompleted', { stepIndex: activeStepIndex }).catch(() => {});
+ }
+ if (viewedStepIndex < totalSteps - 1) {
+ setViewedStepIndex((i) => i + 1);
+ }
+ }}
+ disabled={viewedStepIndex === totalSteps - 1 && viewedStepIndex !== activeStepIndex}
className="flex items-center gap-1 text-xs font-medium text-purple hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed"
>
- {i18n.t('guideme.next')}
+ {viewedStepIndex === totalSteps - 1 && viewedStepIndex === activeStepIndex
+ ? i18n.t('guideme.finish')
+ : i18n.t('guideme.next')}
<ChevronRight size={14} />
</button>
</div>