mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-03 20:12:55 +00:00
Routes under /agents covered two different things: using an agent (a conversation) and managing them (the list, editor, logs, schedules). Sharing the prefix left no way to tell them apart from the pathname, so the sidebar could not react to one without also reacting to the other. Management now lives under /agents/manage, and every caller builds its links from agents/paths.ts rather than from a literal. Pre-split URLs redirect, keeping their query. With the prefixes distinct, agent management becomes a section like settings and admin: - The list's five filters are routes rather than component state, so a filtered view is linkable and survives a reload. The hand-rolled pill row is gone from the content on desktop. - An agent's own pages (overview, logs, schedules) get a nav titled after the agent, replacing the breadcrumb-and-underline sub-nav. Sections nest to support it: `parentPath` makes back mean "up one level", so leaving an agent lands on the agent list rather than the chat. - Sections named after a record are built per route, since the title comes from the store rather than the path. - `pageTitle` distinguishes sections whose destinations are separate pages from ones whose destinations are views of a single page; the latter keep their own heading instead of flipping to "All". Below lg, where the sidebar is an overlay, those view-style destinations appear as a pill row on the page — bouncing out to an index page to change a filter would be worse than a row of pills. The workflow builder keeps its full-screen canvas and its own header, the one place a content-owned nav still earns its keep. Page shells converge on the shared padding, max width and header, and the agent list's folder trail uses the shared breadcrumb primitives.
DocsGPT E2E Tests
End-to-end tests for DocsGPT, driven by Playwright against the full native
dev stack (Flask + Celery + Vite + a mock LLM stub), backed by a disposable
docsgpt_e2e Postgres database.
This is an isolated Node workspace. It has its own package.json so
Playwright never ends up in the frontend app bundle.
Quick start
# 1. Install JS deps (first time only).
npm install
# 2. Install the Chromium browser Playwright will drive (first time only).
npm run e2e:install
# 3. Bake the Postgres template DB (one-time, idempotent).
../../scripts/e2e/bake_template.sh
# 4. Run the whole suite: boots services, runs tests, tears down.
npm run e2e
Interactive development
When iterating on a spec you want the services up across many runs:
npm run e2e:up # boot Flask + Celery + Vite + mock LLM, leave them running
npm run e2e:ui # open Playwright UI against the running stack
npm run e2e:down # tear down when done
Reports
After a run, view the HTML report:
npm run e2e:report
Traces, screenshots, and videos for failed tests land under test-results/.
Trace is captured on-first-retry (the first attempt runs clean; the retry
records for debugging).
Structure
specs/— test files, grouped by tier (auth/,tier-a/,tier-b/,tier-c/).helpers/— shared TypeScript helpers:auth.ts,db.ts,reset.ts,api.ts. Imported via the@helpers/*path alias.fixtures/— static fixture documents (PDFs, markdown, text) used by upload specs. Body content must be deterministic — no dates, UUIDs, or random tokens.
Full plan
See ../../e2e-plan.md for the phased rollout,
parallelization model, and Tier-A/B/C spec inventory.