agentleFS
dkackmandkackman/diffusers-workflow/ui/CLAUDE.md

diffusers-workflow / ui

CLAUDE.md19 starsChanged 3 days agoApache-2.0View on GitHub

Guidance for the web UI single-page app. Build and dev setup are in ui/README.md; the look is in the header comment of src/app.css; the rules the UI shares with the engine - its response contract among them - are rows in docs/ARCHITECTURE.md. Checks, from ui/: npm run check, npm run lint, npm test, and npx playwright test (after npm run build; its own server; never dw.serve on its port), whose e2e/performance.spec.ts budgets are raised only with Don. A test mocks…

The file

Files
CLAUDE.md

ui

Guidance for the web UI single-page app. Build and dev setup are in ui/README.md; the look is in the header comment of src/app.css; the rules the UI shares with the engine - its response contract among them - are rows in docs/ARCHITECTURE.md.

Checks, from ui/: npm run check, npm run lint, npm test, and npx playwright test (after npm run build; its own server; never dw.serve on its port), whose e2e/performance.spec.ts budgets are raised only with Don. A test mocks api with src/lib/test/apiMock.ts, never an object of its own. Server response types come from src/lib/generated/ - python scripts/dump_openapi.py then npm run gen:api - never written by hand.

Rules for new UI

  • A workspace's views are #/ws/<name>/<section>, listed in WS_SECTIONS (src/lib/routes.ts), routed in src/App.svelte and named in src/lib/Sidebar.svelte: overview, workflows, jobs, requests, gallery, compare, assets and edit. A new section goes in all three. requests is the workspace's requests ledger: requests/<id> is one request, edited only through intents (src/lib/request/intents.ts) that planStore.svelte.ts applies to the plan as last read when it writes - a plan read earlier is never sent again; what a row shows and what needs the person is derived in src/lib/request/itemState.ts, which the server's needs=true mirrors, not in a component (ARCHITECTURE, Requests in the UI).
  • Show the proof, one way: a file is an OutputTile, opened in MediaViewer (the page's open hash), and what made it is a RecipePanel (raw_media holds the rest at 1); a file or reference to fill in is a ReferenceField. Page data is a resource(load, { watch } | { live }) (src/lib/resource.svelte.ts) rendered through <LoadState> (only it imports Empty), whose quiet reloads keep edits, focus and selection; every mutating button is an action() (unwatched_reads and unguarded_mutations measure .svelte.ts stores too, where a read or write kept outside them is named with its reason in STORE_EXCEPTIONS, scripts/arch-metrics.mjs); a destructive one asks or undoes through src/lib/destructive.ts (docs/ARCHITECTURE.md, Destructive actions); a failure toast or load failure is describeError's copy (notify.failure, <LoadState>), inline, ErrorLine, never e.message; the server's state is connection, fed by every response (send in src/lib/apiRequest.ts), never a page's. Repeating timers are poll's (ESLint bans setInterval elsewhere); a one-shot delay may be a setTimeout its owner clears. An elapsed time against a server stamp uses serverNow(). resource is the only subscriber (ESLint), and src/lib/freshness.test.ts holds every page's declaration, resolving a helper one level; a page's own write is resource().adopt so it is never marked; every api key is classified read or not (READ_ALIASES/NOT_READS in scripts/arch-metrics.mjs, arch-metrics.test.ts); an open document watches with DocumentEditor.watchRemote.
  • Colour is carried only by the tokens src/app.css's header lists, each with one meaning: --live machine state, --select the user's place (focus, the open workspace, the active section), --good/--bad an outcome, --warn attention (cancelled, stalled, unsaved, required), --finding-warn/--finding-info an assessment finding's severity, and a workspace's own dot (wsColor()) its identity. scripts/design-rules.test.ts holds which files may use var(--live) and var(--select) - per file, so within a listed file the meaning is review's to keep - that no other token takes --live's value in any theme block, and that --warn and --live pass WCAG AA on --panel and --panel-2. Other token pairs should pass AA in both themes too, but no test holds them.
  • A document editor is a DocumentEditor (src/lib/editorShell.svelte.ts): its fields sit inside the editor's root, whose focused field a flush blurs to commit, or register a flush; saves go through saveDocument (src/lib/documentSave.ts), nothing else writing a workflow, prompt or upload; its place in the route (which file is open, the load, the URL after a save) is a DocumentRoute (src/lib/documentRoute.svelte.ts); leaving while dirty is the router's leave guard (addLeaveGuard, src/lib/router.svelte.ts), never a per-link handler; a dialog is src/lib/confirm.svelte.ts's. A page's head is PageHeader; copy follows GLOSSARY.md, whose banned terms scripts/copy-rules.test.ts holds at 0, and its Before you write markup table names the piece for each concept.
  • Imports point down: src/lib/ui/ and the top-level src/lib/* modules import no feature folder; a feature folder imports ui, the top-level modules and only what LAYER_ALLOWS (scripts/arch-metrics.mjs) lists - job → gallery → request, job → workflow → editor; pages/ import anything. A new folder under src/lib is declared there first (layering_violations, held at 0; ARCHITECTURE, UI layering).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.