feat(machine): hide debug toggle in production, default to Catppuccin light
- Debug toggle button only shown when allowMockFallback is true - Electron defaults to Catppuccin Latte (light) instead of Gruvbox dark - Browser dev mode keeps Gruvbox dark as default Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cb33689774
commit
a6d69a385c
2 changed files with 6 additions and 4 deletions
|
|
@ -23,6 +23,8 @@ const MODE_KEY = 'lamassu-color-mode'
|
||||||
const current = ref<ThemeId>(loadTheme())
|
const current = ref<ThemeId>(loadTheme())
|
||||||
const colorMode = ref<ColorMode>(loadColorMode())
|
const colorMode = ref<ColorMode>(loadColorMode())
|
||||||
|
|
||||||
|
const isElectron = !!(window as Record<string, unknown>).electronAPI
|
||||||
|
|
||||||
function loadTheme(): ThemeId {
|
function loadTheme(): ThemeId {
|
||||||
try {
|
try {
|
||||||
const stored = localStorage.getItem(THEME_KEY)
|
const stored = localStorage.getItem(THEME_KEY)
|
||||||
|
|
@ -32,7 +34,7 @@ function loadTheme(): ThemeId {
|
||||||
} catch {
|
} catch {
|
||||||
// localStorage unavailable (e.g. SSR)
|
// localStorage unavailable (e.g. SSR)
|
||||||
}
|
}
|
||||||
return 'gruvbox'
|
return isElectron ? 'catppuccin' : 'gruvbox'
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadColorMode(): ColorMode {
|
function loadColorMode(): ColorMode {
|
||||||
|
|
@ -44,7 +46,7 @@ function loadColorMode(): ColorMode {
|
||||||
} catch {
|
} catch {
|
||||||
// localStorage unavailable
|
// localStorage unavailable
|
||||||
}
|
}
|
||||||
return 'dark'
|
return isElectron ? 'light' : 'dark'
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyTheme(id: ThemeId) {
|
function applyTheme(id: ThemeId) {
|
||||||
|
|
|
||||||
|
|
@ -197,9 +197,9 @@ function handleCashOut() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Debug toggle (only visible when debug bar is hidden) -->
|
<!-- Debug toggle (only visible when debug bar is hidden, never in production) -->
|
||||||
<Button
|
<Button
|
||||||
v-if="!atmStore.debugMode"
|
v-if="!atmStore.debugMode && atmStore.allowMockFallback"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="absolute bottom-4 right-4 text-xs text-muted-foreground"
|
class="absolute bottom-4 right-4 text-xs text-muted-foreground"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue