# UI design

> The design rules for the app, and how the parts of the interface they cover work.

Source: https://werker.cloud/docs/engineering/ui (updated 2026-12-02)

Werker's primary interaction is to describe the work, then work with
the running result. Configuration supports that; people should not
have to assemble it before they can start.

This page has the design rules, then how each part of the UI that it
owns works. Factory pages, starters, teams and rooms are in
[agents, workflows and factories](agents-workflows-factories.md) and
[factory rooms](factory-rooms.md). The logo, its colours and the theme
tokens are in [logo and colours](brand.md).

## Design rules

### Put the work first, options second

- One prominent description box with a clear primary action.
- Sensible starting choices. Model and tool details sit in compact
  optional controls, not a stack of required fields.
- A searchable model picker with the selected value visible.
- Ideas that help someone begin, not a setup checklist.
- The command palette can carry a description into `/new`.

Werker works out the agent, workflow or team the description needs and
opens the running item. There is no separate configuration or approval
wizard: `/new` makes a
[team](agents-workflows-factories.md#a-team-from-new) when the
description asks for one, with no route or mode of its own. The
questions and brief on `/new` ([shaping](#shaping-on-new)) are the one
review step.

### Use the app's visual and interaction vocabulary

Rules:

- Use the theme's CSS variables and semantic tokens, never hard-coded
  colours.
- Use the established responsive patterns, labelled controls and
  keyboard behaviour. Check narrow layouts, not only desktop.
- Use `Hint` on the existing control or truncated text for optional
  explanations on hover and keyboard focus. Keep an icon button's
  accessible name, and show reasons for disabled actions without
  requiring a tooltip. Chart data uses the chart's own tooltips.

Component and form guidance is in
[the UI primitives skill](https://github.com/werker-ai/werker/blob/main/.agents/skills/ui-primitives/SKILL.md).

### Factories

- A factory is created by describing its work in the `/new` composer,
  held in the New factory dialog on `/factories`; the team comes from
  a saved team or is fitted to the brief. See
  [the New factory dialog](agents-workflows-factories.md#factory).
- Team and configuration can be inspected and edited but are not
  needed before the first conversation with the lead.
- Defaults are resolved against the models and tools the workspace
  has. Werker does not invent a provider or grant a tool silently.
- `/factories/teams` lists the saved teams and marks the workspace's
  default team. See
  [starters](agents-workflows-factories.md#starters).
- A saved team's page and a factory's Team page are one component
  (`apps/app/src/lib/components/team-page/team-page.svelte`), given a
  source of kind `starter` or `factory`. Teams share one board
  (`apps/app/src/lib/components/teams/`). See
  [teams](factory-rooms.md#teams).

## Lists

Every table is `apps/app/src/lib/components/data-table/`. It works in
one of two ways:

- **Paged by the database:** runs, agents, workflows and the audit
  log. The page asks for one page of rows (`ListQuery` in
  `packages/domain/src/lists.ts`: search words, chosen filter values,
  sort column, page, rows per page) and `read_list_page` in
  `packages/db/src/list-page.ts` searches, filters and sorts in SQL,
  so a search finds a row on any page. The page passes the result to
  the table as `remote`. Filter values and their counts come from the
  database, counted over the whole list.
- **Given every row:** factories, members, connections, the instance's
  audit events, Observability → Costs and a factory's rooms. The table
  searches, filters, sorts and pages the rows itself.

A table given a `detail` snippet (used by Costs) puts a button at the
start of each row that opens what the row holds under it.

Both show the same controls once a list has more than 25 rows: rows
per page (25, 50, 100 or 200; 50 to start) and first, previous, next
and last page.

Limits:

- An agent's or a workflow's own page lists its latest 20 runs.
- A paged search matches whole words typed anywhere in a row's text
  columns with `LIKE`; there is no full-text index, so it reads every
  row of the list.
- The agent pickers in the workflow builder and the factory form load
  the newest 200 agents (`list_agents`).

## One page for saved work

An agent, a workflow and a factory have the same page
(`apps/app/src/lib/components/item/`):

- **Header:** name, one line of purpose, when it works, its latest
  run's state, and its main action. A factory's action is the message
  box on its first tab.
- **Waiting first:** a question the latest run asked, or its failure,
  is above the tabs (`current-run.svelte`).
- **Tabs:** Overview, Setup, Runs, Files, Performance, in `?tab=`. A
  factory's first tab is Conversations, and it has no Runs.
- **Width:** `page/frame.svelte` caps the page at 90rem, centred;
  `page/columns.svelte` is the main and side column.

## Moving between pages

A navigation is shown as one view transition (`lib/page-motion.ts`,
styles in `routes/layout.css`), where the browser has them and reduced
motion is off. The old page is held for at most 400 ms while the new
one loads.

## The `/new` page

The person describes the work on `/new` (or in the command palette,
which carries the text there). The generator decides between an agent,
a workflow and a team ([how](agents-workflows-factories.md#workflow)).

- The composer becomes the "You asked for" box and the heading moves
  to the top as one view transition between `/new` and `/new/<run>`
  (the CSS at the end of `apps/app/src/routes/layout.css`).
- The composer has a [dictation](#dictation) button when dictation is
  set up, and the [`@` and `/` menus](#mentions-and-commands-on-new).
- **Progress:** `/new/<run>` and a team's ask box list what the
  generator says and looks at as it works
  (`apps/app/src/lib/components/creation/creation-lines.svelte`,
  `apps/app/src/lib/components/starter/ask.svelte`). What a model
  reasons is never shown, whichever model it is: while it reasons the
  line reads "Thinking… 12s" and goes when it is done
  (`creation/thinking-label.svelte`). The feed sends no reasoning text
  (`part_lines` in `packages/runtime/src/creation-feed.ts`). What the
  generator says renders as markdown while it streams.

## Shaping on `/new`

`/new/<run>` shapes described work with the person before anything is
saved, whichever of an agent, a workflow or a factory it becomes. The
generator-side flow (`request_details`, `propose_brief`,
`approve_brief`) is in
[agents, workflows and factories](agents-workflows-factories.md#workflow).

- **Stages:** the page says what is being shaped ("Shaping an agent",
  "a workflow", "a factory"; "Shaping your work" until the planner has
  said) and "Step n of 4": Understand, Questions, Brief, Start
  (`apps/app/src/lib/components/creation/shaping-progress.svelte`,
  `shaping_stage` in `apps/app/src/lib/creation/shaping.ts`). Stages
  count stages, not questions.
- **Questions:** one card per round, written by the planner with
  `request_details`: at most four questions (`most_questions` in
  `packages/rules/src/creation/creation.ts`), each with a recommended
  answer already picked, other answers where it gave any, and
  "Something else" for free text
  (`apps/app/src/lib/components/creation/creation-questions.svelte`).
  A question that recommends nothing is free text. At most two rounds
  (`most_rounds` in `packages/rules/src/creation/shaping.ts`): after
  the second, the planner is not given the tool.
- **Brief:** the planner's `propose_brief` stops creation with what
  will be made (kind, name, summary, its steps or members), what done
  means and what was assumed
  (`apps/app/src/lib/components/creation/creation-brief.svelte`).
  "Approve and start" saves the work and starts it. "Change answers"
  reopens the question card with the earlier answers picked; a brief
  written without questions offers "Edit the request" instead. A
  complete description goes straight to the brief.
- **Just do it now:** a button beside the stages. At the questions it
  sends the answers as picked and starts; at the brief it approves.
  Pressed while the planner is working, it is held in the page and
  sent when the planner stops (lost if the page is closed). The
  planner then saves without a brief to approve.
- **Looking up:** when a search, page-reading or MCP connection is
  connected, the planner has `look_up`
  (`packages/runtime/src/workflow/generate/look-up.ts`) and is told
  not to use it by default. The page shows "Looking up …" with the
  planner's own words. An HTTP connection only takes the search and
  page requests the registry lists for its service
  (`lookup_request_problem` in
  `packages/rules/src/creation/lookups.ts`); an MCP connection only
  tools its server marks `readOnlyHint`. Each call is in the audit log
  as `service.called`. At most four per planning conversation.
- **Where it is kept:** where shaping stands is `runs.pause.shaping`
  (`Shaping` in `packages/domain/src/shaping.ts`). `runs.shape` says
  the run is shaped at all: `/new` sets it; the command line
  (`enqueue --describe`, unless `--shape`) and the generation check do
  not, and plan at once.

## Mentions and commands on `/new`

Typing `@` at the start of a word, or `/` at the start of the message,
opens a menu under (or above) the text box that filters as the person
types. Arrow keys move, Enter or Tab picks, Escape closes and keeps
the text; Enter sends only while the menu is closed. A picked `@`
mention stays in the text as `@handle` (the name with hyphens for
spaces); a picked command is taken out of the text. An unknown `/word`
stays plain text. The same menu is in a factory's composers
([factory rooms](factory-rooms.md#how-a-room-works)).

- **Menu:** `apps/app/src/lib/mentions/trigger-menu.ts` (where a
  trigger is, filtering, replacing the word),
  `apps/app/src/lib/components/trigger-menu/` (keyboard state and the
  list, a combobox with `aria-activedescendant`).
- **Badges in the text:** a layer behind the textarea draws a
  `bg-accent` span round each recognised mention
  (`apps/app/src/lib/components/composer/mention-mirror.svelte`,
  ranges from `apps/app/src/lib/mentions/ranges.ts`). On `/new` only
  mentions picked from the menu get one.
- **`@` menu:** Connections (search providers, GitHub, MCP servers),
  Agents and workflows (saved ones that run by themselves), Projects.
  Each group only when the member's role may use it (`mention_rights`
  in `packages/core/src/access/mention-rights.ts`). Picks also show as
  chips under the box; a chip is the only way to take a pick back
  (deleting the `@word` does not).
- **Commands:** `/agent`, `/workflow`, `/factory` (what is made; the
  planner must obey), `/now` (start without shaping, as "Just do it
  now"), `/schedule` (a picker of every hour, day or week with the
  minute, hour and weekday;
  `apps/app/src/lib/components/composer/schedule-pick.svelte`).
- **Sent as data:** the picks are form fields beside the description
  (`queue_run` in `apps/app/src/lib/remote/runs.remote.ts`), never
  parsed out of the text. The server checks each ID against the
  workspace and the role (`resolve_picks` in
  `packages/core/src/picks.ts`), refuses a team given a project, saved
  work or a schedule, and keeps them on the run: `runs.picks`, and
  `runs.project_id` for the project.
- **The planner:** every pick is read again by ID when the run starts
  (`packages/runtime/src/run/setup/picked.ts`) and becomes explicit
  lines in its instructions (`picks_instructions` in
  `packages/rules/src/creation/picks.ts`), logged on the run as a
  `picked` event. A mentioned search provider is preferred, not
  required: the planner may use a better connected one and say so
  under Assumed. Every other pick is firm, and a plan that leaves one
  out is sent back (`picks_problems`). A picked schedule replaces the
  plan's.
- **Project:** a mentioned project wins over the run's usual owner
  (`run_owner` in `packages/db/src/projects.ts`): the run loads it
  into `/work` and saves back to it, and so do later runs of the agent
  or workflow it saved. See [projects](projects.md).

Limits: the mentionable lists are read once per page load; saved
agents, workflows and projects are capped at 200 each, and the menu
shows at most 40 options. No other text box has mentions or commands
beyond `/new` and a factory's composers
([#52](https://github.com/werker-ai/werker/issues/52)).

## Dictation

A microphone button in the `/new` composer
(`apps/app/src/lib/components/composer/dictation-button.svelte`).
Words are written into the box as they are heard; the box is read-only
until dictation ends. It stops itself after five minutes.

- **Setting:** Admin → Models → Dictation
  (`apps/app/src/lib/components/admin/models/dictation-model.svelte`,
  `workspace_settings.dictation_model_id`). Off by default; while off
  there is no button.
- **Models:** `openai/gpt-live-transcribe` only
  (`packages/connections/src/dictation.ts`).
- **How audio travels:** the browser sends the microphone straight to
  OpenAI over WebRTC (`apps/app/src/lib/dictation/openai-live.ts`).
  Werker's servers never receive it.
- **The key:** the web app cannot open a connection's key, so it asks
  a worker over `dictation_requested`; the worker mints a credential
  that starts transcription sessions for 60 seconds and answers over
  `dictation_answered` (`packages/runtime/src/loops/dictation.ts`,
  `packages/core/src/dictation.ts`). The credential is not stored.

## Planning model

A workspace setting in Admin → Models
(`apps/app/src/lib/components/admin/models/planning-model.svelte`,
`workspace_settings.planning_model_id`). The planning model reads the
description, decides between an agent, a workflow and a team, and
writes it. The model picked on `/new` then only does the work.

- **Unset (the default):** the model picked on `/new` plans too.
- **In a run:** the worker gives the generator's conversation the
  planning model (`packages/runtime/src/run/factory/planner.ts`,
  `packages/runtime/src/workflow/generate/phase.ts`); steps keep the
  run's model. A team made from `/new` is written by the planning
  model; its members run on the picked model.
- **When it cannot be used** (not offered or allowed, or its
  connection has no key): the run's model plans, and the worker's log
  says why.

## Results as markdown

Results render from parsed markdown (`@mdsvex/parse`) into components
(`apps/app/src/lib/markdown/markdown.ts`); no HTML from model output
is inserted. `**a**` is strong and `*a*` emphasis. Fenced ` ```csv `
and ` ```tsv ` blocks become tables, ` ```chart ` a chart (JSON
`{type, data, x, y, title}`), and ` ```file ` or `::file[<path>]` one
of the run's files
(`apps/app/src/lib/components/markdown/markdown-directives.ts`).
Streaming text is parsed as it arrives
(`apps/app/src/lib/markdown/stream.ts`). Links open only web and mail
addresses, and images show as links. Run files are served from
`/runs/<id>/files/<file_id>` as untrusted: HTML as plain text, no type
sniffing, and a sandboxing content security policy.
