diff --git a/frontend/src/App.css b/frontend/src/App.css index 0ce6706..998e1f2 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -657,50 +657,25 @@ body { border-radius: 10px; } -/* What's New Section */ -.whats-new-section { - padding: 0 20px 20px; -} - -.changelog-list { +.home-links { display: flex; - flex-direction: column; - gap: 2px; - background: var(--bg-card); - border-radius: 12px; - overflow: hidden; -} - -.changelog-item { - display: flex; - gap: 16px; - padding: 14px 16px; - background: var(--bg-sidebar); + gap: 18px; + margin-top: 12px; + padding: 0 4px; } -.changelog-date { +.home-link { + display: inline-flex; + align-items: center; + gap: 6px; font-size: 12px; color: var(--text-muted); - min-width: 70px; - flex-shrink: 0; -} - -.changelog-content { - display: flex; - flex-direction: column; - gap: 4px; -} - -.changelog-title { - font-size: 14px; - font-weight: 500; - color: var(--text-primary); + text-decoration: none; + transition: color 0.15s; } -.changelog-desc { - font-size: 12px; - color: var(--text-muted); - line-height: 1.4; +.home-link:hover { + color: var(--text-secondary); } .home-download { diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 909d64b..0e712c7 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -3,7 +3,7 @@ import { act, fireEvent, render, screen, waitFor, within } from '@testing-librar import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as Api from '../wailsjs/go/main/App'; import App from './App'; -import { EventsEmit, listenerCount, resetListeners } from './test/runtimeMock'; +import { EventsEmit, listenerCount, openedUrls, resetListeners } from './test/runtimeMock'; import { MODELS, downloadState } from './test/fixtures'; import { IDLE_DOWNLOAD } from './modelTypes'; @@ -64,6 +64,25 @@ describe('App model integration', () => { expect(listenerCount('downloadComplete')).toBe(0); }); + it('Home lists Browse models second and drops the changelog', async () => { + setup(); + await screen.findByText('Get started'); + const titles = Array.from(document.querySelectorAll('.action-list .action-title')).map((el) => el.textContent); + expect(titles).toEqual(['Start recording', 'Browse models', 'Settings', 'View history']); + expect(document.querySelector('.whats-new-section')).toBeNull(); + expect(document.querySelector('.changelog-list')).toBeNull(); + }); + + it('Home opens release notes and docs in the system browser', async () => { + setup(); + fireEvent.click(await screen.findByRole('link', { name: /^What's new/ })); + fireEvent.click(screen.getByRole('link', { name: /^Docs/ })); + expect(openedUrls).toEqual([ + 'https://github.com/ApplauseLab/yap/releases', + 'https://applauselab.ai/docs/yap/', + ]); + }); + it('Settings summarises the active model and links into the library', async () => { setup(); fireEvent.click(await screen.findByRole('button', { name: /^Settings/ })); diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index caaecf5..8628909 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -43,7 +43,29 @@ import { Quit, IsOnboardingCompleted, } from '../wailsjs/go/main/App'; -import { EventsOn, LogDebug, LogError, LogInfo } from '../wailsjs/runtime/runtime'; +import { BrowserOpenURL, EventsOn, LogDebug, LogError, LogInfo } from '../wailsjs/runtime/runtime'; + +const RELEASES_URL = 'https://github.com/ApplauseLab/yap/releases'; +const DOCS_URL = 'https://applauselab.ai/docs/yap/'; + +// Anchors keep the href for hover/keyboard affordances, but the webview must not +// navigate away from the app, so the click is handed to the system browser. +function HomeLink({ href, label }: { href: string; label: string }) { + return ( + { event.preventDefault(); BrowserOpenURL(href); }} + > + {label} + + + ); +} interface AppState { state: string; @@ -907,30 +929,30 @@ function App() { )} -