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(onboarding): open the side panel alongside the dashboard when finishing

Luis Ortiz67d702762e16
diff --git a/src/lib/browser-api.ts b/src/lib/browser-api.ts
index 80654c9..4f5ba8d 100644
--- a/src/lib/browser-api.ts
+++ b/src/lib/browser-api.ts
@@ -116,10 +116,14 @@ export function setSidePanelBehavior(openOnActionClick: boolean): void {
}
export function openSidebar(): void {
- if (import.meta.env.BROWSER === 'firefox') {
- browser.sidebarAction.open();
- } else {
- browser.sidePanel.open({ windowId: chrome.windows.WINDOW_ID_CURRENT });
+ try {
+ if (import.meta.env.BROWSER === 'firefox') {
+ browser.sidebarAction.open()?.catch(() => undefined);
+ } else {
+ browser.sidePanel.open({ windowId: chrome.windows.WINDOW_ID_CURRENT })?.catch(() => undefined);
+ }
+ } catch {
+ return;
}
}
diff --git a/src/ui/onboarding/App.tsx b/src/ui/onboarding/App.tsx
index adc17c9..a390030 100644
--- a/src/ui/onboarding/App.tsx
+++ b/src/ui/onboarding/App.tsx
@@ -5,7 +5,7 @@ import { PRESET_LABELS, type PresetKey } from '@/core/blur/regexes';
import { AI_PROVIDERS, type AIProviderKey } from '@/core/capture/ai/models';
import { AI_LANGUAGES, type AILanguageCode } from '@/core/capture/ai/prompts';
import type { VoiceProvider } from '@/core/capture/voice/transcribe';
-import { localStorage, requestHostPermissions } from '@/lib/browser-api';
+import { localStorage, openSidebar, requestHostPermissions } from '@/lib/browser-api';
import { Input } from '@/ui/components/ui/input';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ui/components/ui/select';
import MicrophonePicker from '@/ui/shared/MicrophonePicker';
@@ -787,6 +787,7 @@ function DoneStep() {
}, []);
const handleOpen = async () => {
+ openSidebar();
const permissionsPromise = requestHostPermissions();
await permissionsPromise;
browser.tabs.create({ url: browser.runtime.getURL('/fullview.html') });