client: show build version + browser diagnostics for bug triage
Fixes #68. - Bar switcher and stats page get a low-contrast "wutzcalc <git-sha>" footer at the bottom (VersionFooter component, shared). - Admin panel gets a fuller Diagnose section: version, user agent, screen resolution + device pixel ratio, viewport size, browser language. Version is the short git commit sha, baked in at build time via vite.config.ts define (falls back to "dev" if .git is unavailable at build time, e.g. a tarball/CI-artifact deploy) - matches how deploys actually run (pnpm build from a git checkout, per deploy/wutzcalc.service), but stays defensive rather than failing the build. pnpm --filter client typecheck and build both clean.
This commit is contained in:
parent
f838db0663
commit
09e1bec9bb
7 changed files with 96 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { useState } from 'preact/hooks';
|
||||
import type { Bar } from '@wutzcalc/shared';
|
||||
import { getTheme, setTheme } from '../api';
|
||||
import { VersionFooter } from '../VersionFooter';
|
||||
|
||||
interface Props {
|
||||
bars: Bar[] | null;
|
||||
|
|
@ -35,6 +36,7 @@ export function BarPicker({ bars, onPick }: Props) {
|
|||
<button class="theme-toggle" onClick={toggleTheme}>
|
||||
{theme === 'dark' ? '☀ Heller Modus' : '🌙 Dunkler Modus'}
|
||||
</button>
|
||||
<VersionFooter />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue