Wes 70acf22cb8 feat: scaffold Goose2 desktop app with full UI and testing infrastructure (#2)
* feat: scaffold Tauri + React app with window dragging and app icon

Sets up the goose2 desktop app with:
- Tauri 2 + React 19 + Vite + Tailwind CSS
- Custom titlebar with drag-to-move and double-click maximize/restore
- Window state persistence via tauri-plugin-window-state
- App icon ported from goose-desktop (cyan/amber yin-yang design)
- Theme system with dark/light/system modes
- Hermit toolchain (node, pnpm, biome, just, lefthook)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add app shell layout with tabs, sidebar, and status bar

Adds the main application layout ported from goose2.0's visual design:
- TabBar with session tabs, home button, and sidebar toggle
- Collapsible sidebar with smooth width transition
- Status bar with model name, token count, and status indicator
- AppShell component wiring everything together

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add settings modal with theme section + quality fixes

Settings:
- Settings modal with sidebar nav (Appearance, General, About)
- Theme selector (Light/Dark/System) wired to ThemeProvider
- Accent color picker and density selector (visual placeholders)
- Open via Cmd+, or Settings button in sidebar

Quality fixes:
- Fix stale state bug in tab close handler
- Fix unreachable useTheme guard, add OS theme change listener
- Improve accessibility (ARIA roles, labels, semantic elements)
- Add prefers-reduced-motion support
- Extract shared Tab type to features/tabs/types.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove references to nonexistent theme-tokens module

The previous commit introduced imports for a theme-tokens module
that doesn't exist. Remove those imports and define the needed
types locally in ThemeProvider.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: wire up accent colors and density, add AGENTS.md

Theming:
- ThemeProvider now manages accent color and density (persisted to localStorage)
- Accent color applied via --color-accent CSS variable on :root
- Density applied via --density-spacing CSS variable (multiplier)
- AppearanceSettings uses ThemeProvider context instead of local state
- Tailwind config maps accent color variable
- Settings modal animations enhanced to match goose2.0 reference
- Component classes updated to use semantic token names

Documentation:
- AGENTS.md captures all project conventions, patterns, and decisions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: replace ambiguous Tailwind arbitrary durations with config values

Add duration-400 and duration-600 to Tailwind config to avoid
ambiguous class warnings from arbitrary value syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: sidebar minimizes to icon strip instead of hiding

The sidebar now shrinks to a 48px icon-only column when toggled,
instead of disappearing completely. Icons stay visible with tooltips,
labels and section headers are hidden. Smooth width transition.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: improve settings button alignment and styling in sidebar

Match goose2.0's footer pattern with proper padding, full-opacity
border, flex alignment, and smooth transition between states.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add home screen with clock, greeting, and hidden status bar

Home screen shows a live digital clock, time-based greeting, and
placeholder chat input. Status bar hides when on the home view
(no active tab), matching goose2.0's clean home experience.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: improve home screen to match goose2.0, add chat view

Home screen: large mono clock with AM/PM, time-based greeting,
goose2.0-style chat input (rounded-2xl, shadow-lg, model badge).
Chat view: input at bottom with scrollable messages area.
Home vs chat differentiated by active tab state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: chat view now fills the full available height

Remove flex from main element so child components can properly
resolve h-full against the block parent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add testing infrastructure (Vitest, Playwright, CI)

Testing:
- Vitest for unit/component tests with jsdom + React Testing Library
- 13 tests across 3 test files (ThemeProvider, cn utility, HomeScreen)
- Playwright for E2E smoke tests (4 tests)
- Test setup with matchMedia mock for jsdom

Tooling:
- Just targets: test, test-watch, test-coverage, test-e2e
- Lefthook pre-push now runs unit tests
- CI gate includes tests

CI/CD:
- GitHub Actions workflow with 4 jobs: lint, test, desktop, rust-lint
- Playwright artifacts uploaded on failure
- Rust caching for faster builds

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve all Biome formatting and lint issues

Auto-format all files with Biome. Fix lint issues:
- Add type="button" to all interactive buttons
- Replace span[role=button] with proper button element
- Add dialog role to settings modal
- Biome-ignore for standard accessibility !important pattern

All checks pass: pnpm check, pnpm test, pnpm build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: add src-tauri/target/ to .gitignore

Prevent Rust/Tauri build artifacts from being committed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: exclude Tauri generated schemas from Biome formatting

* chore: update .gitignore for full project coverage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: pin CI actions to commit SHAs for Semgrep compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve CI failures and improve lefthook auto-formatting

- Fix dtolnay/rust-toolchain action SHA (was invalid, causing all Rust
  CI jobs to fail)
- Fix Biome folder ignore pattern (remove trailing /**)
- Update lefthook pre-commit to auto-format with biome instead of
  just checking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use vite preview directly with explicit host for E2E server

The Playwright webServer was using `pnpm preview --port 4173` which
invoked vite preview without --host, causing it to bind to localhost
(IPv6 ::1) instead of 127.0.0.1. This caused ERR_CONNECTION_REFUSED
in CI and locally. Switch to npx vite preview with --host 127.0.0.1
and --strictPort to ensure reliable binding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: gracefully handle non-Tauri browser environment

Check for Tauri runtime before calling window APIs so the app
renders correctly in browser-based E2E tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: make E2E smoke tests more robust with longer timeouts

- Add 10s timeout for element visibility (CI can be slow to render)
- Use .first() for model badge to handle multiple matches
- Fix strict mode violation for duplicate text matches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: smooth transition for status bar show/hide

Status bar now slides and fades in/out with a 300ms transition
instead of appearing/disappearing abruptly when switching views.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use dynamic import for Tauri API to prevent browser crash

Static import of @tauri-apps/api/window fails at module load time
in non-Tauri environments. Use dynamic import() guarded by
__TAURI_INTERNALS__ check so the app renders in Playwright.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use python http.server for E2E tests, start with empty tabs

Switch Playwright webServer from npx vite preview to python3 http.server
for more reliable static file serving in CI. Start app with no tabs
open (home screen by default).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align E2E setup with Sprout's proven configuration

- Use url instead of port for webServer readiness check
- Remove -b 127.0.0.1 flag from python http.server command
- Add explicit cwd to webServer config
- Use pnpm exec instead of npx for Playwright in CI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: remove unused @tauri-apps/plugin-opener JS dependency

The Rust-side tauri-plugin-opener is still registered, but the JS
binding package was never imported from frontend code. Removing it
keeps the dependency list honest. Dark mode colors already match
goose2.0 — no changes needed there.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:34:05 -07:00
S
Description
No description provided
Apache-2.0 1.5 GiB
Languages
Rust 63.6%
TypeScript 29.6%
JavaScript 1.7%
Shell 1.6%
Python 1.5%
Other 1.8%