diff --git a/coworker/platform/patchcycle.py b/coworker/platform/patchcycle.py index 77c7984bab0609d44e28cf3b383ac3dd9d6e82b5..d31ab0f6bc4d24b06ccd1c6269b4e1f1f237d2ca 100644 --- a/coworker/platform/patchcycle.py +++ b/coworker/platform/patchcycle.py @@ -1,6 +1,6 @@ """Patch cycles: Oracle Fusion ships a quarterly update (named by year and quarter letter: 25D, 26A, 26B, 26C) and monthly updates between them. The patch name on a test run is free text; this module only reads it, so the app can say which -cadence a patch belongs to and sort patches by how recently they were tested. web/src/runName.ts has the same rules.""" +cadence a patch belongs to and sort patches by how recently they were tested. web/src/domain/runName.ts has the same rules.""" from __future__ import annotations import re diff --git a/docs/DESIGN_SYSTEM.md b/docs/DESIGN_SYSTEM.md index 0bad8f99aaa1f29906f45ea6c263865cf6eb84ab..db67827dea41f7ee7c8279fb5089b8d33ba99aae 100644 --- a/docs/DESIGN_SYSTEM.md +++ b/docs/DESIGN_SYSTEM.md @@ -2,7 +2,7 @@ **Audience:** anyone changing the web app's UI. -**Source of truth:** [`web/src/tokens.css`](../web/src/tokens.css). All three styling layers read from it: +**Source of truth:** [`web/src/styles/00-tokens.css`](../web/src/styles/00-tokens.css). All three styling layers read from it: | Layer | How it uses the tokens | |---|---| @@ -89,7 +89,7 @@ Aliases for charts and 3D: `--status-pass`, `--status-fail`, `--status-wait` and **Family** - `--font-display`: Space Grotesk (titles, big numbers, caps labels, table headers). `--font`: Manrope, everywhere else: navigation, buttons, tabs, table headers, titles and reading text, always in sentence case. Hierarchy comes from size, weight and colour, never from capitals (`type.css`). - `--mono`: Geist Mono, for IDs, code and keyboard keys only. -- Icons: Lucide (outline, 1.75 px stroke) through `web/src/icons.tsx`; brand logos stay Tabler's. +- Icons: Lucide (outline, 1.75 px stroke) through `web/src/components/icons.tsx`; brand logos stay Tabler's. - Wensity UI components (MIT, free tier) in `components/wensity/`: title blur reveal, count-up numbers, marker highlight, shimmer for live states, the activity grid; they read the app's tokens through `wensity.css`. - Mouse effects (`components/shell/CursorFx.tsx`): a follower ring, magnetic primary buttons and a soft title rise; mouse only, off with reduced motion, switchable in the account menu. The system cursor always stays. - `--font-display-mono` is an alias of `--font`, kept so older rules follow the one family. @@ -183,7 +183,7 @@ Mantine `xs`, `sm`, `md`, `lg` and `xl` are 8, 12, 16, 24 and 32. Tailwind's spa There are no other shadows. -### Surface utilities (`web/src/surfaces.css`) +### Surface utilities (`web/src/styles/20-surfaces.css`) | Class | Use | |---|---| @@ -285,11 +285,11 @@ Motion is functional: it shows where something came from or that an action worke | File | What | |---|---| -| `web/src/tokens.css` | Tokens (section 1 colour, 2 scales, 3 legacy aliases) | +| `web/src/styles/00-tokens.css` | Tokens (section 1 colour, 2 scales, 3 legacy aliases) | | `web/src/theme.ts` | The Mantine theme from the tokens, and component defaults | -| `web/src/beui.css` | The Tailwind theme from the tokens; shadcn names for beUI parts | -| `web/src/apple.css` | Base element styles and Mantine control styling | -| `web/src/styles.css`, `apple-*.css` | Screen styles (rebuilt page by page in Step 4) | +| `web/src/styles/30-tailwind.css` | The Tailwind theme from the tokens; shadcn names for beUI parts | +| `web/src/styles/10-apple.css` | Base element styles and Mantine control styling | +| `web/src/styles/01-base.css`, `apple-*.css` | Screen styles (rebuilt page by page in Step 4) | **Legacy names.** `--fpt-*`, `--pill-*`, `--r-xs` and `--r-2xl` still work as aliases (tokens.css section 3). Don't use them in new code. Step 4 removes each one when the last page using it is rebuilt. diff --git a/docs/FRONTEND_AUDIT.md b/docs/FRONTEND_AUDIT.md index 0e1a6edcbc6a1dd5b3bb6d336fb1232a3abac27a..e2f6e04a67bec9a0da4cc5db2e4b908df28403cd 100644 --- a/docs/FRONTEND_AUDIT.md +++ b/docs/FRONTEND_AUDIT.md @@ -165,7 +165,7 @@ What each row is based on: "Checked" means I looked at the screenshot. The axe a - **`console.*`.** Only `console.error` in `ErrorPages.tsx`, which is intentional (the error boundary reports). OK. - **TODO / FIXME / lorem.** None found. -- **Unused file.** `web/src/pages/RunTriage.tsx` is not imported anywhere. **P2:** delete it in Step 4. +- **Unused file.** `web/src/pages/run/RunTriage.tsx` is not imported anywhere. **P2:** delete it in Step 4. - **Console errors at runtime.** 20 `401 Unauthorized` errors on the public pages. These come from the "who am I" check before sign-in. That is expected, but it is logged as an error in the browser console. **P2:** treat 401 as "signed out" quietly. - **Two parallel style sheets.** `styles.css` (1,100 lines, `--fpt-*`) and the `apple*.css` files (about 900 lines) both style the same components. The later file wins by load order (`main.tsx` imports 6 CSS files in sequence). This is the main source of the inconsistencies above. Step 2 resolves it. diff --git a/web/README.md b/web/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2ebdbe4d9ff2ecb4730f33829b74bcc60d966477 --- /dev/null +++ b/web/README.md @@ -0,0 +1,114 @@ +# Astra web app (frontend) + +The browser app of Astra: React 18, TypeScript, Vite, Mantine 7 and Tailwind 4. The backend (`coworker/`, Python) serves +it at `/` and its API at `/api`. You need no Oracle pod and no secrets to work on the UI: the backend runs against the +practice pod (`mock-app/`) on your machine. + +## Run it + +```bash +# once +npm --prefix web ci +npm --prefix mock-app ci +python -m venv architecture/.venv && architecture/.venv/Scripts/pip install -r coworker/requirements.txt + +# every time (three terminals) +node mock-app/server.js # the practice pod, :3100 +architecture/.venv/Scripts/python -m coworker api # the API, :8800 +npm --prefix web run dev # this app, http://127.0.0.1:5173 (proxies /api to :8800) +``` + +Create a user once: `architecture/.venv/Scripts/python -m coworker create-user --username admin --role admin`. On Windows +`fpt.cmd setup` and `fpt.cmd up` do the same. Point the dev server at another API with `FPT_API_TARGET`. + +## Where things are + +``` +web/ +├── index.html page shell: title, favicons +├── public/ static files: astra-logo.png (the CES logo), favicons +├── e2e/ Playwright end-to-end, accessibility and visual tests +├── scripts/ gen-api.mjs (typed API client), lighthouse.mjs +└── src/ + ├── main.tsx entry: loads the global styles (in order), Mantine, React Query, the router + ├── App.tsx the route table: which URL shows which page + ├── theme.ts Mantine theme: the brand colour ramp (CES blue), sizes, component defaults + ├── styles/ global CSS, numbered in load order (see "Styling") + ├── pages/ one folder per area of the app (see below) + ├── components/ shared building blocks + │ ├── shell/ the frame around every page: top bar, sidebar, icon rail, side panel + │ ├── ui/ small animated controls (motion buttons, inputs, checkbox, alert) + │ ├── three/ 3D scenes (three.js) + │ ├── wensity/ Wensity UI components on the app's tokens + │ └── icons.tsx every icon the app uses (import from '@/components/icons') + ├── api/ the API client and React Query hooks; schema.d.ts and openapi.json are GENERATED + ├── auth/ sign-in state (AuthContext) + ├── account/ account page parts (access tokens) + ├── chat/ the Ask assistant (chat cards, speakers) + ├── notify/ notifications: bell, Telegram link, settings + ├── domain/ the app's own knowledge in plain TypeScript: agents, coworkers, glossary, pod areas, + │ run names, what is waiting for a person, desktop notifications + ├── hooks/, lib/ small shared hooks and helpers + └── test/ test setup and helpers (render with providers, fake API responses) +``` + +### Pages + +| Folder | Screens | +|---|---| +| `pages/auth/` | sign in, register, password reset; `AuthShell` is their shared frame, `login/` the brand mark and 3D scene | +| `pages/home/` | the home dashboard (`HomeBento`) and patch readiness | +| `pages/runs/` | the list of test runs, the new-run wizard, scheduled runs | +| `pages/run/` | everything inside one test run: `RunPage` → `RunWorkspace` (tabs) → `RunStages` (the four phases), scenarios (`ScenarioSplit`, `ScenarioReview`), failures (`FailureReview`, `FailedScreen`), the live browser (`LiveView`), report and sign-off (`RunReport`, `SignOffReport`), the agent team board | +| `pages/library/` | the scenario library and importing test cases | +| `pages/setup/` | test environments (`PodsPage`), Oracle AI Agent Studio, AI monitoring, integrations, settings, admin | +| `pages/insights/` | defects and queues, reports, the assistant, the agent team | +| `pages/account/` | your account | +| `pages/dev/` | fixtures for local development only | +| `pages/__tests__/` | tests that cover several pages at once | + +A page's own CSS sits next to it (`pages/run/cockpit.css` is imported by the run page). Tests sit next to the code they +test (`TeamBoard.test.tsx` beside `TeamBoard.tsx`). + +## Styling + +1. **Colours, sizes and fonts come from tokens:** `styles/00-tokens.css` (CSS variables for light and dark) and + `theme.ts` (Mantine). Change a colour there and it changes everywhere. The brand accent is the CES blue + (`--accent`, `--ember`, `--accent-grad` for the gradient); status colours (green passed, red failed, amber waiting) + mean a state and are never used as decoration. +2. **Global CSS loads in the order of its number** (`main.tsx`); a later file wins over an earlier one: + + | File | What it does | + |---|---| + | `00-tokens.css` | design tokens: light and dark | + | `01-base.css` | base element styles | + | `10-14 apple*.css` | the first design layer: components, screens, the run page, other pages | + | `20-surfaces.css`, `21-type.css` | shared surfaces (cards, stat cards, pills, tables) and type | + | `30-tailwind.css` | Tailwind 4 theme and utilities on the tokens; its `@source` lines list the files that use Tailwind classes | + | `40-layout.css` | layout across screen sizes | + | `50-run-polish.css` | the reviewed design of the test run page | + | `90-theme.css` | the current look (Astra, CES blue): loaded last | + +3. **Prefer Mantine components and the tokens.** Use Tailwind classes only in the files listed under `@source` in + `30-tailwind.css`; add a file there before using Tailwind in it. +4. **Older names you will meet:** class prefixes `pw-`, `fpt-`, `trio-` and the colour names `ember` and `trio` come from + earlier designs (the product was called Patchwise). They still work; new code can use plain names. + +## Conventions + +- **Imports:** `@/` means `src/` (`import { IconX } from '@/components/icons'`). +- **API types:** never edit `src/api/schema.d.ts` or `openapi.json`. After a backend change run `npm --prefix web run gen:api`. +- **Accessibility:** every control has a label, focus is visible, colour is never the only signal. `npm --prefix web run test:a11y`. +- **Light and dark:** check both (the moon or sun button in the top bar). +- **Screens never show secrets:** the live browser view masks sign-in pages; do not add passwords, tokens or keys to the UI. + +## Checks before a pull request + +| What | Command | +|---|---| +| Type check, lint, build | `npm --prefix web run build` and `npm --prefix web run lint` | +| Unit tests (Vitest) | `npm --prefix web test` | +| End-to-end (Playwright) | `npm --prefix web run e2e` | +| Visual snapshots | `npm --prefix web run test:visual` (update with `test:visual:update` when a change is intended) | + +See also `docs/DESIGN_SYSTEM.md` (design rules), `docs/FRONTEND_AUDIT.md` and the root `README.md` (the whole product). diff --git a/web/src/App.tsx b/web/src/App.tsx index cae788875d4357e75bd3154a34e8974341e72670..e1ef3b987f5cb02b181391a906465c43d0c88c23 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,48 +1,48 @@ import { Center, Loader } from '@mantine/core'; import { lazy, Suspense, type ReactNode } from 'react'; import { Navigate, Route, Routes, useLocation, useSearchParams } from 'react-router-dom'; -import { AssistantPage } from './pages/AssistantPage'; +import { AssistantPage } from './pages/insights/AssistantPage'; import { AuthProvider, useAuth } from './auth/AuthContext'; import { Layout } from './components/Layout'; import { AdminOnly } from './components/AdminOnly'; import { NotFoundPage } from './components/ErrorPages'; -import { PodsPage } from './pages/PodsPage'; -import { ReadinessPage } from './pages/ReadinessPage'; -import { TicketsPage } from './pages/QueuesPages'; -import { RunWorkspace } from './pages/RunWorkspace'; -import { RunsPage } from './pages/RunsPage'; +import { PodsPage } from './pages/setup/PodsPage'; +import { ReadinessPage } from './pages/home/ReadinessPage'; +import { TicketsPage } from './pages/insights/QueuesPages'; +import { RunWorkspace } from './pages/run/RunWorkspace'; +import { RunsPage } from './pages/runs/RunsPage'; // Pages opened less often load on demand, so the first visit downloads less (Home, test runs, environments and defects // stay in the main bundle: they are the daily path). const named = >(load: () => Promise, name: keyof T) => lazy(() => load().then((m) => ({ default: m[name] as React.ComponentType }))); -const AgentTeamPage = named(() => import('./pages/AgentTeamPage'), 'AgentTeamPage'); -const SettingsPage = named(() => import('./pages/SettingsPage'), 'SettingsPage'); -const AutonomyPage = named(() => import('./pages/AdminPages'), 'AutonomyPage'); -const KillSwitchPage = named(() => import('./pages/AdminPages'), 'KillSwitchPage'); -const SchedulerPage = named(() => import('./pages/AdminPages'), 'SchedulerPage'); -const UsersPage = named(() => import('./pages/AdminPages'), 'UsersPage'); -const AuditPage = named(() => import('./pages/InsightPages'), 'AuditPage'); -const LearnerPage = named(() => import('./pages/InsightPages'), 'LearnerPage'); -const ReportsPage = named(() => import('./pages/LibraryPages'), 'ReportsPage'); -const ScenarioDetailPage = named(() => import('./pages/LibraryPages'), 'ScenarioDetailPage'); -const ScenariosLibraryPage = named(() => import('./pages/LibraryPages'), 'ScenariosLibraryPage'); -const HealPage = named(() => import('./pages/QueuesPages'), 'HealPage'); -const ScriptsPage = named(() => import('./pages/QueuesPages'), 'ScriptsPage'); -const AccountPage = named(() => import('./pages/AccountPage'), 'AccountPage'); -const IntegrationsPage = named(() => import('./pages/IntegrationsPage'), 'IntegrationsPage'); -const AgentStudioPage = named(() => import('./pages/AgentStudioPage'), 'AgentStudioPage'); -const AiMonitoringPage = named(() => import('./pages/AiMonitoringPage'), 'AiMonitoringPage'); -const ImportCasesPage = named(() => import('./pages/ImportCasesPage'), 'ImportCasesPage'); +const AgentTeamPage = named(() => import('./pages/insights/AgentTeamPage'), 'AgentTeamPage'); +const SettingsPage = named(() => import('./pages/setup/SettingsPage'), 'SettingsPage'); +const AutonomyPage = named(() => import('./pages/setup/AdminPages'), 'AutonomyPage'); +const KillSwitchPage = named(() => import('./pages/setup/AdminPages'), 'KillSwitchPage'); +const SchedulerPage = named(() => import('./pages/setup/AdminPages'), 'SchedulerPage'); +const UsersPage = named(() => import('./pages/setup/AdminPages'), 'UsersPage'); +const AuditPage = named(() => import('./pages/insights/InsightPages'), 'AuditPage'); +const LearnerPage = named(() => import('./pages/insights/InsightPages'), 'LearnerPage'); +const ReportsPage = named(() => import('./pages/library/LibraryPages'), 'ReportsPage'); +const ScenarioDetailPage = named(() => import('./pages/library/LibraryPages'), 'ScenarioDetailPage'); +const ScenariosLibraryPage = named(() => import('./pages/library/LibraryPages'), 'ScenariosLibraryPage'); +const HealPage = named(() => import('./pages/insights/QueuesPages'), 'HealPage'); +const ScriptsPage = named(() => import('./pages/insights/QueuesPages'), 'ScriptsPage'); +const AccountPage = named(() => import('./pages/account/AccountPage'), 'AccountPage'); +const IntegrationsPage = named(() => import('./pages/setup/IntegrationsPage'), 'IntegrationsPage'); +const AgentStudioPage = named(() => import('./pages/setup/AgentStudioPage'), 'AgentStudioPage'); +const AiMonitoringPage = named(() => import('./pages/setup/AiMonitoringPage'), 'AiMonitoringPage'); +const ImportCasesPage = named(() => import('./pages/library/ImportCasesPage'), 'ImportCasesPage'); // the sign-in page carries the beUI animation library: only people who sign in download it -const LoginPage = named(() => import('./pages/LoginPage'), 'LoginPage'); -const RegisterPage = named(() => import('./pages/RegisterPage'), 'RegisterPage'); -const ForgotPage = named(() => import('./pages/PasswordPages'), 'ForgotPage'); -const ResetPage = named(() => import('./pages/PasswordPages'), 'ResetPage'); +const LoginPage = named(() => import('./pages/auth/LoginPage'), 'LoginPage'); +const RegisterPage = named(() => import('./pages/auth/RegisterPage'), 'RegisterPage'); +const ForgotPage = named(() => import('./pages/auth/PasswordPages'), 'ForgotPage'); +const ResetPage = named(() => import('./pages/auth/PasswordPages'), 'ResetPage'); // Dev-only fixture screens for design review; the branch is removed from the production build. -const DevFixtures = import.meta.env.DEV ? lazy(() => import('./pages/DevFixtures').then((m) => ({ default: m.DevFixtures }))) : null; -const DevApprovalFixtures = import.meta.env.DEV ? lazy(() => import('./pages/DevFixtures').then((m) => ({ default: m.DevApprovalFixtures }))) : null; +const DevFixtures = import.meta.env.DEV ? lazy(() => import('./pages/dev/DevFixtures').then((m) => ({ default: m.DevFixtures }))) : null; +const DevApprovalFixtures = import.meta.env.DEV ? lazy(() => import('./pages/dev/DevFixtures').then((m) => ({ default: m.DevApprovalFixtures }))) : null; /** The fixture routes this build registers (none outside dev builds). */ export const DEV_FIXTURE_PATHS: string[] = import.meta.env.DEV ? ['/dev/board-fixture', '/dev/approval-fixture'] : []; diff --git a/web/src/account/AccessTokensCard.tsx b/web/src/account/AccessTokensCard.tsx index 9b382306d9c21e4a4e225e08ea5f2ce85e26df24..b0fa667aa41c51dbcc27867e90340857fdd1726e 100644 --- a/web/src/account/AccessTokensCard.tsx +++ b/web/src/account/AccessTokensCard.tsx @@ -1,11 +1,11 @@ import { Button, CopyButton, Group, Radio, Stack, Text, TextInput } from '@mantine/core'; -import { IconCheck, IconCopy, IconKey } from '@/icons'; +import { IconCheck, IconCopy, IconKey } from '@/components/icons'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useEffect, useRef, useState, type FormEvent } from 'react'; import { useLocation } from 'react-router-dom'; import { sendJson } from '../api/client'; import { ErrorAlert, fmtTs } from '../components/common'; -import { shortWhen } from '../runName'; +import { shortWhen } from '../domain/runName'; import { isActive, scopeWords, TOKENS_KEY, useAccessTokens, type AccessToken, type CreatedToken } from './useAccessTokens'; import './account-tokens.css'; diff --git a/web/src/chat/AskChat.tsx b/web/src/chat/AskChat.tsx index c02f486132d07f8d43c2dbe40a08b3d2d1a7b16c..d5aab9af7609bff3debe8b594f89800a435da08a 100644 --- a/web/src/chat/AskChat.tsx +++ b/web/src/chat/AskChat.tsx @@ -1,22 +1,22 @@ import { ActionIcon, Button, Drawer, Text, Textarea } from '@mantine/core'; -import { IconArrowUp, IconMessages, IconPlus, IconShieldLock, IconTrash, IconX } from '@/icons'; +import { IconArrowUp, IconMessages, IconPlus, IconShieldLock, IconTrash, IconX } from '@/components/icons'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback, useEffect, useRef, useState, type FormEvent, type KeyboardEvent as ReactKeyboardEvent } from 'react'; import { Link, useLocation, useNavigate, useParams, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; +import { MODULE_NAMES } from '../domain/agents'; import { errorMessage } from '../api/client'; import { askErrorWords, useAssistantAsk, useAssistantStatus, useRun } from '../api/hooks'; import { useShell } from '../components/shell/prefs'; import { TopBar } from '../components/shell/TopBar'; import { QueryState } from '../components/states'; -import { runTitle, shortWhen } from '../runName'; +import { runTitle, shortWhen } from '../domain/runName'; import { AnswerCard, ConfirmCard, ScreenLinks, Sources } from './ChatCards'; import { createConversation, deleteConversation, getConversation, listConversations, sendMessage, type ChatAction, type ChatContext, type ChatMessage, type ChatResult, type ConversationSummary, } from './api'; import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { COWORKERS } from '../coworkers'; +import { COWORKERS } from '../domain/coworkers'; import { speakerFor, type Speaker } from './speaker'; import type { AskArrival } from './useAsk'; import './ask.css'; diff --git a/web/src/chat/ChatCards.tsx b/web/src/chat/ChatCards.tsx index 626d02392eee1f05aaf04fd2585cec804e2fceac..f89647a52b2329368a5211beb5d991d1492643f3 100644 --- a/web/src/chat/ChatCards.tsx +++ b/web/src/chat/ChatCards.tsx @@ -1,14 +1,14 @@ import { Button, Group, Stack, Text } from '@mantine/core'; -import { IconCheck, IconExternalLink } from '@/icons'; +import { IconCheck, IconExternalLink } from '@/components/icons'; import { useEffect, useRef, useState } from 'react'; import { Link } from 'react-router-dom'; import { errorMessage } from '../api/client'; import { useRun, useRunReadiness } from '../api/hooks'; import { Pill } from '../components/common'; import { ProcessFlow } from '../components/ProcessFlow'; -import { RUN_STATUS_WORDS, VERDICT_TONE } from '../glossary'; -import { ScenarioCard } from '../pages/ScenarioReview'; -import { runTitle } from '../runName'; +import { RUN_STATUS_WORDS, VERDICT_TONE } from '../domain/glossary'; +import { ScenarioCard } from '../pages/run/ScenarioReview'; +import { runTitle } from '../domain/runName'; import { cancelAction, confirmAction, type ChatAction, type ChatCard, type ChatLink, type ChatSource } from './api'; const hhmm = (iso?: string | null) => { diff --git a/web/src/chat/speaker.ts b/web/src/chat/speaker.ts index 52f086305b328a00662561d9d6c4a6a27b984e4b..97789269d1e041cef84a3c9f79739bccd10c1476 100644 --- a/web/src/chat/speaker.ts +++ b/web/src/chat/speaker.ts @@ -1,4 +1,4 @@ -import { COWORKERS, type Coworker } from '../coworkers'; +import { COWORKERS, type Coworker } from '../domain/coworkers'; import type { ChatResult } from './api'; /** Who an answer comes from: a coworker of the AI team, the built-in coordinator ("Astra"), or Hermes. */ diff --git a/web/src/components/AdminOnly.tsx b/web/src/components/AdminOnly.tsx index da6868e8d6011844a79e942b015fac78cd1ad823..e0898bf31190b74ed243c654455a6944bba8bc40 100644 --- a/web/src/components/AdminOnly.tsx +++ b/web/src/components/AdminOnly.tsx @@ -1,5 +1,5 @@ import { Button, Stack, Text } from '@mantine/core'; -import { IconLock } from '@/icons'; +import { IconLock } from '@/components/icons'; import type { ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { useAuth } from '../auth/AuthContext'; diff --git a/web/src/components/CommandPalette.tsx b/web/src/components/CommandPalette.tsx index 95c552183a0cfd04b996a983e541b9437d3bc726..5ee2d388beaed9b6da3edb2a1674c5f87ea9bc7b 100644 --- a/web/src/components/CommandPalette.tsx +++ b/web/src/components/CommandPalette.tsx @@ -2,13 +2,13 @@ import { Modal, useMantineColorScheme } from '@mantine/core'; import { IconBug, IconCalendarTime, IconFileReport, IconHistory, IconHome, IconKeyboard, IconListCheck, IconMessageCircle, IconMoon, IconPlayerPlay, IconPlus, IconSearch, IconServer, IconSettings, IconSun, IconUserCheck, -} from '@/icons'; +} from '@/components/icons'; import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'; import { useNavigate } from 'react-router-dom'; import { useRuns } from '../api/hooks'; import { useAuth } from '../auth/AuthContext'; -import { runAreas, runTitle } from '../runName'; -import { useWaitsOnMe } from '../waiting'; +import { runAreas, runTitle } from '../domain/runName'; +import { useWaitsOnMe } from '../domain/waiting'; import { isMac } from './shell/TopBar'; import { useShell } from './shell/prefs'; diff --git a/web/src/components/CoworkerCard.tsx b/web/src/components/CoworkerCard.tsx index 26cf769db8376c6bd65b2f183c6747023bc6328a..65493ab296d8834abf287ef74c694bc5c5be35ab 100644 --- a/web/src/components/CoworkerCard.tsx +++ b/web/src/components/CoworkerCard.tsx @@ -1,8 +1,8 @@ -import '../coworkers.css'; +import './coworkers.css'; import { Link } from 'react-router-dom'; import { useRuns } from '../api/hooks'; import { useAuth } from '../auth/AuthContext'; -import { COWORKERS, coworkerState, type Coworker, type CoworkerState } from '../coworkers'; +import { COWORKERS, coworkerState, type Coworker, type CoworkerState } from '../domain/coworkers'; import { CoworkerAvatar } from './CoworkerAvatar'; const STATE: Record = { diff --git a/web/src/components/ErrorPages.test.tsx b/web/src/components/ErrorPages.test.tsx index c39c5fc842e4dbb1fd4f947068ebe3247622d07e..b5f87150709a0a5211f06dccaa32e49e795385f9 100644 --- a/web/src/components/ErrorPages.test.tsx +++ b/web/src/components/ErrorPages.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { LoginPage } from '../pages/LoginPage'; +import { LoginPage } from '../pages/auth/LoginPage'; import { jsonResponse, renderUi } from '../test/utils'; import { NotFoundPage, ScreenErrorBoundary } from './ErrorPages'; diff --git a/web/src/components/GraphView.tsx b/web/src/components/GraphView.tsx index 35a82fc4be82174a89235073563955a17ebb313e..4282007393d1ccdbfd8e91fb7805f3b1d2cf856f 100644 --- a/web/src/components/GraphView.tsx +++ b/web/src/components/GraphView.tsx @@ -1,5 +1,5 @@ import { Text } from '@mantine/core'; -import { AGENT_BY_NODE, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, stepName } from '../agents'; +import { AGENT_BY_NODE, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, stepName } from '../domain/agents'; import type { NodeState } from '../hooks/useRunStream'; import { Pill } from './common'; diff --git a/web/src/components/Layout.tsx b/web/src/components/Layout.tsx index c209ec7cf32ea3351a7f6a42360866b474241422..ed530e191940911265e2f1c297260bed70b1b3b9 100644 --- a/web/src/components/Layout.tsx +++ b/web/src/components/Layout.tsx @@ -4,9 +4,9 @@ import { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'rea import { Outlet, useLocation, useNavigate, useSearchParams } from 'react-router-dom'; import { useHealth, useKill, useRuns, useSavedState } from '../api/hooks'; import { useAuth } from '../auth/AuthContext'; -import { desktop, statusTransitions } from '../desktop'; +import { desktop, statusTransitions } from '../domain/desktop'; import { useAsk } from '../chat/useAsk'; -import { StartRunSheet } from '../pages/StartRunWizard'; +import { StartRunSheet } from '../pages/runs/StartRunWizard'; import { CommandPalette } from './CommandPalette'; import { ScreenErrorBoundary } from './ErrorPages'; import { KeyboardSheet } from './KeyboardSheet'; diff --git a/web/src/components/ProcessFlow.tsx b/web/src/components/ProcessFlow.tsx index ddcbf0633102a7d863a0e15e9d5c3481057fb785..7508e90f0945e498caeab35c0ba8b54250f96000 100644 --- a/web/src/components/ProcessFlow.tsx +++ b/web/src/components/ProcessFlow.tsx @@ -1,8 +1,8 @@ import { Group, Text, Tooltip } from '@mantine/core'; -import { IconAlertTriangle, IconArrowRight, IconCircleCheck, IconCircleDashed, IconMinus, IconX } from '@/icons'; +import { IconAlertTriangle, IconArrowRight, IconCircleCheck, IconCircleDashed, IconMinus, IconX } from '@/components/icons'; import type { ReactNode } from 'react'; import type { ProcessStep } from '../api/types'; -import { STEP_STATE } from '../glossary'; +import { STEP_STATE } from '../domain/glossary'; const ICON: Record = { failing: , gap: , not_tested: , diff --git a/web/src/components/common.tsx b/web/src/components/common.tsx index 0071f1729e12525fe321c315298379d06ca24566..ecf711d0200d3dbc71365823c73c4c12c6d329b5 100644 --- a/web/src/components/common.tsx +++ b/web/src/components/common.tsx @@ -1,10 +1,10 @@ import { Alert, Anchor, Button, Code, CopyButton, Group, Pagination, Popover, Text, Tooltip } from '@mantine/core'; -import { IconCheck, IconCopy, IconHelp, IconPlus, IconRobot, IconShieldLock } from '@/icons'; +import { IconCheck, IconCopy, IconHelp, IconPlus, IconRobot, IconShieldLock } from '@/components/icons'; import type { ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { explainError, supportDetails } from '../api/errors'; import { useAuth } from '../auth/AuthContext'; -import { decisionWords, GLOSSARY, RUN_STATUS_WORDS } from '../glossary'; +import { decisionWords, GLOSSARY, RUN_STATUS_WORDS } from '../domain/glossary'; import { TopBar } from './shell/TopBar'; import { useShell } from './shell/prefs'; import { TextBlurReveal } from './wensity/text-blur-reveal'; diff --git a/web/src/components/components.test.tsx b/web/src/components/components.test.tsx index fb01f4e69dcc4c003b05c3b2c32821b40fc36b35..e00667dda314e2dc93ec1aac28608638d0795ea8 100644 --- a/web/src/components/components.test.tsx +++ b/web/src/components/components.test.tsx @@ -1,15 +1,15 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { statusTransitions } from '../desktop'; +import { statusTransitions } from '../domain/desktop'; import { nodeStates, type RunEvent } from '../hooks/useRunStream'; -import { LoginPage } from '../pages/LoginPage'; -import { RunCases } from '../pages/RunCases'; -import { StartRunForm } from '../pages/StartRunWizard'; +import { LoginPage } from '../pages/auth/LoginPage'; +import { RunCases } from '../pages/run/RunCases'; +import { StartRunForm } from '../pages/runs/StartRunWizard'; import { jsonResponse, renderUi } from '../test/utils'; import type { ProcessStep } from '../api/types'; -import { reviewAnswer } from '../glossary'; -import { ScenarioReview } from '../pages/ScenarioReview'; -import { runTitle } from '../runName'; +import { reviewAnswer } from '../domain/glossary'; +import { ScenarioReview } from '../pages/run/ScenarioReview'; +import { runTitle } from '../domain/runName'; import { DecisionBadge, MockBanner, RuleResult } from './common'; import { ProcessFlow } from './ProcessFlow'; import { GraphView } from './GraphView'; diff --git a/web/src/coworkers.css b/web/src/components/coworkers.css similarity index 100% rename from web/src/coworkers.css rename to web/src/components/coworkers.css diff --git a/web/src/icons.tsx b/web/src/components/icons.tsx similarity index 100% rename from web/src/icons.tsx rename to web/src/components/icons.tsx diff --git a/web/src/components/shell/AppSidebar.tsx b/web/src/components/shell/AppSidebar.tsx index 9286dc6ab4bcd448dad0f8169fd471549ed823f0..b58656cb6974adf4f1e0691f0a145619a726f68a 100644 --- a/web/src/components/shell/AppSidebar.tsx +++ b/web/src/components/shell/AppSidebar.tsx @@ -1,20 +1,20 @@ -import '../../shell.css'; +import './shell.css'; import { Menu, Tooltip, useMantineColorScheme } from '@mantine/core'; import { IconAlertTriangle, IconBug, IconCheck, IconDeviceDesktop, IconFileReport, IconHandStop, IconHome, IconListCheck, IconLogout, IconMessageCircle, IconMoon, - IconPlayerPlay, IconPlug, IconRobot, IconServer, IconSettings, IconSun, IconActivity } from '@/icons'; + IconPlayerPlay, IconPlug, IconRobot, IconServer, IconSettings, IconSun, IconActivity } from '@/components/icons'; import type { ReactNode } from 'react'; import { NavLink as RouterLink, useLocation } from 'react-router-dom'; import type { Schemas } from '../../api/client'; import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks'; import { useAuth } from '../../auth/AuthContext'; -import { desktop } from '../../desktop'; -import { areaTone } from '../../agents'; -import { runTitle } from '../../runName'; +import { desktop } from '../../domain/desktop'; +import { areaTone } from '../../domain/agents'; +import { runTitle } from '../../domain/runName'; import { EnvSwitcher, envKind, useChosenEnv } from './EnvSwitcher'; import { setCursorEffects, useCursorEffects } from './CursorFx'; import { setSimpleMode, useSimpleMode } from './simpleMode'; -import { isWaiting, useWaitsOnMe } from '../../waiting'; +import { isWaiting, useWaitsOnMe } from '../../domain/waiting'; type RunSummary = Schemas['RunSummary']; export interface NavItem { to: string; label: string; icon: ReactNode; match?: (p: string) => boolean; admin?: boolean } diff --git a/web/src/components/shell/EnvSwitcher.tsx b/web/src/components/shell/EnvSwitcher.tsx index 104176e8860d9fbd3c5712300d082f4ec6122fc5..bba85b68e879aa68be295b5349bcf65093a248d6 100644 --- a/web/src/components/shell/EnvSwitcher.tsx +++ b/web/src/components/shell/EnvSwitcher.tsx @@ -1,5 +1,5 @@ import { Menu, UnstyledButton } from '@mantine/core'; -import { IconCheck, IconCloud, IconSelector, IconServer, IconShieldLock } from '@/icons'; +import { IconCheck, IconCloud, IconSelector, IconServer, IconShieldLock } from '@/components/icons'; import { useNavigate } from 'react-router-dom'; import { usePods, type Pod } from '../../api/hooks'; import { MOCK_TEXT } from '../common'; diff --git a/web/src/components/shell/IconRail.tsx b/web/src/components/shell/IconRail.tsx index 099cf2a0f1f8640babaf21265c383056925a1a74..04cc06698f150b9d46f364368b1aaad26423f71d 100644 --- a/web/src/components/shell/IconRail.tsx +++ b/web/src/components/shell/IconRail.tsx @@ -1,10 +1,10 @@ import './rail.css'; import { Tooltip } from '@mantine/core'; -import { IconAlertTriangle, IconHandStop } from '@/icons'; +import { IconAlertTriangle, IconHandStop } from '@/components/icons'; import { NavLink as RouterLink, useLocation } from 'react-router-dom'; import { useBrand, useHealth, useKill, useRuns } from '../../api/hooks'; import { useAuth } from '../../auth/AuthContext'; -import { useWaitsOnMe } from '../../waiting'; +import { useWaitsOnMe } from '../../domain/waiting'; import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar'; import { envKind, useChosenEnv } from './EnvSwitcher'; diff --git a/web/src/components/shell/RunListItem.tsx b/web/src/components/shell/RunListItem.tsx index 40cbd6edd57e2f798d2825c953ab02eaca2ca7db..ac61f8db852c1ec6c223c8d27b624ba0e350e343 100644 --- a/web/src/components/shell/RunListItem.tsx +++ b/web/src/components/shell/RunListItem.tsx @@ -1,10 +1,10 @@ import { Tooltip } from '@mantine/core'; import { Link } from 'react-router-dom'; import type { Schemas } from '../../api/client'; -import { decisionWords, RUN_STATUS_WORDS } from '../../glossary'; -import { runAreas, runTitle, shortWhen } from '../../runName'; +import { decisionWords, RUN_STATUS_WORDS } from '../../domain/glossary'; +import { runAreas, runTitle, shortWhen } from '../../domain/runName'; import type { EnvKind } from './EnvSwitcher'; -import { isWaiting, useWaitsOnMe, waitingForWords } from '../../waiting'; +import { isWaiting, useWaitsOnMe, waitingForWords } from '../../domain/waiting'; import { runState, StatusDot } from './StatusDot'; type RunSummary = Schemas['RunSummary']; diff --git a/web/src/components/shell/SidePanel.tsx b/web/src/components/shell/SidePanel.tsx index 9b19d169f39a4508eb77715ba8bd8f466aaecbbc..ec6ff82a8686719f550ad56ca6c725ab136638e7 100644 --- a/web/src/components/shell/SidePanel.tsx +++ b/web/src/components/shell/SidePanel.tsx @@ -1,6 +1,6 @@ import { Drawer, Tabs, Tooltip } from '@mantine/core'; import { useViewportSize } from '@mantine/hooks'; -import { IconBroadcast, IconFileReport, IconFileSpreadsheet, IconLayoutSidebarRightCollapse, IconListNumbers, IconPhoto, IconX } from '@/icons'; +import { IconBroadcast, IconFileReport, IconFileSpreadsheet, IconLayoutSidebarRightCollapse, IconListNumbers, IconPhoto, IconX } from '@/components/icons'; import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react'; import { useSearchParams } from 'react-router-dom'; import { useShell, useUiPrefs, type PanelTab } from './prefs'; diff --git a/web/src/components/shell/TopBar.tsx b/web/src/components/shell/TopBar.tsx index 8da6743d8baa47b37f6e40cab47a000c3a24bce6..3d5395760cd5f21987f9119fa3d21f68bd082a09 100644 --- a/web/src/components/shell/TopBar.tsx +++ b/web/src/components/shell/TopBar.tsx @@ -1,5 +1,5 @@ import { Button } from '@mantine/core'; -import { IconChevronLeft, IconMenu2, IconSearch, IconSparkles } from '@/icons'; +import { IconChevronLeft, IconMenu2, IconSearch, IconSparkles } from '@/components/icons'; import type { ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { NotificationBell } from '../../notify/NotificationBell'; diff --git a/web/src/components/shell/TopNav.tsx b/web/src/components/shell/TopNav.tsx index a8bcdc4f8c3809f6cacec91fd42cc92f7491385e..b6ce728ab8d886a5c17d8a821e5fd4859401e419 100644 --- a/web/src/components/shell/TopNav.tsx +++ b/web/src/components/shell/TopNav.tsx @@ -1,11 +1,11 @@ import './topnav.css'; import { Menu, useComputedColorScheme, useMantineColorScheme } from '@mantine/core'; -import { IconChevronDown, IconHandStop, IconMoon, IconSearch, IconSun } from '@/icons'; +import { IconChevronDown, IconHandStop, IconMoon, IconSearch, IconSun } from '@/components/icons'; import { Link, NavLink as RouterLink, useLocation, useNavigate } from 'react-router-dom'; import { useBrand, useKill, useRuns } from '../../api/hooks'; import { useAuth } from '../../auth/AuthContext'; import { NotificationBell } from '../../notify/NotificationBell'; -import { useWaitsOnMe } from '../../waiting'; +import { useWaitsOnMe } from '../../domain/waiting'; import { AccountMenu, AGENT_STUDIO, AI_MONITORING, INTEGRATIONS, LIBRARY, MAIN, SETTINGS, SETUP, type NavItem } from './AppSidebar'; import { EnvSwitcher } from './EnvSwitcher'; import { useShell } from './prefs'; diff --git a/web/src/components/shell/cockpit.tsx b/web/src/components/shell/cockpit.tsx index 736699ca6b05b3d7a858e69c314c0ff2ae92a878..6ae6bb6a4b8c402fc73e64735f20c3186a8a8df7 100644 --- a/web/src/components/shell/cockpit.tsx +++ b/web/src/components/shell/cockpit.tsx @@ -1,5 +1,5 @@ import { usePatchWatch, usePodProfile, usePods } from '../../api/hooks'; -import { shortWhen } from '../../runName'; +import { shortWhen } from '../../domain/runName'; /** The release the readiness is about, as the page's one-line sub-title: "Patch 26C. Test environment release 26C, checked 18 Oct 23:53." * "Next Oracle update" is shown only when the API gives a date; it is never guessed. The environment cue lives in the top bar. */ diff --git a/web/src/components/shell/panelTabs.tsx b/web/src/components/shell/panelTabs.tsx index 829506e48d332e492413560b63c9d4da65525b3a..166437a1ce345311604c4c85b07f3c59f1ef2333 100644 --- a/web/src/components/shell/panelTabs.tsx +++ b/web/src/components/shell/panelTabs.tsx @@ -1,19 +1,19 @@ import { Anchor, Button, CopyButton, Group, Skeleton, Stack, Text, Title } from '@mantine/core'; -import { IconCheck, IconFileReport, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconListNumbers } from '@/icons'; +import { IconCheck, IconFileReport, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconListNumbers } from '@/components/icons'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { MODULE_NAMES } from '../../agents'; +import { MODULE_NAMES } from '../../domain/agents'; import { useGate, useReport, useRun, useRunReadiness, useRunScenarios, useScenario } from '../../api/hooks'; import type { ApproveGate } from '../../api/types'; -import { scriptUrl } from '../../pages/RunGuide'; -import { RunScripts } from '../../pages/RunData'; -import { OUTCOME, ScenarioBody } from '../../pages/ScenarioReview'; -import { decisionSentence } from '../../pages/SignOffReport'; +import { scriptUrl } from '../../pages/run/RunGuide'; +import { RunScripts } from '../../pages/run/RunData'; +import { OUTCOME, ScenarioBody } from '../../pages/run/ScenarioReview'; +import { decisionSentence } from '../../pages/run/SignOffReport'; import { AiText, Can, DecisionBadge, ErrorAlert, Prio } from '../common'; import { CoworkerAvatar } from '../CoworkerAvatar'; -import { coworkerForNode } from '../../coworkers'; +import { coworkerForNode } from '../../domain/coworkers'; import { EmptyState } from './EmptyState'; -import '../../pages/report.css'; +import '../../pages/run/report.css'; const ORIGIN: Record = { library: { label: 'Library', tone: 'neutral' }, generated: { label: 'New', tone: 'lav' }, ai: { label: 'Written by the AI model', tone: 'lav' }, diff --git a/web/src/shell.css b/web/src/components/shell/shell.css similarity index 100% rename from web/src/shell.css rename to web/src/components/shell/shell.css diff --git a/web/src/components/shell/shell.test.tsx b/web/src/components/shell/shell.test.tsx index d4b42637f313810413a549910e0b0fc3465ff844..da6b10ef2aa4982d98551ee46d2ee118f94176b6 100644 --- a/web/src/components/shell/shell.test.tsx +++ b/web/src/components/shell/shell.test.tsx @@ -56,7 +56,7 @@ describe('shell', () => { describe('run stage card', () => { it('is the one guide element, with a stage kicker and a progress line in words', async () => { const { renderUi } = await import('../../test/utils'); - const { StageCard } = await import('../../pages/RunStage'); + const { StageCard } = await import('../../pages/run/RunStage'); const { screen } = await import('@testing-library/react'); renderUi(

body

); expect(screen.getByTestId('run-guide')).toHaveAttribute('data-stage', 'judge'); diff --git a/web/src/components/ui/motion/alert.tsx b/web/src/components/ui/motion/alert.tsx index 3300c7ecf356b6ad40dc98fe460a5903454b459a..eb09c8b2aa1748349cdaa6c072f9de07b111bff0 100644 --- a/web/src/components/ui/motion/alert.tsx +++ b/web/src/components/ui/motion/alert.tsx @@ -1,7 +1,7 @@ "use client"; // beui.dev/components/motion/alert -import { IconAlertCircle as AlertCircle, IconCircleCheck as CheckCircle2, IconInfoCircle as Info, IconAlertTriangle as TriangleAlert, IconX as X } from "@/icons"; +import { IconAlertCircle as AlertCircle, IconCircleCheck as CheckCircle2, IconInfoCircle as Info, IconAlertTriangle as TriangleAlert, IconX as X } from "@/components/icons"; import { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from "motion/react"; import { createContext, diff --git a/web/src/components/ui/motion/button/stateful.tsx b/web/src/components/ui/motion/button/stateful.tsx index accad4fbb1a894c35ef21736c0be157ae04bc28f..ff1cea169c056be2a067eb52c1a68e8305ae0d2d 100644 --- a/web/src/components/ui/motion/button/stateful.tsx +++ b/web/src/components/ui/motion/button/stateful.tsx @@ -1,7 +1,7 @@ "use client"; // beui.dev/components/motion/button -import { IconCheck as Check, IconLoader2 as Loader2, IconX as X } from "@/icons"; +import { IconCheck as Check, IconLoader2 as Loader2, IconX as X } from "@/components/icons"; import { AnimatePresence, motion, diff --git a/web/src/agents.test.ts b/web/src/domain/agents.test.ts similarity index 100% rename from web/src/agents.test.ts rename to web/src/domain/agents.test.ts diff --git a/web/src/agents.ts b/web/src/domain/agents.ts similarity index 100% rename from web/src/agents.ts rename to web/src/domain/agents.ts diff --git a/web/src/coworkers.test.ts b/web/src/domain/coworkers.test.ts similarity index 100% rename from web/src/coworkers.test.ts rename to web/src/domain/coworkers.test.ts diff --git a/web/src/coworkers.ts b/web/src/domain/coworkers.ts similarity index 100% rename from web/src/coworkers.ts rename to web/src/domain/coworkers.ts diff --git a/web/src/desktop.ts b/web/src/domain/desktop.ts similarity index 100% rename from web/src/desktop.ts rename to web/src/domain/desktop.ts diff --git a/web/src/glossary.ts b/web/src/domain/glossary.ts similarity index 100% rename from web/src/glossary.ts rename to web/src/domain/glossary.ts diff --git a/web/src/podAreas.ts b/web/src/domain/podAreas.ts similarity index 96% rename from web/src/podAreas.ts rename to web/src/domain/podAreas.ts index 7e35e7934ec7ecba682e0b57f25f560845e49e55..20737687638774934ae167b9ef102cf6af3fc714 100644 --- a/web/src/podAreas.ts +++ b/web/src/domain/podAreas.ts @@ -3,7 +3,7 @@ // - an Oracle Fusion pod offers the areas discovery found on it (in use, or present with no records yet), as the server // reports them in run_areas; before the first discovery, every area the server knows (the run's scout discovers); // - any other pod offers what the admin registered for it, else every area. -import type { Pod } from './api/hooks'; +import type { Pod } from '../api/hooks'; export const ALL_AREAS = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX']; diff --git a/web/src/runName.ts b/web/src/domain/runName.ts similarity index 100% rename from web/src/runName.ts rename to web/src/domain/runName.ts diff --git a/web/src/waiting.ts b/web/src/domain/waiting.ts similarity index 95% rename from web/src/waiting.ts rename to web/src/domain/waiting.ts index 586f65f9540060b4cb79dd363b1858e63f2a1de6..b2ee78f851256c74cd9f5430368a16811ec432d5 100644 --- a/web/src/waiting.ts +++ b/web/src/domain/waiting.ts @@ -2,7 +2,7 @@ // gate's permission may answer it (consultant: approve the scenarios; QA approver: decide the failures; admin: both). // "Waiting for you" counts only the gates the signed-in user may answer; other runs say whom they wait for. import { useCallback } from 'react'; -import { useAuthOptional } from './auth/AuthContext'; +import { useAuthOptional } from '../auth/AuthContext'; const TERMINAL = ['completed', 'failed', 'killed', 'cancelled']; export const GATE_PERM: Record = { approve_cases: 'gate.approve_cases', human_review: 'gate.human_review' }; diff --git a/web/src/main.tsx b/web/src/main.tsx index 35894c010fe526fffeef64055d6a0e20bca876dd..1ada8ba5818a9817cf379beb1c34c9dec5f3f711 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -3,20 +3,20 @@ import '@mantine/notifications/styles.css'; import '@fontsource-variable/manrope/wght.css'; import '@fontsource-variable/space-grotesk/wght.css'; import '@fontsource-variable/geist-mono/wght.css'; // monospace for identifiers -import './tokens.css'; // design tokens: the one source of colour, type, space and size (docs/DESIGN_SYSTEM.md) -import './styles.css'; -import './apple.css'; -import './apple-components.css'; -import './apple-screens.css'; -import './apple-run.css'; -import './apple-pages.css'; -import './surfaces.css'; // shared pw-* surface utilities (cards, stat cards, status pills, tables) -import './type.css'; // the display-mono type layer on top of the surfaces -import './beui.css'; // beUI / shadcn layer on the app's tokens (Tailwind 4 theme + utilities, no reset) -import './layout.css'; // the layout layer: framed buttons, cards that hold their content, every screen size -import './run-polish.css'; // the test run page in the reviewed design (one alignment line, one button system) +import './styles/00-tokens.css'; // design tokens: the one source of colour, type, space and size (docs/DESIGN_SYSTEM.md) +import './styles/01-base.css'; +import './styles/10-apple.css'; +import './styles/11-apple-components.css'; +import './styles/12-apple-screens.css'; +import './styles/13-apple-run.css'; +import './styles/14-apple-pages.css'; +import './styles/20-surfaces.css'; // shared pw-* surface utilities (cards, stat cards, status pills, tables) +import './styles/21-type.css'; // the display-mono type layer on top of the surfaces +import './styles/30-tailwind.css'; // beUI / shadcn layer on the app's tokens (Tailwind 4 theme + utilities, no reset) +import './styles/40-layout.css'; // the layout layer: framed buttons, cards that hold their content, every screen size +import './styles/50-run-polish.css'; // the test run page in the reviewed design (one alignment line, one button system) import './components/wensity/wensity.css'; // Wensity UI components take the app's tokens -import './ember.css'; // the Ember look (after Sheryians): loaded last +import './styles/90-theme.css'; // the current look (Astra, CES blue): loaded last; see web/README.md "Styling" import { MantineProvider } from '@mantine/core'; import { Notifications } from '@mantine/notifications'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; diff --git a/web/src/notify/NotificationBell.tsx b/web/src/notify/NotificationBell.tsx index b0bda93867aa56219a1360a680b87c9df251c482..533bd0fb3dcb4d095a8894eb390f326bc5a639a1 100644 --- a/web/src/notify/NotificationBell.tsx +++ b/web/src/notify/NotificationBell.tsx @@ -1,9 +1,9 @@ import { Button, Popover, Switch } from '@mantine/core'; -import { IconBell } from '@/icons'; +import { IconBell } from '@/components/icons'; import { useState } from 'react'; import { Link } from 'react-router-dom'; import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { COWORKERS } from '../coworkers'; +import { COWORKERS } from '../domain/coworkers'; import { toPath, useBrowserPref, useNotifications, whenWords, type Notice } from './useNotifications'; import './notify.css'; diff --git a/web/src/notify/NotificationsSettings.tsx b/web/src/notify/NotificationsSettings.tsx index 9dfa933611b827a485a1529a26452d7294dfc13d..a662222df8c21dbf6ba3ee9e70e928b9c968d710 100644 --- a/web/src/notify/NotificationsSettings.tsx +++ b/web/src/notify/NotificationsSettings.tsx @@ -1,5 +1,5 @@ import { Button, Group, Switch, Text } from '@mantine/core'; -import { IconSend } from '@/icons'; +import { IconSend } from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { getJson, sendJson } from '../api/client'; import { ErrorAlert, fmtTs } from '../components/common'; diff --git a/web/src/notify/TelegramCard.tsx b/web/src/notify/TelegramCard.tsx index 7a7a319def22806c734840eebc5bbfe3a0c45d35..427291218cbc78ab670aad8e2fc8950b7925f1e5 100644 --- a/web/src/notify/TelegramCard.tsx +++ b/web/src/notify/TelegramCard.tsx @@ -1,5 +1,5 @@ import { Button, Group, Text } from '@mantine/core'; -import { IconBrandTelegram, IconCircleCheck, IconSearch, IconSend } from '@/icons'; +import { IconBrandTelegram, IconCircleCheck, IconSearch, IconSend } from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useState } from 'react'; import { getJson, sendJson } from '../api/client'; diff --git a/web/src/notify/TelegramLinkCard.tsx b/web/src/notify/TelegramLinkCard.tsx index cbbb6e3a4422e49fafd857e5b267a67b416a0e94..f1ff888c7cfbd9c16b94a618ebdc26b00dda7d7c 100644 --- a/web/src/notify/TelegramLinkCard.tsx +++ b/web/src/notify/TelegramLinkCard.tsx @@ -1,5 +1,5 @@ import { Button, CopyButton, Group, Text } from '@mantine/core'; -import { IconBrandTelegram, IconCheck, IconCopy, IconLink, IconLinkOff } from '@/icons'; +import { IconBrandTelegram, IconCheck, IconCopy, IconLink, IconLinkOff } from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; import { getJson, sendJson } from '../api/client'; diff --git a/web/src/pages/fixes.test.tsx b/web/src/pages/__tests__/fixes.test.tsx similarity index 94% rename from web/src/pages/fixes.test.tsx rename to web/src/pages/__tests__/fixes.test.tsx index ce9abb22cae61648f0a3c7f3642292df70559b87..75e5e41fa110ba61482fc21b5747237a8e4be057 100644 --- a/web/src/pages/fixes.test.tsx +++ b/web/src/pages/__tests__/fixes.test.tsx @@ -1,8 +1,8 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { Failure } from '../api/types'; -import { jsonResponse, renderUi } from '../test/utils'; -import { FailureReview, isDecided } from './FailureReview'; +import type { Failure } from '../../api/types'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { FailureReview, isDecided } from '../run/FailureReview'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const ME = { id: 1, username: 'qa', role: 'qa_approver', permissions: ['read', 'gate.human_review', 'evidence.read'] }; @@ -56,7 +56,7 @@ describe('failure review: every pending failure needs a decision', () => { describe('waiting counts follow the role', () => { it('a consultant waits on approvals only, a QA approver on failure decisions, an admin on both', async () => { - const { waitsOn, waitingForWords } = await import('../waiting'); + const { waitsOn, waitingForWords } = await import('../../domain/waiting'); const approve = { status: 'waiting_approval', pending_gate: 'approve_cases' }; const judge = { status: 'waiting_review', pending_gate: 'human_review' }; const as = (perms: string[]) => (p: string) => perms.includes(p); @@ -89,7 +89,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc it('lists each scenario once and asks before skipping all; the answer then skips every scenario explicitly', async () => { const posts: unknown[] = []; mock(posts); - const { ScenarioReview } = await import('./ScenarioReview'); + const { ScenarioReview } = await import('../run/ScenarioReview'); renderUi(, { auth: true }); await screen.findByTestId('approval-card-AI-1'); expect(screen.queryAllByTestId('scenario-AI-1')).toHaveLength(0); // the AI scenario is a card, not also a row @@ -105,7 +105,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc it('keeps unsent decisions for the run in this browser tab', async () => { mock([]); - const { ScenarioReview } = await import('./ScenarioReview'); + const { ScenarioReview } = await import('../run/ScenarioReview'); const first = renderUi(, { auth: true }); await screen.findByTestId('approval-card-AI-1'); fireEvent.click(screen.getByRole('button', { name: 'Approve Title AI-1' })); @@ -118,7 +118,7 @@ describe('scenario review: explicit skip-all, saved decisions, each scenario onc it('says so in words when the scenarios cannot be loaded, with Try again', async () => { mock([], 500); - const { ScenarioReview } = await import('./ScenarioReview'); + const { ScenarioReview } = await import('../run/ScenarioReview'); renderUi(, { auth: true }); const box = await screen.findByTestId('review-load-error'); expect(box).toHaveTextContent('Something went wrong on the server.'); @@ -130,7 +130,7 @@ describe('Test environments: add an Oracle Fusion pod', () => { afterEach(() => vi.restoreAllMocks()); it('podFormErrors: https address and a name of 2+ characters', async () => { - const { podFormErrors } = await import('./PodsPage'); + const { podFormErrors } = await import('../setup/PodsPage'); expect(podFormErrors({ name: 'A', base_url: 'https://', modules: ['AP'] })).toMatchObject({ name: expect.any(String), base_url: expect.any(String) }); expect(podFormErrors({ name: 'Acme', base_url: 'http://acme.example.com', modules: ['AP'] }).base_url).toBe('The address must start with https://'); expect(podFormErrors({ name: 'Acme', base_url: 'https://acme.fa.ocs.oraclecloud.com', modules: ['AP'] })).toEqual({}); @@ -152,7 +152,7 @@ describe('Test environments: add an Oracle Fusion pod', () => { if (u.includes('/api/pods')) return jsonResponse([]); return jsonResponse({}); }); - const { PodsPage } = await import('./PodsPage'); + const { PodsPage } = await import('../setup/PodsPage'); renderUi(, { auth: true, route: '/pods?add=1' }); const name = await screen.findByRole('textbox', { name: /^Name/ }); fireEvent.change(name, { target: { value: 'A' } }); diff --git a/web/src/pages/mustfix.test.tsx b/web/src/pages/__tests__/mustfix.test.tsx similarity index 93% rename from web/src/pages/mustfix.test.tsx rename to web/src/pages/__tests__/mustfix.test.tsx index b16cb25b3ffe72454dba74034f1c0a5416ea7064..15780dc2f9772e8d5aad0d7f69d493444cafd16e 100644 --- a/web/src/pages/mustfix.test.tsx +++ b/web/src/pages/__tests__/mustfix.test.tsx @@ -1,8 +1,8 @@ import { act, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { ScenarioSteps } from '../components/shell/panelTabs'; -import { jsonResponse, renderUi } from '../test/utils'; -import { ScenarioReview } from './ScenarioReview'; +import { ScenarioSteps } from '../../components/shell/panelTabs'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { ScenarioReview } from '../run/ScenarioReview'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const scenario = { id: 'P2P-APR-001', title: 'Requisition below threshold approved by first-level approver', module: 'P2P', process: 'Requisition', step: 'Requisition', diff --git a/web/src/pages/recovery.test.tsx b/web/src/pages/__tests__/recovery.test.tsx similarity index 92% rename from web/src/pages/recovery.test.tsx rename to web/src/pages/__tests__/recovery.test.tsx index 93035084336814ac32afcdf38c7a5679cb008176..b85295756cfbfde7d310f5168ba31fccb66bf1ac 100644 --- a/web/src/pages/recovery.test.tsx +++ b/web/src/pages/__tests__/recovery.test.tsx @@ -1,10 +1,10 @@ import { act, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; -import { LiveView, SLOW_START_MS } from './LiveView'; -import { PodsPage } from './PodsPage'; -import { patchCadence } from '../runName'; -import { scheduleSentence } from './ScheduledRunsPage'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { LiveView, SLOW_START_MS } from '../run/LiveView'; +import { PodsPage } from '../setup/PodsPage'; +import { patchCadence } from '../../domain/runName'; +import { scheduleSentence } from '../runs/ScheduledRunsPage'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const me = { id: 1, username: 'a', role: 'admin', permissions: ['read', 'evidence.read', 'admin', 'run.start'] }; diff --git a/web/src/pages/review3.test.tsx b/web/src/pages/__tests__/review3.test.tsx similarity index 87% rename from web/src/pages/review3.test.tsx rename to web/src/pages/__tests__/review3.test.tsx index 783e2ae4f842b871563423228620a3a1ebe1973b..004c6f164ac7fd06f53d6a62195b945b708e6796 100644 --- a/web/src/pages/review3.test.tsx +++ b/web/src/pages/__tests__/review3.test.tsx @@ -1,11 +1,11 @@ import { screen, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; -import type { RunEvent } from '../hooks/useRunStream'; -import { shortWhen } from '../runName'; -import { NextStep } from './RunPage'; -import { ApprovalCard } from './ScenarioReview'; -import { TeamBoardView } from './TeamBoard'; +import { jsonResponse, renderUi } from '../../test/utils'; +import type { RunEvent } from '../../hooks/useRunStream'; +import { shortWhen } from '../../domain/runName'; +import { NextStep } from '../run/RunPage'; +import { ApprovalCard } from '../run/ScenarioReview'; +import { TeamBoardView } from '../run/TeamBoard'; const me = (role: string, perms: string[]) => vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => { const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url; @@ -18,10 +18,10 @@ describe('review 3', () => { it('registers the /dev fixture routes only in dev builds', async () => { vi.stubEnv('DEV', false); vi.resetModules(); - expect((await import('../App')).DEV_FIXTURE_PATHS).toEqual([]); + expect((await import('../../App')).DEV_FIXTURE_PATHS).toEqual([]); vi.stubEnv('DEV', true); vi.resetModules(); - expect((await import('../App')).DEV_FIXTURE_PATHS).toEqual(['/dev/board-fixture', '/dev/approval-fixture']); + expect((await import('../../App')).DEV_FIXTURE_PATHS).toEqual(['/dev/board-fixture', '/dev/approval-fixture']); }, 30_000); // imports the whole app twice: slow on a busy laptop it('dry-run time is in the viewer\'s zone, with the UTC time in the tooltip; Approve comes before Skip', () => { diff --git a/web/src/pages/step4.test.tsx b/web/src/pages/__tests__/step4.test.tsx similarity index 96% rename from web/src/pages/step4.test.tsx rename to web/src/pages/__tests__/step4.test.tsx index 5dd294e6405c2d3eec321ef4ec365cfaad8e9991..1b1919d901cbba6ac467cd4c81bcc701b0f89788 100644 --- a/web/src/pages/step4.test.tsx +++ b/web/src/pages/__tests__/step4.test.tsx @@ -1,8 +1,8 @@ import { fireEvent, screen, waitFor, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; -import { FailedScreen } from './FailedScreen'; -import { ScenarioReview } from './ScenarioReview'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { FailedScreen } from '../run/FailedScreen'; +import { ScenarioReview } from '../run/ScenarioReview'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const scen = (id: string, title: string, step: string, priority = 'P1', origin = 'library') => ({ id, title, module: 'P2P', process: step, step, priority, diff --git a/web/src/pages/step5.test.tsx b/web/src/pages/__tests__/step5.test.tsx similarity index 95% rename from web/src/pages/step5.test.tsx rename to web/src/pages/__tests__/step5.test.tsx index b0362f408444678a6e505379d69ad9d9160ed1ce..8d58d8854633d7ffb0919b5267070159bd622b82 100644 --- a/web/src/pages/step5.test.tsx +++ b/web/src/pages/__tests__/step5.test.tsx @@ -1,10 +1,10 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { ModuleReadiness } from '../api/types'; -import { ReleaseLine } from '../components/shell/cockpit'; -import { jsonResponse, renderUi } from '../test/utils'; -import { ModuleCard } from './ReadinessPage'; -import { SignOffReport } from './SignOffReport'; +import type { ModuleReadiness } from '../../api/types'; +import { ReleaseLine } from '../../components/shell/cockpit'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { ModuleCard } from '../home/ReadinessPage'; +import { SignOffReport } from '../run/SignOffReport'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const mod = (module: string, verdict: string, run_id: string | null): ModuleReadiness => ({ module, verdict, rule_result: null, run_id, run_status: null, diff --git a/web/src/pages/step67.test.tsx b/web/src/pages/__tests__/step67.test.tsx similarity index 95% rename from web/src/pages/step67.test.tsx rename to web/src/pages/__tests__/step67.test.tsx index 53bd0dfc728f899706e1de010c54b81411c35ac8..1d298a050a9ebcf361972e8887f5b8f666b589d8 100644 --- a/web/src/pages/step67.test.tsx +++ b/web/src/pages/__tests__/step67.test.tsx @@ -1,8 +1,8 @@ import { fireEvent, screen, waitFor, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; -import { everyWords, ScheduledRunsPage, scheduleSentence, utcToLocal } from './ScheduledRunsPage'; -import { TicketsPage } from './QueuesPages'; +import { jsonResponse, renderUi } from '../../test/utils'; +import { everyWords, ScheduledRunsPage, scheduleSentence, utcToLocal } from '../runs/ScheduledRunsPage'; +import { TicketsPage } from '../insights/QueuesPages'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const admin = { id: 1, username: 'admin', role: 'admin', permissions: ['read', 'admin', 'run.start'] }; diff --git a/web/src/pages/AccountPage.test.tsx b/web/src/pages/account/AccountPage.test.tsx similarity index 96% rename from web/src/pages/AccountPage.test.tsx rename to web/src/pages/account/AccountPage.test.tsx index 656ae086f9337c82be6d9082057ab0e362ba9f6f..11d68400ed3d08f0f01720b5b7c73f889ba56590 100644 --- a/web/src/pages/AccountPage.test.tsx +++ b/web/src/pages/account/AccountPage.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; +import { jsonResponse, renderUi } from '../../test/utils'; import { AccountPage } from './AccountPage'; // fake values, built so the repository's secret scanner does not read them as real credentials diff --git a/web/src/pages/AccountPage.tsx b/web/src/pages/account/AccountPage.tsx similarity index 94% rename from web/src/pages/AccountPage.tsx rename to web/src/pages/account/AccountPage.tsx index 7e9741c35d31821b2d1fb0b752efeeee7dd3bf73..e9804f82a0083936d75fbabf56ab1b4ee723e11f 100644 --- a/web/src/pages/AccountPage.tsx +++ b/web/src/pages/account/AccountPage.tsx @@ -2,13 +2,13 @@ import { Alert, Badge, Button, Group, PasswordInput, Skeleton, Stack, Switch, Ta import { notifications } from '@mantine/notifications'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useState, type FormEvent } from 'react'; -import { getJson, sendJson } from '../api/client'; -import { useAuth } from '../auth/AuthContext'; -import { ErrorAlert, fmtTs, PageHeader } from '../components/common'; -import { shortWhen } from '../runName'; -import { TelegramLinkCard } from '../notify/TelegramLinkCard'; -import { AccessTokensCard } from '../account/AccessTokensCard'; -import './admin.css'; +import { getJson, sendJson } from '../../api/client'; +import { useAuth } from '../../auth/AuthContext'; +import { ErrorAlert, fmtTs, PageHeader } from '../../components/common'; +import { shortWhen } from '../../domain/runName'; +import { TelegramLinkCard } from '../../notify/TelegramLinkCard'; +import { AccessTokensCard } from '../../account/AccessTokensCard'; +import '../setup/admin.css'; interface SessionRow { id: string; kind: string; created_at: string; expires_at: string; current: boolean } diff --git a/web/src/pages/AuthShell.tsx b/web/src/pages/auth/AuthShell.tsx similarity index 96% rename from web/src/pages/AuthShell.tsx rename to web/src/pages/auth/AuthShell.tsx index 36a5e1532105c4a3bca784147f75b0dd5f0343ed..ab6bb321163bb3f24dc0eecca0acbff8809cfe9e 100644 --- a/web/src/pages/AuthShell.tsx +++ b/web/src/pages/auth/AuthShell.tsx @@ -1,8 +1,8 @@ import { lazy, Suspense, type ReactNode } from 'react'; import { Alert, AlertContent, AlertDescription, AlertIcon } from '@/components/ui/motion/alert'; -import { useBrand } from '../api/hooks'; -import { explainError } from '../api/errors'; -import { MockBanner } from '../components/common'; +import { useBrand } from '../../api/hooks'; +import { explainError } from '../../api/errors'; +import { MockBanner } from '../../components/common'; import { BrandMark } from './login/BrandMark'; // the 3D hero (three.js) loads after the form is on screen, in its own chunk diff --git a/web/src/pages/LoginPage.tsx b/web/src/pages/auth/LoginPage.tsx similarity index 95% rename from web/src/pages/LoginPage.tsx rename to web/src/pages/auth/LoginPage.tsx index 6c6a52b896a0d194e453a512f557a907048a662e..7b79aa86414e67fcd8734c21eb93d6c652f5db15 100644 --- a/web/src/pages/LoginPage.tsx +++ b/web/src/pages/auth/LoginPage.tsx @@ -1,13 +1,13 @@ import { useReducedMotion } from 'motion/react'; -import { IconEye as Eye, IconEyeOff as EyeOff, IconLock as Lock, IconUser as User } from '@/icons'; +import { IconEye as Eye, IconEyeOff as EyeOff, IconLock as Lock, IconUser as User } from '@/components/icons'; import { useState, type FormEvent, type KeyboardEvent } from 'react'; import { Link, Navigate, useLocation, useNavigate } from 'react-router-dom'; import { StatefulButton, type ButtonState } from '@/components/ui/motion/button/stateful'; import { Checkbox } from '@/components/ui/motion/checkbox'; import { Input } from '@/components/ui/motion/input'; -import { useBrand } from '../api/hooks'; -import { explainError } from '../api/errors'; -import { useAuth } from '../auth/AuthContext'; +import { useBrand } from '../../api/hooks'; +import { explainError } from '../../api/errors'; +import { useAuth } from '../../auth/AuthContext'; import { AUTH_LINK, AUTH_LINK_STRONG, AuthError, AuthShell, FIELD } from './AuthShell'; import { useAuthConfig } from './RegisterPage'; diff --git a/web/src/pages/PasswordPages.tsx b/web/src/pages/auth/PasswordPages.tsx similarity index 96% rename from web/src/pages/PasswordPages.tsx rename to web/src/pages/auth/PasswordPages.tsx index 2172603a9c7061d9a33dd67a90d39648e9a27454..520cc57d379614d0f70e99583e0de7048ad57e2e 100644 --- a/web/src/pages/PasswordPages.tsx +++ b/web/src/pages/auth/PasswordPages.tsx @@ -1,9 +1,9 @@ -import { IconCircleCheck as CircleCheck, IconLock as Lock, IconMail as Mail, IconMailCheck as MailCheck } from '@/icons'; +import { IconCircleCheck as CircleCheck, IconLock as Lock, IconMail as Mail, IconMailCheck as MailCheck } from '@/components/icons'; import { useMemo, useState, type FormEvent } from 'react'; import { Link } from 'react-router-dom'; import { StatefulButton, type ButtonState } from '@/components/ui/motion/button/stateful'; import { Input } from '@/components/ui/motion/input'; -import { api, unwrap } from '../api/client'; +import { api, unwrap } from '../../api/client'; import { AUTH_BUTTON_PRIMARY, AUTH_LINK, AuthDone, AuthError, AuthShell, FIELD } from './AuthShell'; /** "Forgot your password?": asks Supabase to e-mail a reset link. The answer never says whether the address exists. */ diff --git a/web/src/pages/RegisterPage.test.tsx b/web/src/pages/auth/RegisterPage.test.tsx similarity index 96% rename from web/src/pages/RegisterPage.test.tsx rename to web/src/pages/auth/RegisterPage.test.tsx index 22065e86dc2cfa33660d1cdea9b3d665a4444774..fcc6b7c9596fd112b3d9bb7fd74a5fd054d83984 100644 --- a/web/src/pages/RegisterPage.test.tsx +++ b/web/src/pages/auth/RegisterPage.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; +import { jsonResponse, renderUi } from '../../test/utils'; import { RegisterPage } from './RegisterPage'; afterEach(() => vi.restoreAllMocks()); diff --git a/web/src/pages/RegisterPage.tsx b/web/src/pages/auth/RegisterPage.tsx similarity index 95% rename from web/src/pages/RegisterPage.tsx rename to web/src/pages/auth/RegisterPage.tsx index 42a5e1257b93358c1602736a4158c543ce0c435c..3800242e587c2d155ed286310a3f3ac217ee8794 100644 --- a/web/src/pages/RegisterPage.tsx +++ b/web/src/pages/auth/RegisterPage.tsx @@ -1,13 +1,13 @@ import { notifications } from '@mantine/notifications'; import { useQuery } from '@tanstack/react-query'; -import { IconLock as Lock, IconMail as Mail, IconMailCheck as MailCheck } from '@/icons'; +import { IconLock as Lock, IconMail as Mail, IconMailCheck as MailCheck } from '@/components/icons'; import { useState, type FormEvent } from 'react'; import { Link, Navigate, useNavigate } from 'react-router-dom'; import { StatefulButton, type ButtonState } from '@/components/ui/motion/button/stateful'; import { Input } from '@/components/ui/motion/input'; -import { getJson } from '../api/client'; -import { useAuth } from '../auth/AuthContext'; -import { VIEWER_START_WORDS } from '../components/common'; +import { getJson } from '../../api/client'; +import { useAuth } from '../../auth/AuthContext'; +import { VIEWER_START_WORDS } from '../../components/common'; import { AUTH_BUTTON_PRIMARY, AUTH_BUTTON_SECONDARY, AUTH_LINK_STRONG, AuthDone, AuthError, AuthShell, FIELD } from './AuthShell'; export interface AuthConfig { provider: 'local' | 'supabase'; registration: boolean; new_account_role: string | null } diff --git a/web/src/pages/login/BrandMark.tsx b/web/src/pages/auth/login/BrandMark.tsx similarity index 100% rename from web/src/pages/login/BrandMark.tsx rename to web/src/pages/auth/login/BrandMark.tsx diff --git a/web/src/pages/login/ReleaseScene.tsx b/web/src/pages/auth/login/ReleaseScene.tsx similarity index 100% rename from web/src/pages/login/ReleaseScene.tsx rename to web/src/pages/auth/login/ReleaseScene.tsx diff --git a/web/src/pages/DevFixtures.tsx b/web/src/pages/dev/DevFixtures.tsx similarity index 93% rename from web/src/pages/DevFixtures.tsx rename to web/src/pages/dev/DevFixtures.tsx index afcf9ea825ed4b40afd88194d1ea8c52a7997037..0276f2925ca0b32de59ff5ce1573a0f9092134b5 100644 --- a/web/src/pages/DevFixtures.tsx +++ b/web/src/pages/dev/DevFixtures.tsx @@ -1,11 +1,11 @@ // DEV ONLY: fixture screens for design review. Loaded only when import.meta.env.DEV (never in the production build). import { SimpleGrid, Stack } from '@mantine/core'; import { useState } from 'react'; -import type { LlmCall } from '../agents'; -import { PageHeader } from '../components/common'; -import type { RunEvent } from '../hooks/useRunStream'; -import { ApprovalCard, type Decision } from './ScenarioReview'; -import { TeamBoardView } from './TeamBoard'; +import type { LlmCall } from '../../domain/agents'; +import { PageHeader } from '../../components/common'; +import type { RunEvent } from '../../hooks/useRunStream'; +import { ApprovalCard, type Decision } from '../run/ScenarioReview'; +import { TeamBoardView } from '../run/TeamBoard'; const T0 = Date.parse('2026-10-17T10:00:00Z'); const at = (s: number) => new Date(T0 + s * 1000).toISOString(); diff --git a/web/src/pages/HomeBento.tsx b/web/src/pages/home/HomeBento.tsx similarity index 94% rename from web/src/pages/HomeBento.tsx rename to web/src/pages/home/HomeBento.tsx index edc6d942afb1d4681e08881966c231259405ee20..4072f3d792b4fb57a7d83d3cafba27943c33fab5 100644 --- a/web/src/pages/HomeBento.tsx +++ b/web/src/pages/home/HomeBento.tsx @@ -1,16 +1,16 @@ import { Link } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { useRuns, useTickets } from '../api/hooks'; -import type { ModuleReadiness } from '../api/types'; -import { decisionWords, RUN_STATUS_WORDS } from '../glossary'; -import { useNotifications } from '../notify/useNotifications'; -import { runAreas, runTitle, shortWhen } from '../runName'; -import { useWaitsOnMe } from '../waiting'; -import type { Schemas } from '../api/client'; -import { GitHubActivityGrid, type ActivityDay } from '../components/wensity/github-activity-grid'; -import { CountUp } from '../components/CountUp'; -import { IconActivity, IconBug, IconChecklist, IconHourglass, IconListCheck, IconRadar, IconShieldCheck, IconSparkles, IconTicket, IconClock } from '@/icons'; -import { TextHighlight } from '../components/wensity/text-highlight'; +import { MODULE_NAMES } from '../../domain/agents'; +import { useRuns, useTickets } from '../../api/hooks'; +import type { ModuleReadiness } from '../../api/types'; +import { decisionWords, RUN_STATUS_WORDS } from '../../domain/glossary'; +import { useNotifications } from '../../notify/useNotifications'; +import { runAreas, runTitle, shortWhen } from '../../domain/runName'; +import { useWaitsOnMe } from '../../domain/waiting'; +import type { Schemas } from '../../api/client'; +import { GitHubActivityGrid, type ActivityDay } from '../../components/wensity/github-activity-grid'; +import { CountUp } from '../../components/CountUp'; +import { IconActivity, IconBug, IconChecklist, IconHourglass, IconListCheck, IconRadar, IconShieldCheck, IconSparkles, IconTicket, IconClock } from '@/components/icons'; +import { TextHighlight } from '../../components/wensity/text-highlight'; import './home-bento.css'; type RunSummary = Schemas['RunSummary']; diff --git a/web/src/pages/ReadinessPage.tsx b/web/src/pages/home/ReadinessPage.tsx similarity index 93% rename from web/src/pages/ReadinessPage.tsx rename to web/src/pages/home/ReadinessPage.tsx index 8beb80ca7887bf105e1a821eaa8eb9436b02cdc1..239f7158dada107cdfea402dae82172c58e0fe3f 100644 --- a/web/src/pages/ReadinessPage.tsx +++ b/web/src/pages/home/ReadinessPage.tsx @@ -1,23 +1,23 @@ import { Accordion, Anchor, Button, Group, Select, Skeleton, Stack, Text } from '@mantine/core'; -import { IconAlertCircle, IconExternalLink, IconFileAnalytics, IconInfoCircle, IconLoader2, IconPlus } from '@/icons'; +import { IconAlertCircle, IconExternalLink, IconFileAnalytics, IconInfoCircle, IconLoader2, IconPlus } from '@/components/icons'; import { useEffect, useMemo, useState } from 'react'; import { Link, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import type { Schemas } from '../api/client'; -import { usePods, useReadiness, useRunReadiness, useRuns } from '../api/hooks'; -import type { ModuleReadiness, PatchChange } from '../api/types'; -import { Can, ErrorAlert, GlossaryButton, PageHeader, Pill, StartRunGate } from '../components/common'; -import { useAuth } from '../auth/AuthContext'; +import { MODULE_NAMES } from '../../domain/agents'; +import type { Schemas } from '../../api/client'; +import { usePods, useReadiness, useRunReadiness, useRuns } from '../../api/hooks'; +import type { ModuleReadiness, PatchChange } from '../../api/types'; +import { Can, ErrorAlert, GlossaryButton, PageHeader, Pill, StartRunGate } from '../../components/common'; +import { useAuth } from '../../auth/AuthContext'; import './home.css'; import { HomeBento } from './HomeBento'; const DECISION_TONE: Record = { GO: 'green', 'NO-GO': 'red', HELD: 'amber' }; -import { ProcessFlow, StepLegend } from '../components/ProcessFlow'; -import { ReleaseLine } from '../components/shell/cockpit'; -import { EmptyState } from '../components/shell/EmptyState'; -import { useShell, useUiPrefs } from '../components/shell/prefs'; -import { decisionWords, VERDICT_TONE } from '../glossary'; -import { patchCadence, shortWhen } from '../runName'; +import { ProcessFlow, StepLegend } from '../../components/ProcessFlow'; +import { ReleaseLine } from '../../components/shell/cockpit'; +import { EmptyState } from '../../components/shell/EmptyState'; +import { useShell, useUiPrefs } from '../../components/shell/prefs'; +import { decisionWords, VERDICT_TONE } from '../../domain/glossary'; +import { patchCadence, shortWhen } from '../../domain/runName'; const joinWords = (xs: string[]) => (xs.length <= 1 ? xs.join('') : `${xs.slice(0, -1).join(', ')} and ${xs[xs.length - 1]}`); diff --git a/web/src/pages/home-bento.css b/web/src/pages/home/home-bento.css similarity index 100% rename from web/src/pages/home-bento.css rename to web/src/pages/home/home-bento.css diff --git a/web/src/pages/home.css b/web/src/pages/home/home.css similarity index 100% rename from web/src/pages/home.css rename to web/src/pages/home/home.css diff --git a/web/src/pages/AgentTeamPage.tsx b/web/src/pages/insights/AgentTeamPage.tsx similarity index 94% rename from web/src/pages/AgentTeamPage.tsx rename to web/src/pages/insights/AgentTeamPage.tsx index afa020ec301088991cc021f90d950f019fc1fc40..d35ec16194a4a7fc69603f825f592d3069443e7c 100644 --- a/web/src/pages/AgentTeamPage.tsx +++ b/web/src/pages/insights/AgentTeamPage.tsx @@ -1,15 +1,15 @@ import { Button, Group, Stack, Table, Tabs, Text } from '@mantine/core'; -import { IconSettings, IconStar } from '@/icons'; +import { IconSettings, IconStar } from '@/components/icons'; import { useQuery } from '@tanstack/react-query'; import { useState } from 'react'; import { Link, useSearchParams } from 'react-router-dom'; -import { AGENTS, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, type AgentDef } from '../agents'; -import { getJson } from '../api/client'; -import { useAutonomy, useConfig, useHealth, useKill, usePatchWatch, useSchedules } from '../api/hooks'; -import { ErrorAlert, PageHeader, Pill } from '../components/common'; -import { CoworkerGrid } from '../components/CoworkerCard'; -import { GraphView } from '../components/GraphView'; -import { COWORKERS, type Coworker } from '../coworkers'; +import { AGENTS, ENGINE_LABEL, ENGINE_TONE, ENGINE_WORDS, type AgentDef } from '../../domain/agents'; +import { getJson } from '../../api/client'; +import { useAutonomy, useConfig, useHealth, useKill, usePatchWatch, useSchedules } from '../../api/hooks'; +import { ErrorAlert, PageHeader, Pill } from '../../components/common'; +import { CoworkerGrid } from '../../components/CoworkerCard'; +import { GraphView } from '../../components/GraphView'; +import { COWORKERS, type Coworker } from '../../domain/coworkers'; interface Ready { ready: boolean; checks: Record; orchestrator: string; scheduler: string; version: string } const useReady = () => useQuery({ queryKey: ['ready'], queryFn: () => getJson('/api/ready'), refetchInterval: 10_000, retry: false }); diff --git a/web/src/pages/AssistantPage.tsx b/web/src/pages/insights/AssistantPage.tsx similarity index 80% rename from web/src/pages/AssistantPage.tsx rename to web/src/pages/insights/AssistantPage.tsx index 430bbd007547854a8def1db2ce25a45b792302b8..dd7d15ed28d95b8b7d1f9521bcade918abcc4ac0 100644 --- a/web/src/pages/AssistantPage.tsx +++ b/web/src/pages/insights/AssistantPage.tsx @@ -1,11 +1,11 @@ -import { IconCircleCheck, IconLoader2, IconUserCheck } from '@/icons'; +import { IconCircleCheck, IconLoader2, IconUserCheck } from '@/components/icons'; import { useMemo } from 'react'; -import { agentName, STEP_WORDS } from '../agents'; -import { AskChat } from '../chat/AskChat'; -import { nodeStates, type RunEvent } from '../hooks/useRunStream'; +import { agentName, STEP_WORDS } from '../../domain/agents'; +import { AskChat } from '../../chat/AskChat'; +import { nodeStates, type RunEvent } from '../../hooks/useRunStream'; // STEP_WORDS lives in agents.ts (shared by the team strip, the board and the activity log); re-exported here. -export { STEP_WORDS } from '../agents'; +export { STEP_WORDS } from '../../domain/agents'; /** What the agents have done so far, read from the run's own event log (the workflow, in order). */ export function AgentSteps({ events, finished }: { events: RunEvent[]; finished: boolean }) { diff --git a/web/src/pages/InsightPages.tsx b/web/src/pages/insights/InsightPages.tsx similarity index 96% rename from web/src/pages/InsightPages.tsx rename to web/src/pages/insights/InsightPages.tsx index ff2add14fe9efac4d27f727fbe7a1b118d5fc474..8352bb2920daa13e9845cd0b400cbe96a52b2c67 100644 --- a/web/src/pages/InsightPages.tsx +++ b/web/src/pages/insights/InsightPages.tsx @@ -1,10 +1,10 @@ import { Badge, Button, Card, Group, Select, SimpleGrid, Stack, Table, Text, TextInput, Title, Tooltip } from '@mantine/core'; import { useMemo, useState } from 'react'; -import { useAudit, useHistory, useMetrics, usePatterns } from '../api/hooks'; -import { getJson } from '../api/client'; -import { ErrorAlert, fmtTs, Pager, pct, Pre, PageHeader } from '../components/common'; -import { DataTable } from '../components/states'; -import './admin.css'; +import { useAudit, useHistory, useMetrics, usePatterns } from '../../api/hooks'; +import { getJson } from '../../api/client'; +import { ErrorAlert, fmtTs, Pager, pct, Pre, PageHeader } from '../../components/common'; +import { DataTable } from '../../components/states'; +import '../setup/admin.css'; /** Accessible inline chart: one bar per run, colour = decision; height = passed share of executed. */ function HistoryChart({ rows }: { rows: { run_id: string; decision: string; counts: Record }[] }) { diff --git a/web/src/pages/QueuesPages.tsx b/web/src/pages/insights/QueuesPages.tsx similarity index 95% rename from web/src/pages/QueuesPages.tsx rename to web/src/pages/insights/QueuesPages.tsx index 71bbf1ca38e229788e3c684453f0e8e6b17e01d6..5079c8f81618152b207b5016d8708ff8907d9b44 100644 --- a/web/src/pages/QueuesPages.tsx +++ b/web/src/pages/insights/QueuesPages.tsx @@ -1,15 +1,15 @@ import { Anchor, Badge, Button, Card, Drawer, Group, Loader, SegmentedControl, Select, Skeleton, Stack, Table, Text, Title } from '@mantine/core'; import { useState } from 'react'; import { Link, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { PRIORITY_WORDS } from '../glossary'; -import { runTitle, shortWhen } from '../runName'; -import type { Ticket } from '../api/types'; -import { FailedScreen } from './FailedScreen'; -import { useDraftAction, useDrafts, useHeal, useHealDecision, useLibraryLog, useRun, useRunFailures, useTicket, useTickets } from '../api/hooks'; -import { Can, Diff, ErrorAlert, fmtTs, Pre, StatusBadge, PageHeader } from '../components/common'; -import { DataTable } from '../components/states'; -import './admin.css'; +import { MODULE_NAMES } from '../../domain/agents'; +import { PRIORITY_WORDS } from '../../domain/glossary'; +import { runTitle, shortWhen } from '../../domain/runName'; +import type { Ticket } from '../../api/types'; +import { FailedScreen } from '../run/FailedScreen'; +import { useDraftAction, useDrafts, useHeal, useHealDecision, useLibraryLog, useRun, useRunFailures, useTicket, useTickets } from '../../api/hooks'; +import { Can, Diff, ErrorAlert, fmtTs, Pre, StatusBadge, PageHeader } from '../../components/common'; +import { DataTable } from '../../components/states'; +import '../setup/admin.css'; export function HealPage() { const [status, setStatus] = useState('pending'); diff --git a/web/src/pages/ImportCasesPage.tsx b/web/src/pages/library/ImportCasesPage.tsx similarity index 96% rename from web/src/pages/ImportCasesPage.tsx rename to web/src/pages/library/ImportCasesPage.tsx index 28a8542bc02b3876369c4071311101412f10879e..c7224c0c2f336b0329ae86cb0fd27db3f2a8c9db 100644 --- a/web/src/pages/ImportCasesPage.tsx +++ b/web/src/pages/library/ImportCasesPage.tsx @@ -1,14 +1,14 @@ import { Alert, Button, Checkbox, Collapse, Group, Radio, Select, Tabs, Textarea, UnstyledButton } from '@mantine/core'; -import { IconChevronDown, IconDownload, IconFileSpreadsheet, IconUpload } from '@/icons'; +import { IconChevronDown, IconDownload, IconFileSpreadsheet, IconUpload } from '@/components/icons'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useRef, useState, type DragEvent, type ReactNode } from 'react'; import { useNavigate, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { ApiError, csrfToken, getJson, sendJson } from '../api/client'; -import { usePods } from '../api/hooks'; -import { useAuth } from '../auth/AuthContext'; -import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { ErrorAlert, PageHeader, VIEWER_START_WORDS } from '../components/common'; +import { MODULE_NAMES } from '../../domain/agents'; +import { ApiError, csrfToken, getJson, sendJson } from '../../api/client'; +import { usePods } from '../../api/hooks'; +import { useAuth } from '../../auth/AuthContext'; +import { CoworkerAvatar } from '../../components/CoworkerAvatar'; +import { ErrorAlert, PageHeader, VIEWER_START_WORDS } from '../../components/common'; import './import-cases.css'; /* ------------------------------------------------------------------ API (custom-cases; not yet in the generated schema) */ diff --git a/web/src/pages/LibraryPages.tsx b/web/src/pages/library/LibraryPages.tsx similarity index 95% rename from web/src/pages/LibraryPages.tsx rename to web/src/pages/library/LibraryPages.tsx index be8111e2e12af8ce3d127e826c5305aab2c7312b..8f7ead1967b5b174826c2356dac909d4ca2b35c3 100644 --- a/web/src/pages/LibraryPages.tsx +++ b/web/src/pages/library/LibraryPages.tsx @@ -2,22 +2,22 @@ import { Anchor, Button, CloseButton, Drawer, Group, Select, Skeleton, Stack, Ta import { useMediaQuery } from '@mantine/hooks'; import { IconAdjustments, IconBooks, IconBrain, IconCalendarTime, IconChevronDown, IconChevronRight, IconFileReport, IconPower, IconRobot, IconSearch, IconShieldCheck, IconUpload, IconUsers, IconWand, -} from '@/icons'; +} from '@/components/icons'; import { useState, type ReactNode } from 'react'; import { useQuery } from '@tanstack/react-query'; import { Link, useParams, useSearchParams } from 'react-router-dom'; -import { getJson } from '../api/client'; -import type { Pattern } from '../api/types'; -import { ScenarioBody } from './ScenarioReview'; -import { MODULE_NAMES } from '../agents'; +import { getJson } from '../../api/client'; +import type { Pattern } from '../../api/types'; +import { ScenarioBody } from '../run/ScenarioReview'; +import { MODULE_NAMES } from '../../domain/agents'; import './library.css'; -import { useHistory, usePods, useRuns, useScenario, useScenarioLibrary, useTickets } from '../api/hooks'; -import { Can, ErrorAlert, GlossaryButton, PageHeader, Pager, Prio } from '../components/common'; -import { envKind } from '../components/shell/EnvSwitcher'; -import { ScenarioSteps } from '../components/shell/panelTabs'; -import { decisionWords } from '../glossary'; -import { runTitle, shortWhen } from '../runName'; -import './admin.css'; +import { useHistory, usePods, useRuns, useScenario, useScenarioLibrary, useTickets } from '../../api/hooks'; +import { Can, ErrorAlert, GlossaryButton, PageHeader, Pager, Prio } from '../../components/common'; +import { envKind } from '../../components/shell/EnvSwitcher'; +import { ScenarioSteps } from '../../components/shell/panelTabs'; +import { decisionWords } from '../../domain/glossary'; +import { runTitle, shortWhen } from '../../domain/runName'; +import '../setup/admin.css'; const DECISION_TONE: Record = { GO: 'green', 'NO-GO': 'red', HELD: 'amber' }; diff --git a/web/src/pages/import-cases.css b/web/src/pages/library/import-cases.css similarity index 100% rename from web/src/pages/import-cases.css rename to web/src/pages/library/import-cases.css diff --git a/web/src/pages/importcases.test.tsx b/web/src/pages/library/importcases.test.tsx similarity index 97% rename from web/src/pages/importcases.test.tsx rename to web/src/pages/library/importcases.test.tsx index 7b383d080b42c04bdc2582d4749b7d73505552fa..2e3e08360bd21c34bf054b09bec939bc546ea378 100644 --- a/web/src/pages/importcases.test.tsx +++ b/web/src/pages/library/importcases.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { Route, Routes } from 'react-router-dom'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; +import { jsonResponse, renderUi } from '../../test/utils'; import { ImportCasesPage, type Batch } from './ImportCasesPage'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); diff --git a/web/src/pages/library.css b/web/src/pages/library/library.css similarity index 100% rename from web/src/pages/library.css rename to web/src/pages/library/library.css diff --git a/web/src/pages/FailedScreen.tsx b/web/src/pages/run/FailedScreen.tsx similarity index 92% rename from web/src/pages/FailedScreen.tsx rename to web/src/pages/run/FailedScreen.tsx index 161e73fd4f44ed7d12e82b4d4c653f93c2aba1f3..079e32b4250a3576d5ae044f290ebdac892e4275 100644 --- a/web/src/pages/FailedScreen.tsx +++ b/web/src/pages/run/FailedScreen.tsx @@ -1,8 +1,8 @@ import { Anchor, Modal, Text, UnstyledButton } from '@mantine/core'; -import { IconExternalLink, IconPhotoOff } from '@/icons'; +import { IconExternalLink, IconPhotoOff } from '@/components/icons'; import { useState } from 'react'; -import type { Failure } from '../api/types'; -import { useAuth } from '../auth/AuthContext'; +import type { Failure } from '../../api/types'; +import { useAuth } from '../../auth/AuthContext'; /** The screen at the moment a scenario failed (its latest attempt), for the column beside a failure decision. * Quick simulations say plainly that there is no screen; with no saved screen yet nothing is shown. */ diff --git a/web/src/pages/FailureReview.tsx b/web/src/pages/run/FailureReview.tsx similarity index 94% rename from web/src/pages/FailureReview.tsx rename to web/src/pages/run/FailureReview.tsx index 4665475de6f93fadbf143ddc9a535bbc90289337..bc63ca21e9322f279e82e34c6bea62e05badcf4a 100644 --- a/web/src/pages/FailureReview.tsx +++ b/web/src/pages/run/FailureReview.tsx @@ -1,12 +1,12 @@ import { Alert, Button, Group, Radio, SimpleGrid, Stack, Text, TextInput } from '@mantine/core'; -import { IconBulb, IconPhoto } from '@/icons'; +import { IconBulb, IconPhoto } from '@/components/icons'; import { useState } from 'react'; -import { useAuth } from '../auth/AuthContext'; -import { useHumanReview, useRun, useRunFailures } from '../api/hooks'; +import { useAuth } from '../../auth/AuthContext'; +import { useHumanReview, useRun, useRunFailures } from '../../api/hooks'; import { FailedScreen } from './FailedScreen'; -import type { Failure } from '../api/types'; -import { Can, ErrorAlert, Pill, Term } from '../components/common'; -import { reviewAnswer, type FailureChoice } from '../glossary'; +import type { Failure } from '../../api/types'; +import { Can, ErrorAlert, Pill, Term } from '../../components/common'; +import { reviewAnswer, type FailureChoice } from '../../domain/glossary'; import { Presence } from './ScenarioReview'; import './review.css'; import './split.css'; diff --git a/web/src/pages/LiveOverlay.test.ts b/web/src/pages/run/LiveOverlay.test.ts similarity index 97% rename from web/src/pages/LiveOverlay.test.ts rename to web/src/pages/run/LiveOverlay.test.ts index f73a0bee1bbff33df3834c90ba4e2f44c6ca2b8d..159f0a9ef920b8a2d6ae20f31548f210572e0101 100644 --- a/web/src/pages/LiveOverlay.test.ts +++ b/web/src/pages/run/LiveOverlay.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import type { LiveStatus } from '../api/types'; +import type { LiveStatus } from '../../api/types'; import { liveOverlay, RELOAD_AFTER_MS, type LiveCtx } from './LiveView'; const live = (over: Partial = {}): LiveStatus => ({ diff --git a/web/src/pages/LiveView.tsx b/web/src/pages/run/LiveView.tsx similarity index 97% rename from web/src/pages/LiveView.tsx rename to web/src/pages/run/LiveView.tsx index 376a183edf4c63e192ae9992caae78429c4d1203..78b4206be3d2253ee097b69435e20301629435d6 100644 --- a/web/src/pages/LiveView.tsx +++ b/web/src/pages/run/LiveView.tsx @@ -1,11 +1,11 @@ import { Button, Modal, Text } from '@mantine/core'; -import { IconArrowsMaximize, IconCheck, IconEye, IconLock, IconPlayerPause, IconPlayerPlay, IconRefresh, IconShieldLock, IconUserCheck, IconX } from '@/icons'; +import { IconArrowsMaximize, IconCheck, IconEye, IconLock, IconPlayerPause, IconPlayerPlay, IconRefresh, IconShieldLock, IconUserCheck, IconX } from '@/components/icons'; import { useEffect, useRef, useState, type ReactElement } from 'react'; import { Link } from 'react-router-dom'; -import { useLive } from '../api/hooks'; -import type { LiveStatus } from '../api/types'; -import { useAuth } from '../auth/AuthContext'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; +import { useLive } from '../../api/hooks'; +import type { LiveStatus } from '../../api/types'; +import { useAuth } from '../../auth/AuthContext'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; const WAITING = ['waiting_approval', 'waiting_review']; const RUNNING = ['queued', 'running']; diff --git a/web/src/pages/RunCases.tsx b/web/src/pages/run/RunCases.tsx similarity index 96% rename from web/src/pages/RunCases.tsx rename to web/src/pages/run/RunCases.tsx index 0248ffbcfd7182702a42d28d15e1279868a6a703..4c50ec9b2519a05885f5a6e09ac670db05e87053 100644 --- a/web/src/pages/RunCases.tsx +++ b/web/src/pages/run/RunCases.tsx @@ -1,8 +1,8 @@ import { Alert, Badge, Button, Card, Checkbox, Drawer, Group, Loader, Stack, Table, Text, TextInput, Title } from '@mantine/core'; import { useEffect, useMemo, useState } from 'react'; -import { useApproveCases, useCaseYaml, useCases, useGate } from '../api/hooks'; -import type { ApproveGate, PendingCase } from '../api/types'; -import { Can, Diff, ErrorAlert, Pre } from '../components/common'; +import { useApproveCases, useCaseYaml, useCases, useGate } from '../../api/hooks'; +import type { ApproveGate, PendingCase } from '../../api/types'; +import { Can, Diff, ErrorAlert, Pre } from '../../components/common'; function CasePreview({ c, onClose }: { c: PendingCase | null; onClose: () => void }) { const yaml = useCaseYaml(c && c.origin === 'library' ? c.id : null); diff --git a/web/src/pages/RunData.tsx b/web/src/pages/run/RunData.tsx similarity index 95% rename from web/src/pages/RunData.tsx rename to web/src/pages/run/RunData.tsx index 73dc4ed95c1e4759d5757e757684785d759ec012..aee38c20a6cb3c46dc20ccde1e04423ea347c8d6 100644 --- a/web/src/pages/RunData.tsx +++ b/web/src/pages/run/RunData.tsx @@ -1,6 +1,6 @@ import { Badge, Card, Loader, Stack, Table, Text, Title } from '@mantine/core'; -import { useDataPlan, useScripts } from '../api/hooks'; -import { ErrorAlert, StatusBadge } from '../components/common'; +import { useDataPlan, useScripts } from '../../api/hooks'; +import { ErrorAlert, StatusBadge } from '../../components/common'; const DATA_COLOR: Record = { found: 'teal', not_found: 'red', seeded: 'dark', seed_refused: 'orange', unsupported: 'gray', skipped: 'gray' }; diff --git a/web/src/pages/RunGuide.test.ts b/web/src/pages/run/RunGuide.test.ts similarity index 100% rename from web/src/pages/RunGuide.test.ts rename to web/src/pages/run/RunGuide.test.ts diff --git a/web/src/pages/RunGuide.tsx b/web/src/pages/run/RunGuide.tsx similarity index 96% rename from web/src/pages/RunGuide.tsx rename to web/src/pages/run/RunGuide.tsx index ed9b2cbf50ea641cad812c57ba79a8fbdefa388b..ee8e1232712f94fb5667a8dcea644a124ea32039 100644 --- a/web/src/pages/RunGuide.tsx +++ b/web/src/pages/run/RunGuide.tsx @@ -1,16 +1,16 @@ -import { LazyGlobe } from '../components/three/LazyGlobe'; +import { LazyGlobe } from '../../components/three/LazyGlobe'; import { Alert, Button, Group, Progress, Stack, Stepper, Text, TextInput, UnstyledButton } from '@mantine/core'; import { notifications } from '@mantine/notifications'; -import { IconArrowLeft, IconEye, IconCircleCheck, IconCircleDashed, IconFileSpreadsheet, IconFileReport, IconListDetails, IconLoader2, IconPhotoOff } from '@/icons'; +import { IconArrowLeft, IconEye, IconCircleCheck, IconCircleDashed, IconFileSpreadsheet, IconFileReport, IconListDetails, IconLoader2, IconPhotoOff } from '@/components/icons'; import { useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import type { Schemas } from '../api/client'; -import { useApproveCases, useGate, usePods, useHumanReview, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks'; -import type { ApproveGate, Failure } from '../api/types'; -import { Can, ErrorAlert } from '../components/common'; -import { decisionWords, reviewAnswer, type FailureChoice } from '../glossary'; +import type { Schemas } from '../../api/client'; +import { useApproveCases, useGate, usePods, useHumanReview, useRunAction, useRunFailures, useRunReadiness } from '../../api/hooks'; +import type { ApproveGate, Failure } from '../../api/types'; +import { Can, ErrorAlert } from '../../components/common'; +import { decisionWords, reviewAnswer, type FailureChoice } from '../../domain/glossary'; import { FailedScreen } from './FailedScreen'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; import { LiveView } from './LiveView'; import { Presence } from './RunStage'; import { ScenarioReview } from './ScenarioReview'; diff --git a/web/src/pages/RunPage.tsx b/web/src/pages/run/RunPage.tsx similarity index 94% rename from web/src/pages/RunPage.tsx rename to web/src/pages/run/RunPage.tsx index 956672e45283712d45ea080ee07f4b52650981dd..accc117c7f75e6193d61aeb173e343feb5293317 100644 --- a/web/src/pages/RunPage.tsx +++ b/web/src/pages/run/RunPage.tsx @@ -1,19 +1,19 @@ import { PREPARE_NODES } from './RunGuide'; -import { useWaitsOnMe, waitingForWords } from '../waiting'; +import { useWaitsOnMe, waitingForWords } from '../../domain/waiting'; import { Anchor, Button, Group, Stack, Text, Textarea } from '@mantine/core'; -import { IconExternalLink, IconFileTypePdf, IconHandStop, IconMessage, IconRobot, IconSend } from '@/icons'; +import { IconExternalLink, IconFileTypePdf, IconHandStop, IconMessage, IconRobot, IconSend } from '@/components/icons'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; -import { AGENT_BY_NODE, stepName } from '../agents'; -import { shortWhenSec } from '../runName'; -import { api, unwrap } from '../api/client'; -import { useGraphSpec, useReport, useRun, useRunReadiness, useTemporal } from '../api/hooks'; -import { decisionWords } from '../glossary'; -import { ModuleCard, PatchChanges } from './ReadinessPage'; -import { Can, ErrorAlert, fmtTs, Pill } from '../components/common'; -import { GraphView } from '../components/GraphView'; -import { nodeStates, useRunStream, type RunEvent } from '../hooks/useRunStream'; +import { AGENT_BY_NODE, stepName } from '../../domain/agents'; +import { shortWhenSec } from '../../domain/runName'; +import { api, unwrap } from '../../api/client'; +import { useGraphSpec, useReport, useRun, useRunReadiness, useTemporal } from '../../api/hooks'; +import { decisionWords } from '../../domain/glossary'; +import { ModuleCard, PatchChanges } from '../home/ReadinessPage'; +import { Can, ErrorAlert, fmtTs, Pill } from '../../components/common'; +import { GraphView } from '../../components/GraphView'; +import { nodeStates, useRunStream, type RunEvent } from '../../hooks/useRunStream'; export const TERMINAL = ['completed', 'failed', 'killed', 'cancelled']; const HIDDEN_KEYS = new Set(['node', 'traceback', 'audit_seq', 'keys', 'module', 'message']); // an agent's message is shown in full diff --git a/web/src/pages/RunProof.tsx b/web/src/pages/run/RunProof.tsx similarity index 94% rename from web/src/pages/RunProof.tsx rename to web/src/pages/run/RunProof.tsx index c7bc1abf9ce4703e8a7bf2a2d5291d99ef99614e..7161509cca7c57e898a7ca5ef4873fe12d107054 100644 --- a/web/src/pages/RunProof.tsx +++ b/web/src/pages/run/RunProof.tsx @@ -1,12 +1,12 @@ import { Anchor, Button, Group, Image, Modal, SegmentedControl, SimpleGrid, Stack, Text, TextInput, Title, UnstyledButton } from '@mantine/core'; -import { IconExternalLink, IconListNumbers, IconLock, IconPhoto, IconPhotoOff, IconSearch } from '@/icons'; +import { IconExternalLink, IconListNumbers, IconLock, IconPhoto, IconPhotoOff, IconSearch } from '@/components/icons'; import { useMemo, useState } from 'react'; -import { useEvidence, useRunScenarios } from '../api/hooks'; -import type { Evidence } from '../api/types'; -import { Can, ErrorAlert, Pager } from '../components/common'; -import { EmptyState, LoadingState } from '../components/states'; +import { useEvidence, useRunScenarios } from '../../api/hooks'; +import type { Evidence } from '../../api/types'; +import { Can, ErrorAlert, Pager } from '../../components/common'; +import { EmptyState, LoadingState } from '../../components/states'; import './report.css'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; const PAGE = 6; const OUTCOME: Record = { passed: ['green', 'Passed'], failed: ['red', 'Failed'], skipped: ['neutral', 'Not run'] }; diff --git a/web/src/pages/RunReport.tsx b/web/src/pages/run/RunReport.tsx similarity index 93% rename from web/src/pages/RunReport.tsx rename to web/src/pages/run/RunReport.tsx index a33505407ca238f8c4583f7564d70386154ce9e1..4e652f5a775294aa719f8a4533e17afeea348e0f 100644 --- a/web/src/pages/RunReport.tsx +++ b/web/src/pages/run/RunReport.tsx @@ -1,11 +1,11 @@ import { Anchor, Button, Group, SegmentedControl, Stack, Table, Text, Title } from '@mantine/core'; import { useEffect, useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { IconFileReport } from '@/icons'; -import { api, errorMessage, unwrap } from '../api/client'; -import { useEvidence, useReport } from '../api/hooks'; -import { Can, DecisionBadge, ErrorAlert } from '../components/common'; -import { EmptyState, LoadingState } from '../components/states'; +import { IconFileReport } from '@/components/icons'; +import { api, errorMessage, unwrap } from '../../api/client'; +import { useEvidence, useReport } from '../../api/hooks'; +import { Can, DecisionBadge, ErrorAlert } from '../../components/common'; +import { EmptyState, LoadingState } from '../../components/states'; import './report.css'; /** The technical report (admin view): the exact rule result per area, the counts, the criteria, the open gaps, the diff --git a/web/src/pages/RunResearch.tsx b/web/src/pages/run/RunResearch.tsx similarity index 96% rename from web/src/pages/RunResearch.tsx rename to web/src/pages/run/RunResearch.tsx index bb5a78011ded62c1604d319bd1c7decf51212ba4..a88396fc819e718a9376085aba39c1a3d31892ea 100644 --- a/web/src/pages/RunResearch.tsx +++ b/web/src/pages/run/RunResearch.tsx @@ -1,8 +1,8 @@ import { Anchor, Badge, Card, Checkbox, Group, Loader, Progress, SegmentedControl, SimpleGrid, Stack, Table, Text, Title } from '@mantine/core'; import { useMemo, useState } from 'react'; -import { useResearch } from '../api/hooks'; -import type { CoverageRow } from '../api/types'; -import { ErrorAlert } from '../components/common'; +import { useResearch } from '../../api/hooks'; +import type { CoverageRow } from '../../api/types'; +import { ErrorAlert } from '../../components/common'; export function RunResearch({ id }: { id: string }) { const q = useResearch(id); diff --git a/web/src/pages/RunStage.tsx b/web/src/pages/run/RunStage.tsx similarity index 90% rename from web/src/pages/RunStage.tsx rename to web/src/pages/run/RunStage.tsx index eeefe19e4f16239cde7c730380fe6ce65911352b..8fdea2ffc4103065f5cb7c6243976ade4032c511 100644 --- a/web/src/pages/RunStage.tsx +++ b/web/src/pages/run/RunStage.tsx @@ -1,13 +1,13 @@ import { Collapse, UnstyledButton } from '@mantine/core'; -import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconLoader2, IconUserCheck } from '@/icons'; +import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconLoader2, IconUserCheck } from '@/components/icons'; import { useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import { agentName } from '../agents'; -import { useGraphSpec } from '../api/hooks'; -import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { coworkerForNode } from '../coworkers'; -import { nodeStates, type RunEvent } from '../hooks/useRunStream'; -import { AgentSteps, STEP_WORDS } from './AssistantPage'; +import { agentName } from '../../domain/agents'; +import { useGraphSpec } from '../../api/hooks'; +import { CoworkerAvatar } from '../../components/CoworkerAvatar'; +import { coworkerForNode } from '../../domain/coworkers'; +import { nodeStates, type RunEvent } from '../../hooks/useRunStream'; +import { AgentSteps, STEP_WORDS } from '../insights/AssistantPage'; export type GuideStage = 'prepare' | 'approve' | 'testing' | 'judge' | 'result' | 'stopped'; diff --git a/web/src/pages/RunStages.tsx b/web/src/pages/run/RunStages.tsx similarity index 94% rename from web/src/pages/RunStages.tsx rename to web/src/pages/run/RunStages.tsx index 40f03d8da2d9476126160f2b2fd70fb82f93f4c2..2839ed0a77b195542ab500986ac0e53e74f98821 100644 --- a/web/src/pages/RunStages.tsx +++ b/web/src/pages/run/RunStages.tsx @@ -1,20 +1,20 @@ import './cockpit.css'; -import { isWaiting, useWaitsOnMe, waitingForWords } from '../waiting'; +import { isWaiting, useWaitsOnMe, waitingForWords } from '../../domain/waiting'; import { Button, CopyButton, Tooltip } from '@mantine/core'; -import { IconCheck, IconCopy, IconX } from '@/icons'; +import { IconCheck, IconCopy, IconX } from '@/components/icons'; import { useEffect, useRef, useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { usePods, useRun, useRunReadiness, useRunScenarios } from '../api/hooks'; -import type { ModuleReadiness } from '../api/types'; -import { Can, ErrorAlert } from '../components/common'; -import { EnvBadge, envKind } from '../components/shell/EnvSwitcher'; -import { useShell } from '../components/shell/prefs'; -import { useSimpleMode } from '../components/shell/simpleMode'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; -import { decisionWords } from '../glossary'; -import { useRunStream } from '../hooks/useRunStream'; -import { runAreas, shortWhen } from '../runName'; +import { MODULE_NAMES } from '../../domain/agents'; +import { usePods, useRun, useRunReadiness, useRunScenarios } from '../../api/hooks'; +import type { ModuleReadiness } from '../../api/types'; +import { Can, ErrorAlert } from '../../components/common'; +import { EnvBadge, envKind } from '../../components/shell/EnvSwitcher'; +import { useShell } from '../../components/shell/prefs'; +import { useSimpleMode } from '../../components/shell/simpleMode'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; +import { decisionWords } from '../../domain/glossary'; +import { useRunStream } from '../../hooks/useRunStream'; +import { runAreas, shortWhen } from '../../domain/runName'; import { useCanWatch } from './LiveView'; import { Approve, guideStage, Judge, Prepare, Result, scriptUrl, Stopped, Testing } from './RunGuide'; import { StageCard, TeamStrip, type GuideStage } from './RunStage'; diff --git a/web/src/pages/RunTriage.tsx b/web/src/pages/run/RunTriage.tsx similarity index 95% rename from web/src/pages/RunTriage.tsx rename to web/src/pages/run/RunTriage.tsx index 1bffda915d7d7d9e9c75cb9b2823bfe43f052b82..cfe92b874ceaf9a49cc7d2dadfad8e1d9320e73f 100644 --- a/web/src/pages/RunTriage.tsx +++ b/web/src/pages/run/RunTriage.tsx @@ -1,8 +1,8 @@ import { Alert, Badge, Button, Card, Group, Loader, Radio, Stack, Table, Text, TextInput, Title } from '@mantine/core'; import { useState } from 'react'; -import { useGate, useHumanReview, useResults } from '../api/hooks'; -import type { ReviewGate, ReviewItem } from '../api/types'; -import { Can, ErrorAlert, pct } from '../components/common'; +import { useGate, useHumanReview, useResults } from '../../api/hooks'; +import type { ReviewGate, ReviewItem } from '../../api/types'; +import { Can, ErrorAlert, pct } from '../../components/common'; type Answer = { confirmed?: 'real_defect' | 'not_defect'; waiver?: string; owner?: string; note?: string }; diff --git a/web/src/pages/RunWorkflow.tsx b/web/src/pages/run/RunWorkflow.tsx similarity index 89% rename from web/src/pages/RunWorkflow.tsx rename to web/src/pages/run/RunWorkflow.tsx index 35bff29b2c90197d9e2137cbc9eea6cf724e68a9..26683d8bfa5cf3419bf196b9066bb9a2b19ace37 100644 --- a/web/src/pages/RunWorkflow.tsx +++ b/web/src/pages/run/RunWorkflow.tsx @@ -1,4 +1,4 @@ -import type { LlmCall } from '../agents'; +import type { LlmCall } from '../../domain/agents'; import { TeamBoard } from './TeamBoard'; /** The workflow of a test run, shown as the team board (kept as RunWorkflow for callers). */ diff --git a/web/src/pages/RunWorkspace.tsx b/web/src/pages/run/RunWorkspace.tsx similarity index 93% rename from web/src/pages/RunWorkspace.tsx rename to web/src/pages/run/RunWorkspace.tsx index 4393b26d33ace2eaf8193d993b98854ac8e76302..0b259896d08ba2fc26d9dabae909387bf7b166b8 100644 --- a/web/src/pages/RunWorkspace.tsx +++ b/web/src/pages/run/RunWorkspace.tsx @@ -1,28 +1,28 @@ import { Button, Group, Menu, Modal, Skeleton, Stack, Text, Textarea, Tooltip } from '@mantine/core'; -import { NavTabs } from '../components/NavTabs'; +import { NavTabs } from '../../components/NavTabs'; import './run.css'; import { notifications } from '@mantine/notifications'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { IconArrowLeft, IconChevronDown, IconLayoutSidebarRight, IconLayoutSidebarRightCollapse, IconPlayerPlay } from '@/icons'; +import { IconArrowLeft, IconChevronDown, IconLayoutSidebarRight, IconLayoutSidebarRightCollapse, IconPlayerPlay } from '@/components/icons'; import { useEffect, useRef, useState, type ReactNode } from 'react'; import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { api, unwrap } from '../api/client'; -import { useEvidence, useGate, useLive, usePods, useRun, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks'; -import type { ApproveGate } from '../api/types'; -import { useAuth } from '../auth/AuthContext'; -import { Can, DecisionBadge, ErrorAlert, GlossaryList } from '../components/common'; -import { EmptyState } from '../components/shell/EmptyState'; -import { envKind, useChosenEnv } from '../components/shell/EnvSwitcher'; -import { ExcelPanel, ReportSummary, ScenarioSteps } from '../components/shell/panelTabs'; -import { PANEL_TABS, useShell, type PanelTab } from '../components/shell/prefs'; -import { SidePanel, SidePanelProvider, useSidePanel } from '../components/shell/SidePanel'; -import { TopBar } from '../components/shell/TopBar'; -import { runAreas, runTitle, shortWhen } from '../runName'; -import { rowWords, runStatusWords } from '../components/shell/RunListItem'; -import { runState } from '../components/shell/StatusDot'; -import { useWaitsOnMe } from '../waiting'; -import { TextShimmer } from '../components/wensity/text-shimmer'; +import { MODULE_NAMES } from '../../domain/agents'; +import { api, unwrap } from '../../api/client'; +import { useEvidence, useGate, useLive, usePods, useRun, useRunAction, useRunFailures, useRunReadiness } from '../../api/hooks'; +import type { ApproveGate } from '../../api/types'; +import { useAuth } from '../../auth/AuthContext'; +import { Can, DecisionBadge, ErrorAlert, GlossaryList } from '../../components/common'; +import { EmptyState } from '../../components/shell/EmptyState'; +import { envKind, useChosenEnv } from '../../components/shell/EnvSwitcher'; +import { ExcelPanel, ReportSummary, ScenarioSteps } from '../../components/shell/panelTabs'; +import { PANEL_TABS, useShell, type PanelTab } from '../../components/shell/prefs'; +import { SidePanel, SidePanelProvider, useSidePanel } from '../../components/shell/SidePanel'; +import { TopBar } from '../../components/shell/TopBar'; +import { runAreas, runTitle, shortWhen } from '../../domain/runName'; +import { rowWords, runStatusWords } from '../../components/shell/RunListItem'; +import { runState } from '../../components/shell/StatusDot'; +import { useWaitsOnMe } from '../../domain/waiting'; +import { TextShimmer } from '../../components/wensity/text-shimmer'; import { RunStages } from './RunStages'; import { FailureReview } from './FailureReview'; import { LiveView, NowTesting, useCanWatch } from './LiveView'; diff --git a/web/src/pages/ScenarioReview.tsx b/web/src/pages/run/ScenarioReview.tsx similarity index 96% rename from web/src/pages/ScenarioReview.tsx rename to web/src/pages/run/ScenarioReview.tsx index 46daed7e2e3fb560850e20ca18980b738ac6a6b2..44164215fcb795e04675826ca11323dd581a5ae5 100644 --- a/web/src/pages/ScenarioReview.tsx +++ b/web/src/pages/run/ScenarioReview.tsx @@ -1,15 +1,15 @@ import { ActionIcon, Accordion, Alert, Button, Collapse, Group, Modal, SimpleGrid, Skeleton, Stack, Table, Text, Textarea, Tooltip, UnstyledButton } from '@mantine/core'; -import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconCode, IconListNumbers, IconUser, IconWorldOff } from '@/icons'; +import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconCode, IconListNumbers, IconUser, IconWorldOff } from '@/components/icons'; import { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react'; -import { useApproveCases, useCaseYaml, useGate, useRun, useRunScenarios } from '../api/hooks'; -import type { AiDraft, ApproveGate, DryRun, PendingCase, Scenario } from '../api/types'; -import { AiText, Can, Diff, ErrorAlert, Pill, Prio, Pre, Term } from '../components/common'; -import { FilterChips } from '../components/shell/FilterChips'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; -import { PRIORITY_WORDS } from '../glossary'; -import { shortWhen } from '../runName'; -import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { coworkerForNode } from '../coworkers'; +import { useApproveCases, useCaseYaml, useGate, useRun, useRunScenarios } from '../../api/hooks'; +import type { AiDraft, ApproveGate, DryRun, PendingCase, Scenario } from '../../api/types'; +import { AiText, Can, Diff, ErrorAlert, Pill, Prio, Pre, Term } from '../../components/common'; +import { FilterChips } from '../../components/shell/FilterChips'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; +import { PRIORITY_WORDS } from '../../domain/glossary'; +import { shortWhen } from '../../domain/runName'; +import { CoworkerAvatar } from '../../components/CoworkerAvatar'; +import { coworkerForNode } from '../../domain/coworkers'; import { ScenarioSplit } from './ScenarioSplit'; import './review.css'; diff --git a/web/src/pages/ScenarioSplit.tsx b/web/src/pages/run/ScenarioSplit.tsx similarity index 95% rename from web/src/pages/ScenarioSplit.tsx rename to web/src/pages/run/ScenarioSplit.tsx index af25b506a1405d8484483fa89fcb9062b675b890..2759960a43442d2599bf4b553e0e4da9dd9bf1f0 100644 --- a/web/src/pages/ScenarioSplit.tsx +++ b/web/src/pages/run/ScenarioSplit.tsx @@ -1,8 +1,8 @@ import { TextInput } from '@mantine/core'; -import { IconListCheck, IconSearch } from '@/icons'; +import { IconListCheck, IconSearch } from '@/components/icons'; import { useMemo, useState, type ComponentType } from 'react'; -import type { Scenario } from '../api/types'; -import { useSidePanelOptional } from '../components/shell/SidePanel'; +import type { Scenario } from '../../api/types'; +import { useSidePanelOptional } from '../../components/shell/SidePanel'; import './split.css'; type Kind = 'fail' | 'flaky' | 'pass' | 'todo'; diff --git a/web/src/pages/SignOffReport.tsx b/web/src/pages/run/SignOffReport.tsx similarity index 96% rename from web/src/pages/SignOffReport.tsx rename to web/src/pages/run/SignOffReport.tsx index 70f32e526c43e7a9f3d9ceb2a767ec503f231f3c..028795f550156767c29806b85f7606aeba315410 100644 --- a/web/src/pages/SignOffReport.tsx +++ b/web/src/pages/run/SignOffReport.tsx @@ -1,18 +1,18 @@ import { Accordion, Anchor, Button, CopyButton, Group, Menu, Modal, Skeleton, Stack, Table, Text, Textarea, Title } from '@mantine/core'; -import { IconAlertTriangle, IconBug, IconCheck, IconChecklist, IconChevronDown, IconDownload, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconPlayerPause, IconSignature } from '@/icons'; +import { IconAlertTriangle, IconBug, IconCheck, IconChecklist, IconChevronDown, IconDownload, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconPlayerPause, IconSignature } from '@/components/icons'; import { useEffect, useRef, useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import { MODULE_NAMES, STEP_WORDS } from '../agents'; -import { useReport, useRun, useRunReadiness, useSignOff, useTickets } from '../api/hooks'; -import { Can, DecisionBadge, ErrorAlert, fmtTs, RuleResult } from '../components/common'; -import { CoworkerAvatar } from '../components/CoworkerAvatar'; -import { DataTable } from '../components/states'; -import { coworkerForNode } from '../coworkers'; +import { MODULE_NAMES, STEP_WORDS } from '../../domain/agents'; +import { useReport, useRun, useRunReadiness, useSignOff, useTickets } from '../../api/hooks'; +import { Can, DecisionBadge, ErrorAlert, fmtTs, RuleResult } from '../../components/common'; +import { CoworkerAvatar } from '../../components/CoworkerAvatar'; +import { DataTable } from '../../components/states'; +import { coworkerForNode } from '../../domain/coworkers'; import './report.css'; -import { shortWhen } from '../runName'; +import { shortWhen } from '../../domain/runName'; import { scriptUrl } from './RunGuide'; -import { DECISION_WORDS, RUN_STATUS_WORDS } from '../glossary'; -import type { Criterion } from '../api/types'; +import { DECISION_WORDS, RUN_STATUS_WORDS } from '../../domain/glossary'; +import type { Criterion } from '../../api/types'; const CHECK_NAMES: Record = { C1: 'Coverage', C2: 'Critical and High scenarios', C3: 'Stability', C4: 'False failures', C5: 'Independent recount', C6: 'Honest labelling' }; const CRITERIA_WORDS: Record = { diff --git a/web/src/pages/TeamBoard.test.tsx b/web/src/pages/run/TeamBoard.test.tsx similarity index 97% rename from web/src/pages/TeamBoard.test.tsx rename to web/src/pages/run/TeamBoard.test.tsx index 81c7fa09ba08f902f2be5581bce69c9b75c27d23..4797ea483c33d23e11c53c269277b40512d95fd0 100644 --- a/web/src/pages/TeamBoard.test.tsx +++ b/web/src/pages/run/TeamBoard.test.tsx @@ -1,7 +1,7 @@ import { act, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { RunEvent } from '../hooks/useRunStream'; -import { jsonResponse, renderUi } from '../test/utils'; +import type { RunEvent } from '../../hooks/useRunStream'; +import { jsonResponse, renderUi } from '../../test/utils'; import { agentFacts, didWords, duration, TeamBoardView } from './TeamBoard'; const T0 = new Date('2026-10-17T10:00:00Z').getTime(); diff --git a/web/src/pages/TeamBoard.tsx b/web/src/pages/run/TeamBoard.tsx similarity index 96% rename from web/src/pages/TeamBoard.tsx rename to web/src/pages/run/TeamBoard.tsx index ab73e302f356377e13c0967e02fb945860fb50ce..48d4b4b95a646a6b728ac07f08ffa7e460e6d54b 100644 --- a/web/src/pages/TeamBoard.tsx +++ b/web/src/pages/run/TeamBoard.tsx @@ -1,17 +1,17 @@ import { Button, Drawer, Popover, Skeleton, Stack, Text, UnstyledButton } from '@mantine/core'; import { IconAlertTriangle, IconCircleCheck, IconCircleDashed, IconCircleMinus, IconCircleX, IconLoader2, IconPlayerPause, IconPlayerPlay, IconRepeat, IconRobot, IconUserCheck, -} from '@/icons'; +} from '@/components/icons'; import { useEffect, useMemo, useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import { AGENT_BY_NODE, agentEngineOnRun, aiOnRun, ENGINE_WORDS, STEP_WORDS, stepName, type AgentDef, type Engine, type EngineKind, type EngineOnRun, type LlmCall } from '../agents'; -import { useGraphSpec, useRunAction } from '../api/hooks'; -import { useAuth } from '../auth/AuthContext'; -import { Can, ErrorAlert } from '../components/common'; -import { LAYOUT } from '../components/GraphView'; -import { useShell } from '../components/shell/prefs'; -import { decisionWords } from '../glossary'; -import { nodeStates, useRunStream, type NodeState, type RunEvent } from '../hooks/useRunStream'; +import { AGENT_BY_NODE, agentEngineOnRun, aiOnRun, ENGINE_WORDS, STEP_WORDS, stepName, type AgentDef, type Engine, type EngineKind, type EngineOnRun, type LlmCall } from '../../domain/agents'; +import { useGraphSpec, useRunAction } from '../../api/hooks'; +import { useAuth } from '../../auth/AuthContext'; +import { Can, ErrorAlert } from '../../components/common'; +import { LAYOUT } from '../../components/GraphView'; +import { useShell } from '../../components/shell/prefs'; +import { decisionWords } from '../../domain/glossary'; +import { nodeStates, useRunStream, type NodeState, type RunEvent } from '../../hooks/useRunStream'; import { FeedCard } from './RunPage'; export const PHASE_WORDS: Record = { Research: 'Understand', Design: 'Choose', 'Data + scripts': 'Prepare', Execute: 'Test', Triage: 'Analyse', Report: 'Report' }; diff --git a/web/src/pages/cockpit.css b/web/src/pages/run/cockpit.css similarity index 100% rename from web/src/pages/cockpit.css rename to web/src/pages/run/cockpit.css diff --git a/web/src/pages/report.css b/web/src/pages/run/report.css similarity index 100% rename from web/src/pages/report.css rename to web/src/pages/run/report.css diff --git a/web/src/pages/review.css b/web/src/pages/run/review.css similarity index 100% rename from web/src/pages/review.css rename to web/src/pages/run/review.css diff --git a/web/src/pages/run.css b/web/src/pages/run/run.css similarity index 100% rename from web/src/pages/run.css rename to web/src/pages/run/run.css diff --git a/web/src/pages/runResearchRelease.test.tsx b/web/src/pages/run/runResearchRelease.test.tsx similarity index 96% rename from web/src/pages/runResearchRelease.test.tsx rename to web/src/pages/run/runResearchRelease.test.tsx index 0d3517d761ca668c7545f4358c918e364c405030..8f1a94cbdeb1bf275971a7df92359c376cc47444 100644 --- a/web/src/pages/runResearchRelease.test.tsx +++ b/web/src/pages/run/runResearchRelease.test.tsx @@ -1,6 +1,6 @@ import { screen, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; +import { jsonResponse, renderUi } from '../../test/utils'; import { RunResearch } from './RunResearch'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); diff --git a/web/src/pages/split.css b/web/src/pages/run/split.css similarity index 100% rename from web/src/pages/split.css rename to web/src/pages/run/split.css diff --git a/web/src/pages/RunsPage.tsx b/web/src/pages/runs/RunsPage.tsx similarity index 94% rename from web/src/pages/RunsPage.tsx rename to web/src/pages/runs/RunsPage.tsx index 17065184ef992b101cf469a115cced0b456940ff..fbd42cffdec30581b0d207fa35acfe845cc2b3e0 100644 --- a/web/src/pages/RunsPage.tsx +++ b/web/src/pages/runs/RunsPage.tsx @@ -1,19 +1,19 @@ import { ActionIcon, Button, Group, Menu, Select, Stack, Table, Text } from '@mantine/core'; -import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleDashed, IconCloud, IconDots, IconPlus, IconShieldLock } from '@/icons'; +import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleDashed, IconCloud, IconDots, IconPlus, IconShieldLock } from '@/components/icons'; import { useState } from 'react'; import { Link, useNavigate, useSearchParams } from 'react-router-dom'; -import type { Schemas } from '../api/client'; -import { MODULE_NAMES } from '../agents'; -import { RUN_STATUS_WORDS } from '../glossary'; -import { usePodProfile, usePods, useRunAction, useRuns } from '../api/hooks'; -import { Can, ErrorAlert, GlossaryButton, PageHeader, Pager, StartRunGate } from '../components/common'; -import { envKind } from '../components/shell/EnvSwitcher'; -import { FilterChips } from '../components/shell/FilterChips'; -import { rowWords, runStatusWords } from '../components/shell/RunListItem'; -import { isWaiting, useWaitsOnMe } from '../waiting'; -import { useShell } from '../components/shell/prefs'; -import { runState } from '../components/shell/StatusDot'; -import { runTitle, shortWhen } from '../runName'; +import type { Schemas } from '../../api/client'; +import { MODULE_NAMES } from '../../domain/agents'; +import { RUN_STATUS_WORDS } from '../../domain/glossary'; +import { usePodProfile, usePods, useRunAction, useRuns } from '../../api/hooks'; +import { Can, ErrorAlert, GlossaryButton, PageHeader, Pager, StartRunGate } from '../../components/common'; +import { envKind } from '../../components/shell/EnvSwitcher'; +import { FilterChips } from '../../components/shell/FilterChips'; +import { rowWords, runStatusWords } from '../../components/shell/RunListItem'; +import { isWaiting, useWaitsOnMe } from '../../domain/waiting'; +import { useShell } from '../../components/shell/prefs'; +import { runState } from '../../components/shell/StatusDot'; +import { runTitle, shortWhen } from '../../domain/runName'; import './runs.css'; type Run = Schemas['RunSummary']; diff --git a/web/src/pages/ScheduledRunsPage.tsx b/web/src/pages/runs/ScheduledRunsPage.tsx similarity index 96% rename from web/src/pages/ScheduledRunsPage.tsx rename to web/src/pages/runs/ScheduledRunsPage.tsx index bc5683bf5d133425914f4b4e10efb57887cb3268..12052a3a71a340eb06f63da3d2cc0e0845456598 100644 --- a/web/src/pages/ScheduledRunsPage.tsx +++ b/web/src/pages/runs/ScheduledRunsPage.tsx @@ -1,15 +1,15 @@ import { ActionIcon, Alert, Button, Drawer, Group, Menu, Modal, MultiSelect, NumberInput, SegmentedControl, Select, Skeleton, Stack, Switch, Text, TextInput } from '@mantine/core'; -import { IconClock, IconDots, IconPencil, IconPlus, IconTrash } from '@/icons'; +import { IconClock, IconDots, IconPencil, IconPlus, IconTrash } from '@/components/icons'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { api, ApiError, sendJson, unwrap } from '../api/client'; -import { useBrand, usePatchWatch, usePodProfile, usePods, useSchedules, type Pod } from '../api/hooks'; -import type { Schedule } from '../api/types'; -import { Can, ErrorAlert, fmtTs, PageHeader } from '../components/common'; -import { keepInAreas, podAreas, sameList } from '../podAreas'; -import { patchCadence, shortWhen } from '../runName'; +import { MODULE_NAMES } from '../../domain/agents'; +import { api, ApiError, sendJson, unwrap } from '../../api/client'; +import { useBrand, usePatchWatch, usePodProfile, usePods, useSchedules, type Pod } from '../../api/hooks'; +import type { Schedule } from '../../api/types'; +import { Can, ErrorAlert, fmtTs, PageHeader } from '../../components/common'; +import { keepInAreas, podAreas, sameList } from '../../domain/podAreas'; +import { patchCadence, shortWhen } from '../../domain/runName'; const MONTH_NAMES = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const two = (n: number) => String(n).padStart(2, '0'); diff --git a/web/src/pages/StartRunWizard.tsx b/web/src/pages/runs/StartRunWizard.tsx similarity index 96% rename from web/src/pages/StartRunWizard.tsx rename to web/src/pages/runs/StartRunWizard.tsx index dd3fbf43e0070e3ba8691b1f2bfceb8bdf27e496..6ab83737d5380a0de10b0a7a42b4631c64369ecb 100644 --- a/web/src/pages/StartRunWizard.tsx +++ b/web/src/pages/runs/StartRunWizard.tsx @@ -1,15 +1,15 @@ import { Accordion, Alert, Button, Checkbox, Modal, Radio, SimpleGrid, Skeleton, Stack, Text, TextInput, UnstyledButton } from '@mantine/core'; import { notifications } from '@mantine/notifications'; -import { IconCheck, IconCloud, IconPlus, IconShieldLock } from '@/icons'; +import { IconCheck, IconCloud, IconPlus, IconShieldLock } from '@/components/icons'; import { useEffect, useMemo, useRef, useState } from 'react'; import { Link, useNavigate, useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { useBrand, useKill, usePodProfile, usePods, useStartRun } from '../api/hooks'; -import { useAuthOptional } from '../auth/AuthContext'; -import { ErrorAlert, MOCK_TEXT, VIEWER_START_WORDS } from '../components/common'; -import { keepInAreas, podAreas, sameList } from '../podAreas'; -import { patchCadence } from '../runName'; -import { useUiPrefs } from '../components/shell/prefs'; +import { MODULE_NAMES } from '../../domain/agents'; +import { useBrand, useKill, usePodProfile, usePods, useStartRun } from '../../api/hooks'; +import { useAuthOptional } from '../../auth/AuthContext'; +import { ErrorAlert, MOCK_TEXT, VIEWER_START_WORDS } from '../../components/common'; +import { keepInAreas, podAreas, sameList } from '../../domain/podAreas'; +import { patchCadence } from '../../domain/runName'; +import { useUiPrefs } from '../../components/shell/prefs'; // Demo-only failure injection (simulation runs). Keys are the backend's stub knobs; labels are what a user understands. const DEMO_FAILURES = [ diff --git a/web/src/pages/runs.css b/web/src/pages/runs/runs.css similarity index 100% rename from web/src/pages/runs.css rename to web/src/pages/runs/runs.css diff --git a/web/src/pages/AdminPages.tsx b/web/src/pages/setup/AdminPages.tsx similarity index 95% rename from web/src/pages/AdminPages.tsx rename to web/src/pages/setup/AdminPages.tsx index 5478574bc1e724123b59f07c44d841ecf18158ea..1c98f08ade3197c60b25894902462f1b7378d3f7 100644 --- a/web/src/pages/AdminPages.tsx +++ b/web/src/pages/setup/AdminPages.tsx @@ -1,10 +1,10 @@ import { Alert, Button, Card, Checkbox, Group, PasswordInput, SegmentedControl, Select, Stack, Table, Text, TextInput, Title } from '@mantine/core'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useState } from 'react'; -import { api, unwrap } from '../api/client'; -import { useAutonomy, useConfig, useHealth, useKill, useUsers } from '../api/hooks'; -import { Can, ErrorAlert, fmtTs, pct, PageHeader } from '../components/common'; -import { DataTable } from '../components/states'; +import { api, unwrap } from '../../api/client'; +import { useAutonomy, useConfig, useHealth, useKill, useUsers } from '../../api/hooks'; +import { Can, ErrorAlert, fmtTs, pct, PageHeader } from '../../components/common'; +import { DataTable } from '../../components/states'; import './admin.css'; export function KillSwitchPage() { @@ -83,7 +83,7 @@ export function AutonomyPage() { } /** Scheduled runs (step 7): the same screen at /schedules, /admin/scheduler and Settings > Schedules. */ -export { ScheduledRunsPage as SchedulerPage } from './ScheduledRunsPage'; +export { ScheduledRunsPage as SchedulerPage } from '../runs/ScheduledRunsPage'; export function UsersPage() { const q = useUsers(); diff --git a/web/src/pages/AgentStudioPage.tsx b/web/src/pages/setup/AgentStudioPage.tsx similarity index 97% rename from web/src/pages/AgentStudioPage.tsx rename to web/src/pages/setup/AgentStudioPage.tsx index 6135313715ffaa154be9e85a7e2397aabdb2a4fa..db7b7dd0320fe2a42ad399d57f0ebc31ab0bdcab 100644 --- a/web/src/pages/AgentStudioPage.tsx +++ b/web/src/pages/setup/AgentStudioPage.tsx @@ -1,10 +1,10 @@ import { Badge, Button, CopyButton, Group, JsonInput, Modal, Stack, Table, Text, TextInput } from '@mantine/core'; -import { IconCheck, IconCopy, IconPlus, IconRefresh } from '@/icons'; +import { IconCheck, IconCopy, IconPlus, IconRefresh } from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { getJson, sendJson } from '../api/client'; -import { ErrorAlert, fmtTs, PageHeader } from '../components/common'; +import { getJson, sendJson } from '../../api/client'; +import { ErrorAlert, fmtTs, PageHeader } from '../../components/common'; import './agent-studio.css'; interface FusionDelivery { base_url: string; token_url: string; client_id: string; scope: string; workflow_code: string; invocation_mode: string; workflow_status: string; has_secret: boolean } diff --git a/web/src/pages/AiMonitoringPage.tsx b/web/src/pages/setup/AiMonitoringPage.tsx similarity index 97% rename from web/src/pages/AiMonitoringPage.tsx rename to web/src/pages/setup/AiMonitoringPage.tsx index ae38e33010db44b845441f7d7c08d4c299c98e4a..627ad0268b248f74abe4ad49158dca064ec20c6e 100644 --- a/web/src/pages/AiMonitoringPage.tsx +++ b/web/src/pages/setup/AiMonitoringPage.tsx @@ -2,8 +2,8 @@ import { Badge, Button, Checkbox, Group, Modal, PasswordInput, SegmentedControl, import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useState } from 'react'; import { Link } from 'react-router-dom'; -import { getJson, sendJson } from '../api/client'; -import { ErrorAlert, fmtTs, PageHeader } from '../components/common'; +import { getJson, sendJson } from '../../api/client'; +import { ErrorAlert, fmtTs, PageHeader } from '../../components/common'; import './ai-monitoring.css'; interface Group_ { routes?: Record; calls: number; failed: number; baseline: number; fallbacks: number; validation_failures: number; p50_ms: number | null; p95_ms: number | null; tokens_in: number; tokens_out: number; success_rate: number | null } diff --git a/web/src/pages/IntegrationsPage.tsx b/web/src/pages/setup/IntegrationsPage.tsx similarity index 96% rename from web/src/pages/IntegrationsPage.tsx rename to web/src/pages/setup/IntegrationsPage.tsx index 10adcf12e522a2f2f3a78b45f23bde6b2ab94c8e..0a7a113972f958965327856940f2622295bdbf3d 100644 --- a/web/src/pages/IntegrationsPage.tsx +++ b/web/src/pages/setup/IntegrationsPage.tsx @@ -2,16 +2,16 @@ import { Anchor, Button, CopyButton, Drawer, Group, PasswordInput, Stack, Text } import { IconBrandDiscord, IconBrandGithubCopilot, IconBrandGoogle, IconBrandJira, IconBrandOpenai, IconBrandSlack, IconBrandTeams, IconBrandTelegram, IconAffiliate, IconCheck, IconCode, IconCopy, IconKey, IconMessageChatbot, IconSend, IconSparkles, IconTicket, IconWebhook, -} from '@/icons'; +} from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useState, type FormEvent, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; -import { getJson, sendJson } from '../api/client'; -import { ErrorAlert, fmtTs, PageHeader } from '../components/common'; -import type { NotifySettings } from '../notify/NotificationsSettings'; -import { BotStatusLine, TelegramCard } from '../notify/TelegramCard'; -import { recentlyUsed, useAccessTokens } from '../account/useAccessTokens'; -import '../notify/notify.css'; +import { getJson, sendJson } from '../../api/client'; +import { ErrorAlert, fmtTs, PageHeader } from '../../components/common'; +import type { NotifySettings } from '../../notify/NotificationsSettings'; +import { BotStatusLine, TelegramCard } from '../../notify/TelegramCard'; +import { recentlyUsed, useAccessTokens } from '../../account/useAccessTokens'; +import '../../notify/notify.css'; import './integrations.css'; type Delivery = { at: string; ok: boolean; status: number | null; error: string | null } | null; diff --git a/web/src/pages/PodsPage.tsx b/web/src/pages/setup/PodsPage.tsx similarity index 97% rename from web/src/pages/PodsPage.tsx rename to web/src/pages/setup/PodsPage.tsx index c5e1090a34396cc17e506497f41d478d403a8379..1c27e0d8eabcba392373728d49fe42e88f3555b2 100644 --- a/web/src/pages/PodsPage.tsx +++ b/web/src/pages/setup/PodsPage.tsx @@ -1,13 +1,13 @@ import { Alert, Button, Group, Modal, PasswordInput, Select, SimpleGrid, Skeleton, Stack, Switch, Text, TextInput, Textarea } from '@mantine/core'; -import { IconCircleCheck, IconCircleX, IconCloud, IconKey, IconPlugConnected, IconPlus, IconRadar, IconScan, IconShieldLock } from '@/icons'; +import { IconCircleCheck, IconCircleX, IconCloud, IconKey, IconPlugConnected, IconPlus, IconRadar, IconScan, IconShieldLock } from '@/components/icons'; import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { MODULE_NAMES } from '../agents'; -import { usePodMutations, usePods, type Pod } from '../api/hooks'; -import type { Schemas } from '../api/client'; -import { useAuth } from '../auth/AuthContext'; -import { Can, ErrorAlert, fmtTs, MOCK_TEXT, PageHeader } from '../components/common'; -import { shortWhen } from '../runName'; +import { MODULE_NAMES } from '../../domain/agents'; +import { usePodMutations, usePods, type Pod } from '../../api/hooks'; +import type { Schemas } from '../../api/client'; +import { useAuth } from '../../auth/AuthContext'; +import { Can, ErrorAlert, fmtTs, MOCK_TEXT, PageHeader } from '../../components/common'; +import { shortWhen } from '../../domain/runName'; import './admin.css'; const AREA_OPTIONS = Object.entries(MODULE_NAMES).map(([value, name]) => ({ value, label: `${name} (${value})` })); diff --git a/web/src/pages/SettingsPage.tsx b/web/src/pages/setup/SettingsPage.tsx similarity index 95% rename from web/src/pages/SettingsPage.tsx rename to web/src/pages/setup/SettingsPage.tsx index db53022bf3443816f1a67789d004efeb2a157ed4..8df5a585b6e5b2effc4280c1ec6332b8fc681b82 100644 --- a/web/src/pages/SettingsPage.tsx +++ b/web/src/pages/setup/SettingsPage.tsx @@ -1,16 +1,16 @@ -import { FeaturesPanel, StoragePanel } from './AccountPage'; +import { FeaturesPanel, StoragePanel } from '../account/AccountPage'; import { Button, Group, PasswordInput, SegmentedControl, Select, Stack, Table, Tabs, Text, TextInput } from '@mantine/core'; -import { IconAdjustments, IconBooks, IconBrain, IconCircleCheck, IconCircleX, IconMessageCircle, IconPlug, IconPlugConnected, IconRobot, IconShieldCheck, IconWand } from '@/icons'; +import { IconAdjustments, IconBooks, IconBrain, IconCircleCheck, IconCircleX, IconMessageCircle, IconPlug, IconPlugConnected, IconRobot, IconShieldCheck, IconWand } from '@/components/icons'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useState, type ReactNode } from 'react'; import { Link, useSearchParams } from 'react-router-dom'; -import { api, getJson, unwrap } from '../api/client'; -import { useAssistantStatus } from '../api/hooks'; +import { api, getJson, unwrap } from '../../api/client'; +import { useAssistantStatus } from '../../api/hooks'; import { useMediaQuery } from '@mantine/hooks'; -import { AGENTS, ENGINE_WORDS, stepName, type Engine } from '../agents'; -import { ErrorAlert, PageHeader } from '../components/common'; -import { DataTable } from '../components/states'; -import { NotificationsSettings } from '../notify/NotificationsSettings'; +import { AGENTS, ENGINE_WORDS, stepName, type Engine } from '../../domain/agents'; +import { ErrorAlert, PageHeader } from '../../components/common'; +import { DataTable } from '../../components/states'; +import { NotificationsSettings } from '../../notify/NotificationsSettings'; import { AutonomyPage, KillSwitchPage, SchedulerPage, UsersPage } from './AdminPages'; import './admin.css'; diff --git a/web/src/pages/admin.css b/web/src/pages/setup/admin.css similarity index 100% rename from web/src/pages/admin.css rename to web/src/pages/setup/admin.css diff --git a/web/src/pages/agent-studio.css b/web/src/pages/setup/agent-studio.css similarity index 100% rename from web/src/pages/agent-studio.css rename to web/src/pages/setup/agent-studio.css diff --git a/web/src/pages/ai-monitoring.css b/web/src/pages/setup/ai-monitoring.css similarity index 100% rename from web/src/pages/ai-monitoring.css rename to web/src/pages/setup/ai-monitoring.css diff --git a/web/src/pages/integrations.css b/web/src/pages/setup/integrations.css similarity index 100% rename from web/src/pages/integrations.css rename to web/src/pages/setup/integrations.css diff --git a/web/src/pages/integrations.test.tsx b/web/src/pages/setup/integrations.test.tsx similarity index 97% rename from web/src/pages/integrations.test.tsx rename to web/src/pages/setup/integrations.test.tsx index f01bce52fb29007953007d01deac343604b57a9a..ae0e4eae2fddef466b3fbd942dfa3be3e5a95273 100644 --- a/web/src/pages/integrations.test.tsx +++ b/web/src/pages/setup/integrations.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, waitFor, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { jsonResponse, renderUi } from '../test/utils'; +import { jsonResponse, renderUi } from '../../test/utils'; import { IntegrationsPage } from './IntegrationsPage'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); diff --git a/web/src/pages/podsDiscovery.test.tsx b/web/src/pages/setup/podsDiscovery.test.tsx similarity index 97% rename from web/src/pages/podsDiscovery.test.tsx rename to web/src/pages/setup/podsDiscovery.test.tsx index e82d4a8e2ada7d954f5c0a02a839bca9b3cc8941..0d20c045ef7146fdac40cf4469ac4f68e6a92a86 100644 --- a/web/src/pages/podsDiscovery.test.tsx +++ b/web/src/pages/setup/podsDiscovery.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, screen, waitFor, within } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { podAreas } from '../podAreas'; -import { jsonResponse, renderUi } from '../test/utils'; +import { podAreas } from '../../domain/podAreas'; +import { jsonResponse, renderUi } from '../../test/utils'; const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url); const ADMIN = { id: 1, username: 'a', role: 'admin', permissions: ['read', 'admin', 'run.start'] }; diff --git a/web/src/tokens.css b/web/src/styles/00-tokens.css similarity index 100% rename from web/src/tokens.css rename to web/src/styles/00-tokens.css diff --git a/web/src/styles.css b/web/src/styles/01-base.css similarity index 100% rename from web/src/styles.css rename to web/src/styles/01-base.css diff --git a/web/src/apple.css b/web/src/styles/10-apple.css similarity index 100% rename from web/src/apple.css rename to web/src/styles/10-apple.css diff --git a/web/src/apple-components.css b/web/src/styles/11-apple-components.css similarity index 100% rename from web/src/apple-components.css rename to web/src/styles/11-apple-components.css diff --git a/web/src/apple-screens.css b/web/src/styles/12-apple-screens.css similarity index 100% rename from web/src/apple-screens.css rename to web/src/styles/12-apple-screens.css diff --git a/web/src/apple-run.css b/web/src/styles/13-apple-run.css similarity index 100% rename from web/src/apple-run.css rename to web/src/styles/13-apple-run.css diff --git a/web/src/apple-pages.css b/web/src/styles/14-apple-pages.css similarity index 100% rename from web/src/apple-pages.css rename to web/src/styles/14-apple-pages.css diff --git a/web/src/surfaces.css b/web/src/styles/20-surfaces.css similarity index 100% rename from web/src/surfaces.css rename to web/src/styles/20-surfaces.css diff --git a/web/src/type.css b/web/src/styles/21-type.css similarity index 100% rename from web/src/type.css rename to web/src/styles/21-type.css diff --git a/web/src/beui.css b/web/src/styles/30-tailwind.css similarity index 92% rename from web/src/beui.css rename to web/src/styles/30-tailwind.css index 89306815af9bee515262744a220bf55544df5561..c0aae1853ccd10e6906bced2172f93fbd9381ef7 100644 --- a/web/src/beui.css +++ b/web/src/styles/30-tailwind.css @@ -12,14 +12,14 @@ /* Tailwind generates classes only from these files: the beUI components and the screens converted to them. Scanning the whole app would turn existing class names (e.g. "hidden", "border") into Tailwind utilities and restyle screens. */ -@source "./components/ui"; -@source "./components/three"; -@source "./components/wensity"; /* Wensity UI components (their Tailwind classes) */ -@source "./pages/LoginPage.tsx"; -@source "./pages/login"; -@source "./pages/AuthShell.tsx"; -@source "./pages/RegisterPage.tsx"; -@source "./pages/PasswordPages.tsx"; +@source "../components/ui"; +@source "../components/three"; +@source "../components/wensity"; /* Wensity UI components (their Tailwind classes) */ +@source "../pages/auth/LoginPage.tsx"; +@source "../pages/auth/login"; +@source "../pages/auth/AuthShell.tsx"; +@source "../pages/auth/RegisterPage.tsx"; +@source "../pages/auth/PasswordPages.tsx"; @custom-variant dark (&:where([data-mantine-color-scheme="dark"], [data-mantine-color-scheme="dark"] *)); diff --git a/web/src/layout.css b/web/src/styles/40-layout.css similarity index 100% rename from web/src/layout.css rename to web/src/styles/40-layout.css diff --git a/web/src/run-polish.css b/web/src/styles/50-run-polish.css similarity index 100% rename from web/src/run-polish.css rename to web/src/styles/50-run-polish.css diff --git a/web/src/ember.css b/web/src/styles/90-theme.css similarity index 100% rename from web/src/ember.css rename to web/src/styles/90-theme.css