Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 42 additions & 20 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
import {
AlertCircle,
Aperture,
ArrowUpRight,
ChevronDown,
Cpu,
FlaskConical,
Expand Down Expand Up @@ -448,44 +449,47 @@ export const App: React.FC = () => {
}`}
>
{/* Top 44px Precision Command Bar */}
<header className="topbar">
<div className="topbar-inner">
<header className="topbar max-md:h-auto!">
<div className="topbar-inner max-md:h-auto! max-md:flex-wrap max-md:py-1.5! max-md:gap-y-1.5!">
{/* Left: Brand + Mode Tabs */}
<div className="flex items-center gap-3 min-w-0">
<div className="brand-cluster">
<div className="flex items-center gap-3 max-sm:gap-2 min-w-0 md:shrink-0 max-md:w-full max-md:justify-between">
<div className="brand-cluster overflow-hidden shrink-0">
<div className="aperture-mark" aria-hidden="true">
<Aperture size={15} strokeWidth={1.9} />
</div>
<h1 className="brand-title">
<span>collima</span>
<span className="hidden md:inline text-xs font-normal text-[var(--text-muted)] tracking-normal">
<span className="hidden xl:inline text-xs font-normal text-[var(--text-muted)] tracking-normal">
{t.brandSubtitle}
</span>
</h1>
</div>

<span className="brand-divider hidden sm:block" />
<span className="brand-divider hidden sm:block max-sm:hidden!" />

<nav aria-label={t.navAriaLabel} className="segmented-control">
<nav
aria-label={t.navAriaLabel}
className="segmented-control min-w-0"
>
<button
id="tab-tilt-inspector"
type="button"
onClick={() => setMode('tilt')}
className={`segmented-btn ${mode === 'tilt' ? 'is-active' : ''}`}
className={`segmented-btn max-sm:px-2! ${mode === 'tilt' ? 'is-active' : ''}`}
>
<Aperture size={13} className="mode-indicator" />
<span>{t.tabTiltLabel}</span>
<span className="kbd-hint hidden sm:inline-flex">1</span>
<Aperture size={13} className="mode-indicator shrink-0" />
<span className="truncate">{t.tabTiltLabel}</span>
<span className="kbd-hint max-lg:hidden!">1</span>
</button>
<button
id="tab-sensor-noise-lab"
type="button"
onClick={() => setMode('noise')}
className={`segmented-btn ${mode === 'noise' ? 'is-active' : ''}`}
className={`segmented-btn max-sm:px-2! ${mode === 'noise' ? 'is-active' : ''}`}
>
<FlaskConical size={13} className="mode-indicator" />
<span>{t.tabNoiseLabel}</span>
<span className="kbd-hint hidden sm:inline-flex">2</span>
<FlaskConical size={13} className="mode-indicator shrink-0" />
<span className="truncate">{t.tabNoiseLabel}</span>
<span className="kbd-hint max-lg:hidden!">2</span>
</button>
</nav>
</div>
Expand All @@ -508,18 +512,20 @@ export const App: React.FC = () => {
)}

{/* Right: Contextual Actions, Presets, Theme & Locale */}
<div className="flex items-center gap-1.5 shrink-0">
<div className="flex items-center gap-1.5 shrink-0 max-md:w-full max-md:justify-end max-md:flex-wrap">
{hasActiveView && (
<div ref={presetMenuRef} className="popover-anchor">
<div ref={presetMenuRef} className="popover-anchor max-sm:hidden!">
<button
id="btn-presets-menu"
type="button"
disabled={isBusy}
aria-label={t.presetsMenuLabel}
title={t.presetsMenuLabel}
onClick={() => setPresetMenuOpen((v) => !v)}
className="btn-instrument hidden sm:inline-flex"
className="btn-instrument max-sm:hidden!"
>
<Sparkles size={12} className="text-[var(--accent-amber)]" />
<span>{t.presetsMenuLabel}</span>
<span className="hidden lg:inline">{t.presetsMenuLabel}</span>
<ChevronDown size={11} className="text-[var(--text-muted)]" />
</button>

Expand Down Expand Up @@ -599,11 +605,13 @@ export const App: React.FC = () => {
id="btn-switch-tilt-preset"
type="button"
disabled={isBusy}
aria-label={t.btnBackToBench}
title={t.btnBackToBench}
onClick={handleCloseTiltSession}
className="btn-instrument"
>
<X size={12} className="text-[var(--text-muted)]" />
<span className="hidden sm:inline">{t.btnBackToBench}</span>
<span className="hidden lg:inline">{t.btnBackToBench}</span>
</button>
<DropZone
mode="tilt"
Expand Down Expand Up @@ -643,6 +651,20 @@ export const App: React.FC = () => {
</button>

<LanguageSwitcher />

<a
id="link-github-source"
href="https://github.com/h-void/collima"
target="_blank"
rel="noopener noreferrer"
aria-label={t.githubSourceAriaLabel}
title={t.githubSourceAriaLabel}
className="btn-instrument no-underline"
>
<span className="hidden lg:inline">{t.githubSourceLabel}</span>
<span className="lg:hidden">GitHub</span>
<ArrowUpRight size={12} className="text-[var(--text-muted)]" />
</a>
</div>
</div>

Expand Down
10 changes: 10 additions & 0 deletions web/src/i18n/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export interface TranslationMessages {
themeLightLabel: string;
statusReady: string;
langMenuAriaLabel: string;
githubSourceLabel: string;
githubSourceAriaLabel: string;

telemetryRegionAria: string;
telemetryLens: string;
Expand Down Expand Up @@ -216,6 +218,8 @@ export const MESSAGES: Record<LocaleCode, TranslationMessages> = {
themeLightLabel: '切换至中性暗房主题',
statusReady: '本地引擎就绪',
langMenuAriaLabel: '切换界面语言',
githubSourceLabel: 'GitHub 源码',
githubSourceAriaLabel: '前往 GitHub 查看 collima 源代码',

telemetryRegionAria: 'RAW 元数据与解码遥测',
telemetryLens: '镜头',
Expand Down Expand Up @@ -432,6 +436,8 @@ export const MESSAGES: Record<LocaleCode, TranslationMessages> = {
themeLightLabel: '切換至中性暗房主題',
statusReady: '本機引擎就緒',
langMenuAriaLabel: '切換介面語言',
githubSourceLabel: 'GitHub 原始碼',
githubSourceAriaLabel: '前往 GitHub 檢視 collima 原始碼',

telemetryRegionAria: 'RAW 中繼資料與解碼遙測',
telemetryLens: '鏡頭',
Expand Down Expand Up @@ -648,6 +654,8 @@ export const MESSAGES: Record<LocaleCode, TranslationMessages> = {
themeLightLabel: 'Switch to Neutral Darkroom theme',
statusReady: 'Engine Ready',
langMenuAriaLabel: 'Switch interface language',
githubSourceLabel: 'GitHub Source',
githubSourceAriaLabel: 'View collima source repository on GitHub',

telemetryRegionAria: 'RAW metadata and decode telemetry',
telemetryLens: 'Lens',
Expand Down Expand Up @@ -864,6 +872,8 @@ export const MESSAGES: Record<LocaleCode, TranslationMessages> = {
themeLightLabel: 'ダークルームへ切替',
statusReady: 'エンジン待機中',
langMenuAriaLabel: '表示言語を切り替え',
githubSourceLabel: 'GitHub ソース',
githubSourceAriaLabel: 'GitHub で collima のソースコードを表示',

telemetryRegionAria: 'RAW メタデータおよびデコード情報',
telemetryLens: 'レンズ',
Expand Down