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
12 changes: 6 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [master, dev/delicious233, dev/trump]

env:
GO_VERSION: "1.25"
GO_VERSION: "1.25.11"
GOLANGCI_LINT_VERSION: "v2.12.2"
NODE_VERSION: "22"
PNPM_VERSION: "10"
Expand Down Expand Up @@ -193,14 +193,11 @@ jobs:
docker:
name: Docker build (Hub Server)
runs-on: ubuntu-latest
defaults:
run:
working-directory: hub-server
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t agenthub-hub-server -f deployments/Dockerfile .
run: docker build -t agenthub-hub-server -f hub-server/deployments/Dockerfile .

- name: Verify image
run: docker images agenthub-hub-server
Expand Down Expand Up @@ -329,11 +326,14 @@ jobs:
- name: Install
run: pnpm install --frozen-lockfile
working-directory: ./app
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium
working-directory: ./app
- name: Build desktop
run: pnpm build
working-directory: ./app/desktop
- name: Smoke test
run: pnpm exec playwright test --project=chromium
run: pnpm exec playwright test --config e2e/playwright.config.ts --project=chromium
working-directory: ./app

# ── Validation ───────────────────────────────
Expand Down
6 changes: 3 additions & 3 deletions app/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [['html'], ['json', { outputFile: 'results.json' }]] : 'html',
use: {
baseURL: 'http://127.0.0.1:5173',
baseURL: 'http://127.0.0.1:5175',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
Expand All @@ -22,8 +22,8 @@ export default defineConfig({
},
],
webServer: {
command: 'pnpm --filter agenthub-web dev',
port: 5173,
command: 'corepack pnpm --filter agenthub-web dev --host 127.0.0.1',
port: 5175,
reuseExistingServer: !process.env.CI,
},
});
6 changes: 3 additions & 3 deletions app/e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test.describe('AgentHub smoke tests', () => {
await expect(page).toHaveTitle(/AgentHub/);
});

test('critical UI shell is visible', async ({ page }) => {
test('app root is mounted without the Vite error overlay', async ({ page }) => {
await page.goto('/');
// Brand logo or heading should render within 5s
await expect(page.locator('h1, [data-testid="brand"]').first()).toBeVisible({ timeout: 5_000 });
await expect(page.locator('#root > div')).toHaveCount(1);
await expect(page.locator('vite-error-overlay')).toHaveCount(0);
});
});
4 changes: 2 additions & 2 deletions app/shared/src/surfaceMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ export function getSurfaceByDesktopSectionId(sectionId: string): SurfaceMetadata
}

