The app shell is a React interface for the PraisonAIUI dashboard: a sidebar,
a header with a command palette (⌘K / Ctrl+K), a React chat and a host that
runs every existing dashboard page inside it. It is the default style
(owner decision, 2026-11-22): create_app(), aiui run app.py and an app
create_app()
aiui run app.py
that registers pages all open it. The vanilla-JS dashboard is the legacy
dashboard
UI; it still renders exactly as before when you ask for it:
| Where | Legacy dashboard |
|---|---|
| YAML config | style: dashboard |
style: dashboard
| Python | aiui.set_style("dashboard") |
aiui.set_style("dashboard")
| CLI | aiui run app.py --style dashboard (prints a one-line legacy notice) |
aiui run app.py --style dashboard
| Environment | AIUI_SHELL=legacy |
AIUI_SHELL=legacy
Any one of these:
| Where | How |
| YAML config | style: app |
style: app
| Python | aiui.set_style("app") before the server starts |
aiui.set_style("app")
| CLI | aiui run app.py --style app |
aiui run app.py --style app
| Environment | AIUI_SHELL=app aiui run app.py (alias: AIUI_SHELL=react) |
AIUI_SHELL=app aiui run app.py
AIUI_SHELL=react
AIUI_SHELL=app only changes the dashboard style into
AIUI_SHELL=app
app. Other styles (chat, docs, agents, playground, custom) are
app
chat
docs
agents
playground
custom
never rewritten.
AIUI_SHELL=legacy turns app back into dashboard, whatever the config
says. It is the documented way back once the default flips (see
flip criteria).
1. a React page registered through the SDK (built-in ports such as chat, or
a UI plugin page);
2. a server-driven page (register_page with a handler, @aiui.page),
register_page
@aiui.page
rendered from its _components tree as blocks;
_components
3. otherwise the original dashboard view, mounted inside the shell.
Nothing disappears: dashboard plugins (kanban, sample-board,
kanban
sample-board
video-studio), set_custom_js and custom.js registerView pages keep
video-studio
set_custom_js
custom.js
registerView
working as hosted pages.
/api/chat/ws
reasoning, inline approvals and questions, attachments, Stop, history).
When the socket cannot open it falls back to Server-Sent Events (POST /run);
POST /run
on SSE an agent's question says that answering needs a live connection.
highlighting (74 languages), Mermaid and KaTeX. In chat, external links open
in a new tab with rel="noopener noreferrer nofollow", and remote images
rel="noopener noreferrer nofollow"
are shown as a click-to-load placeholder naming their host (same-origin,
data:image/ and blob: images load directly).
data:image/
blob:
"Review" button that opens the Approvals page. On the chat page the
approval is shown in the thread instead.
| Existing API | dashboard (default) | app (opt-in) |
|---|---|---|
| register_page with a handler / @aiui.page | unchanged | server-driven blocks page |
| register_page without a handler | unchanged | hosted custom.js registerView page |
| register_page_action | unchanged | the page's action endpoint |
register_page_action
| set_pages, pages.enabled/disabled | unchanged | applied |
set_pages
pages.enabled/disabled
| set_custom_js | unchanged | injected; runs when the hosted runtime loads |
| set_custom_css | unchanged | unchanged; HSL triples warn (see below) |
set_custom_css
| set_theme, set_brand_color, register_theme | unchanged | converted to theme seeds |
set_theme
set_brand_color
register_theme
| dashboard plugins | unchanged | hosted pages; dashboard.plugins allowlist honoured |
dashboard.plugins
| chat, docs, agents, playground, custom styles | same app, now lazy-loaded with the new markdown renderer and tokens | n/a |
| aiui build static docs | same app; loads content-named copies index-<hash>.js/.css | n/a |
aiui build
index-<hash>.js
.css
Colours now come from a small set of seeds (--seed-accent,
--seed-accent
--seed-ink, --seed-paper, …). Everything else (--background,
--seed-ink
--seed-paper
--background
--primary, sidebar and chart colours) is derived from them in CSS with
--primary
color-mix(), separately for light and dark. Python emits seeds only
color-mix()
(praisonaiui.themes.get_seed_theme_css(preset, radius, accent, density)):
praisonaiui.themes.get_seed_theme_css(preset, radius, accent, density)
zinc
slate
stone
gray
neutral
monochrome: the accent follows the ink;
rose
blue
light mode, and the button text colour is picked automatically for
at least 4.5:1 contrast;
get_theme_css() is kept for API compatibility but the compiler no longer
get_theme_css()
uses it. Runtime themes (register_theme, named presets) are converted to
seeds in the browser.
Listed in the changelog for the release that ships the
app shell.
shadcn variables used to hold bare HSL triples that the stylesheet wrapped in
hsl(). They are now complete colours:
hsl()
aiui validate warns (code 5001) when site.custom_css sets one of these
aiui validate
site.custom_css
variables to a bare triple. Custom CSS and runtime themes that still use
triples are converted in the browser where possible, but update the CSS.
assets/<name>-<hash>.js
Cache-Control: immutable. assets/index.js and assets/index.css keep
Cache-Control: immutable
assets/index.js
assets/index.css
fixed names in the bundle; the server references them as ?v=<hash>, so a
?v=<hash>
release never mixes an old entry with new chunks.
assets/index-<sha256[:10]>.js and assets/index-<sha256[:10]>.css, and
assets/index-<sha256[:10]>.js
assets/index-<sha256[:10]>.css
loads them from index.html and every route page. A static host such as
index.html
GitHub Pages ignores the query string, so ?v= alone could pair a cached
?v=
old page with the new entry. index.js and index.css stay in the build,
index.js
index.css
so a page cached before the switch still loads, and the copies are listed in
the site's aiui-manifest.json (keys aiui-entry-copy:<file>), so the
aiui-manifest.json
aiui-entry-copy:<file>
deploy's carry-forward keeps them next to the chunks. When a chunk imports
the entry module (none does today) the build keeps index.js?v=, which
index.js?v=
would otherwise load the entry twice.
(aiui-carried.json) older builds' chunks for --keep-days (default 2)
aiui-carried.json
--keep-days
(src/frontend/scripts/carry-forward-assets.mjs), so a reader with an
src/frontend/scripts/carry-forward-assets.mjs
old page open can still load its lazy parts.
only when the server's HTML (fetched past the cache) names another build.
The reload opens the page as ?aiui-build=<build>, a URL no browser or CDN
?aiui-build=<build>
cache holds, and the boot removes the parameter again. When the boot
chunks themselves cannot load, the page says so and offers Reload.
for its headers and one for its body, a stalled request is sent again,
and a page that still cannot load shows "Couldn't load this page" with
Retry (src/frontend/src/docs/docLoader.ts). A retry also moves to a
src/frontend/src/docs/docLoader.ts
fresh connection (it switches between requests with and without
credentials, which the browser keeps on separate connection pools), so a
connection that a router dropped while idle does not cost the page. An
attempt with no response headers after 1 s (0.4 s after 10 s without a
request) also goes out on the other pool and the first answer wins; a
request that fails outright switches at once. A visitor coming back after
10 s without input sends one small request (ui-config.json) the same way,
ui-config.json
so the next click already uses a working connection.
python -m preqa netfault reproduces the dead connection (budget 2.5 s;
python -m preqa netfault
measured 0.15-0.19 s).
version (path, mtime, size) in a worker thread and kept in memory (at most
64 MB), so a cold page load does not compress the bundle again on the
event loop. Range requests get the plain bytes. The page HTML,
/api/shell/manifest, /api/pages and dashboard-plugin files are
/api/shell/manifest
/api/pages
compressed too.
longer copies it into ./aiui on every start (a ./aiui left by an older
./aiui
version is ignored for a chat app; delete it). A site built with
aiui run --config is served gzip-compressed with `Cache-Control:
aiui run --config
no-cache, like aiui serve, and its own assets/` (for example
, like
, and its own
theme.css) is looked up after the package's.
theme.css
aiui serve
/docs/x
docs/x.html
directly, without a redirect to /docs/x/.
/docs/x/
| Gate | Command (in src/frontend) | Limit |
src/frontend
| Types | npx tsc -b | 0 errors |
npx tsc -b
| Unit tests | npm test, npm run test:scripts | all pass |
npm test
npm run test:scripts
| Size (gzip) | npm run size | shell boot ≤ 151.3 kB, chat route ≤ 144,500 B, /chat first-screen JS ≤ 264,400 B, index.css ≤ 32 kB, Streamdown ≤ 100 kB, shikiPlugin ≤ 55 kB, legacy App path ≤ 250 kB, docs Try it chunk ≤ 7,566 B, Pro fonts (Geist + Geist Mono woff2) ≤ 58 kB, Paper fonts (Newsreader + Source Sans 3 + JetBrains Mono woff2) ≤ 140 kB, all assets ≤ 11,180,139 B uncompressed |
npm run size
| First screen stays light | npm run check:closure | no Streamdown, Shiki, Mermaid, KaTeX or assistant-ui in the static closure of the entry, the shell or the legacy App |
npm run check:closure
| Committed bundle | npm run check:bundle | templates/frontend equals a fresh build (pull requests that touch the frontend only) |
npm run check:bundle
templates/frontend
| Browser suites | npm run test:e2e | see src/frontend/e2e/README.md |
npm run test:e2e
src/frontend/e2e/README.md
The docs style preloads Streamdown before first paint (about 98 kB gzip on
that path). The HTML parser it needs for raw HTML and docs components
(rehype-raw, about 48 kB) is a chunk of its own that only pages whose
markdown has HTML load (markdown/rehypeRawGate.ts). This is an accepted
markdown/rehypeRawGate.ts
exception until docs pages are pre-rendered at build time.
The owner made app the default on 2026-11-22, before every criterion below
was met. The table is kept as the remaining work list:
| # | Criterion | Status |
| 1 | Every page renders in the shell with status ready, 0 page errors and 0 leak delta in the Playwright sweep | Not met. Every manifest page is ready (a page that prints a JSON error body, or whose own data endpoint fails, now counts as an error; the Inspector was one and is fixed), 0 page errors, no page grows per visit, and every page opens by URL. Three pages keep a one-time residue after their first visit that does not grow, each listed with its reason in the sweep's FIRST_VISIT_ALLOWANCE (any other or larger residue fails): chat (13 window listeners and the composer's hidden measuring textarea), chat-canvas (one window listener) and code-studio (Monaco's interval, listener and two body nodes) |
FIRST_VISIT_ALLOWANCE
chat-canvas
code-studio
| 2 | Chat parity complete | Not met. Done: streaming, tools, reasoning, approvals, ask, attachments, Stop, history, feedback, session rail, reconnect. Missing: message queue, channel messages with unread dots, context ring and compaction banner, cost chip, memory panel, floating and focus modes |
| 3 | Light mode correct on every page; owner signs off the light and dark screenshots | Not met. Awaiting owner review |
| 4 | Gates green: size, bundle-sync, entry closure, screenshots, pytest, tsc | Partly. All run green locally; screenshot comparison is not enforced in CI until Linux baselines exist |
| 5 | set_custom_js, custom.js registerView and the three bundled dashboard plugins work under app | Met in this build. The three dashboard plugins pass the sweep; the e2e app-shell server sets set_custom_js with a registerView for a page that also has a server handler, and the client view wins (as in the legacy dashboard) |
| 6 | One minor release with app opt-in, then two weeks with no open P1 from opt-in users | Not met |
See UI Plugins. Installing a plugin package means trusting it:
its Python runs in the server process and its JavaScript runs in the page
with no sandbox. An iframe page is the sandboxed option.
iframe