Local Preview
Ideon serves generated content through a React-based local web app so you can review copy, assets, and model interactions in one place.
Quick Start
Serve the most recent generated batch from your output directory:
ideon preview
This command:
- starts a local server on
http://localhost:4173 - serves the built React preview client (
dist/preview) - loads generation metadata from preview API endpoints
- serves generation-local assets from your configured asset output directory
- opens your default browser automatically
What You See In The UI
Left Rail
- one item per generation directory
- title, timestamp, and snippet preview
- quick reload button
Main Content Area
- compact summary row (source path, generation count, output count, interaction count)
- active generation title and slug
- top-level channel tabs (
article,x-post,linkedin-post, etc.) - variant tabs within each channel (
Article 1,X Post 2, and so on) - rendered markdown body for the selected output
Logs View
- stage-grouped interaction list (
shared-brief,planning,sections,image-prompts,images,output,links) - per-call inspector with metadata (model, status, duration)
- mode toggle for
Prompt / ResponseandFull JSON
Runtime Architecture
ideon preview now runs two layers:
- API + static server (
src/server/previewServer.ts) - React client app (
src/preview-app/, built by Vite intodist/preview/)
On startup, the server tries to find the built React client and serves index.html at /.
- If the React build exists, the SPA UI is served.
- If the build is missing, preview falls back to a server-rendered shell so preview still works.
Preview API Endpoints
The React app reads data from:
GET /api/bootstrap: initial source-path and active-generation selectionGET /api/articles: generation list for the left railGET /api/articles/:slug: full output + interaction payload for one generationGET /api/generations/:generationId/assets/*assetPath: generation-scoped asset serving
Selection And Fallback Behavior
- If
markdownPathis omitted, preview picks the newest markdown output recursively. - If
markdownPathis provided, preview uses that generation as the initial selection when found. - If the active generation disappears while preview is open, refresh safely falls back to the newest remaining generation.
- If no markdown remains, preview shows an empty-state message instead of crashing.
Theme Behavior
- First load follows OS color scheme (
prefers-color-scheme). - Light/Dark toggle is persisted in local storage.
- The app uses Ant Design theme tokens and custom CSS for channel-specific output cards.
Preview a Specific Article
ideon preview ./output/my-article.md
If you are in this repository and want preview-client rebuild + launch in one command, you can also run:
npm run preview -- ./output/my-article.md
Optional flags:
--port <port>to use a different port--no-opento skip automatic browser launch
Contributor Notes
If you are developing preview UI locally:
- Build the React client once:
npm run build:preview
- Start preview without opening a browser:
ideon preview --no-open
- Rebuild the client when preview-app code changes:
npm run build:preview
npm run preview is an optional repository convenience script that does both a preview build and server launch.
Troubleshooting
If Ideon reports no generated content found:
- Run a generation command first (
ideon write "your idea"). - Confirm your output directories in
ideon settings. - If markdown lives elsewhere, pass an explicit path to
ideon preview.
If preview fails to start on the default port:
- Start on a different port:
ideon preview --port 8080 --no-open - Check local port conflicts on
4173.
If UI changes are not visible:
- Re-run
npm run build:preview. - Refresh browser with hard reload.
- Confirm
dist/preview/index.htmlhas a recent timestamp.
If images do not load:
- Ensure preview is pointed at the same workspace output root used for generation.
- Verify markdown uses generation-relative asset paths.
- Open browser devtools and confirm
/api/generations/:id/assets/...returns200.