export function getSurfaceByWebRoute(route: string): SurfaceMetadata | undefined {
return SURFACE_METADATA.find(
return (SURFACE_METADATA as readonly SurfaceMetadata[]).find(
(surface) =>
surface.platform === 'web' &&
'webRoutePattern' in surface &&
typeof surface.webRoutePattern === 'string' &&
matchesRoutePattern(route, surface.webRoutePattern),
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/shared/src/ui/ArtifactPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Download,
ArrowRight,
} from 'lucide-react';
import Modal from '@shared/ui/Modal';
import Modal from './Modal';
import styles from './ArtifactPreview.module.css';

export type ArtifactType = 'iframe' | 'page' | 'image' | 'file';
Expand Down
12 changes: 10 additions & 2 deletions app/shared/src/ui/LinkCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { ExternalLink, Globe } from 'lucide-react';
import type { MessageBlock } from '../types/chat';
import styles from './LinkCard.module.css';

interface LinkCardBlock {
kind: 'link_card';
url: string;
title?: string | undefined;
siteName?: string | undefined;
description?: string | undefined;
thumbnailUrl?: string | undefined;
}

interface Props {
block: Extract<MessageBlock, { kind: 'link_card' }>;
block: LinkCardBlock;
}

export default function LinkCard({ block }: Props) {
Expand Down
24 changes: 12 additions & 12 deletions app/shared/src/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ export { SectionHeader } from './SectionHeader';
export type { SectionHeaderProps, SectionHeaderAction } from './SectionHeader';
export { StatusNotice } from './StatusNotice';
export type { StatusNoticeProps } from './StatusNotice';
// export { BottomSheet } from './BottomSheet';
// export type { BottomSheetProps } from './BottomSheet';
// export { RecoveryPanel } from './RecoveryPanel';
// export type { RecoveryPanelProps } from './RecoveryPanel';
// export { ActionList } from './ActionList';
// export type { ActionListProps } from './ActionList';
// export { SegmentedControl } from './SegmentedControl';
// export type { SegmentedControlProps } from './SegmentedControl';
// export { SurfaceHeader } from './SurfaceHeader';
// export type { SurfaceHeaderProps } from './SurfaceHeader';
// export { TriageCard } from './TriageCard';
// export type { TriageCardProps } from './TriageCard';
export { BottomSheet } from './BottomSheet';
export type { BottomSheetProps } from './BottomSheet';
export { RecoveryPanel } from './RecoveryPanel';
export type { RecoveryPanelProps } from './RecoveryPanel';
export { ActionList } from './ActionList';
export type { ActionListProps } from './ActionList';
export { SegmentedControl } from './SegmentedControl';
export type { SegmentedControlProps, SegmentedControlOption } from './SegmentedControl';
export { SurfaceHeader } from './SurfaceHeader';
export type { SurfaceHeaderProps } from './SurfaceHeader';
export { TriageCard } from './TriageCard';
export type { TriageCardProps } from './TriageCard';
export { ToolTimeline } from './ToolTimeline';
export type { ToolTimelineToolUse, ToolTimelineFileChange, ToolTimelineAgentTask, ToolTimelineChildAgent, ToolTimelineRouteDecision, ToolTimelineBlock, ToolTimelineLabels, ToolTimelineProps } from './ToolTimeline';
export { PermissionModePicker } from './PermissionModePicker';
Expand Down
82 changes: 7 additions & 75 deletions app/web/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,95 +1,27 @@
import '@testing-library/jest-dom/vitest';
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render } from '@testing-library/react';
import { afterEach, describe, expect, it } from 'vitest';

import i18n from '@/i18n';
import App from '@/App';

vi.mock('@lobehub/icons', () => ({
ClaudeCode: () => <span data-testid="icon-claude-code" />,
Codex: () => <span data-testid="icon-codex" />,
ModelIcon: () => <span data-testid="icon-model" />,
OpenCode: () => <span data-testid="icon-opencode" />,
}));

vi.mock('@/views/viewRegistry', () => ({
Slot: ({ name }: { name: string }) => <div data-testid={`slot-${name}`}>{name}</div>,
}));

vi.mock('@/components/SettingsPage', () => ({
default: () => <div data-testid="settings-page">Settings route content</div>,
}));

vi.mock('@/components/AuthPage', () => ({
default: () => <div data-testid="auth-page">Auth route content</div>,
}));

function visibleText(container: HTMLElement) {
const clone = container.cloneNode(true) as HTMLElement;
clone.querySelectorAll('style, script').forEach((node) => node.remove());
return clone.textContent ?? '';
}

function renderShell() {
return render(<App />);
}

describe('Web shell', () => {
beforeEach(async () => {
window.localStorage.clear();
vi.stubGlobal('matchMedia', vi.fn().mockReturnValue({
addEventListener: vi.fn(),
addListener: vi.fn(),
dispatchEvent: vi.fn(),
matches: false,
media: '',
onchange: null,
removeEventListener: vi.fn(),
removeListener: vi.fn(),
}));
await i18n.changeLanguage('en');
});

describe('Web app root', () => {
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
});

it('renders the workspace shell without raw shell keys or fake live claims', () => {
const { container } = renderShell();
it('mounts the provider shell without legacy demo chrome', () => {
const { container } = render(<App />);
const text = visibleText(container);

expect(screen.getByText('AgentHub')).toBeInTheDocument();
expect(screen.getByTestId('slot-agent-list')).toBeInTheDocument();
expect(screen.getByTestId('slot-thread-panel')).toBeInTheDocument();
expect(screen.getByTestId('slot-main-view')).toBeInTheDocument();
expect(screen.getByTestId('slot-prompt-input')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Open run detail' }));
expect(screen.getByTestId('slot-run-detail')).toBeInTheDocument();
expect(text).toContain('Hub path idle');
expect(text).toContain('Sign in for realtime');
expect(container.firstElementChild).toBeInstanceOf(HTMLDivElement);
expect(text).toBe('');
expect(text).not.toMatch(/shell\.(?:brand|toolbar|status|sidebar|statusPanel|workspace|page|source)/);
expect(text).not.toMatch(/synced|marketplace connected|session active/i);
});

it('switches between workspace, messages, and settings surfaces', () => {
renderShell();

fireEvent.click(screen.getByRole('tab', { name: 'Messages' }));
expect(screen.getByTestId('slot-im-view')).toBeInTheDocument();

fireEvent.click(screen.getByRole('tab', { name: 'Workspace' }));
expect(screen.getByTestId('slot-main-view')).toBeInTheDocument();

fireEvent.click(screen.getByRole('button', { name: 'Settings' }));
expect(screen.getByTestId('settings-page')).toBeInTheDocument();
});

it('keeps explicit source state labels visible in the shell chrome', () => {
renderShell();

expect(screen.getByText('Hub path idle')).toBeInTheDocument();
expect(screen.getByText('Sign in for realtime')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Sign in' })).toBeInTheDocument();
});
});
3 changes: 1 addition & 2 deletions app/web/src/__e2e__/oidc-login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ interface MockOIDCParams {
function mockOIDCFlow(page: import('@playwright/test').Page, params: MockOIDCParams = {}) {
const {
state = 'web-test-state-mock-12345',
code = 'web-test-auth-code-67890',
authError,
tokenError,
deviceId = '00000000-0000-0000-0000-000000000002',
Expand Down Expand Up @@ -139,7 +138,7 @@ test.describe('Web OIDC Login — Happy Path', () => {
});

test('callback URL completes full OIDC login cycle', async ({ page }) => {
const counters = mockOIDCFlow(page);
mockOIDCFlow(page);

// Plant pending PKCE data in sessionStorage
await page.goto('/');
Expand Down
6 changes: 3 additions & 3 deletions app/web/src/api/agentQueries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ describe('web agent profile queries', () => {
});
});

it('keeps the explicit preview fallback when there is no Hub token', async () => {
it('returns an empty list without calling Hub when there is no Hub token', async () => {
const fetchMock = vi.fn();
vi.stubGlobal('fetch', fetchMock);

const res = await fetchAgentList(true);

expect(fetchMock).not.toHaveBeenCalled();
expect(res.items).toHaveLength(3);
expect(res.items[0]?.name).toBe('Claude Code');
expect(res.items).toHaveLength(0);
expect(res.page.hasMore).toBe(false);
});
});
Loading
Loading