Principle:AIScientists Dev WorldSeed Frontend Rendering
| Knowledge Sources | |
|---|---|
| Domains | Frontend, UI |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
A React + Zustand frontend rendering pattern that displays gazette content as a newspaper-style UI, managing generation state, content display, and API integration through a reactive store-driven architecture.
Description
The gazette frontend renders LLM-generated newspaper content. The architecture uses:
- Zustand store (`useGazetteStore`): Manages `runId`, `gazettes` list, `current` gazette, `loading` state, and `error`. Provides actions to fetch, generate, and select gazettes.
- GazetteView component: Renders the newspaper layout — edition_title, breaking_banner, lead_story, secondary_stories, editorials, ticker bar, pull_quote. Uses shadcn/ui components.
- GazettePopover component: Generation trigger UI — model selection, generate button, loading state.
- API integration: Calls the gazette API (`/api/gazette/`) via `frontend/src/lib/api.ts`.
The GazetteContent schema maps directly to UI sections. The store handles loading/error states, and the components render content-driven layouts that adapt to the generated structure.
Usage
Use this principle for frontend gazette display. The components are mounted in the dashboard route and driven by the Zustand store.
Theoretical Basis
The frontend follows a store-driven rendering pattern:
// Abstract pattern (NOT real implementation)
// Store (Zustand):
const useGazetteStore = create((set) => ({
gazettes: [],
current: null,
loading: false,
generate: async (runId, model) => {
set({ loading: true });
const result = await api.generateGazette(runId, model);
set({ current: result, loading: false });
},
}));
// Component:
function GazetteView() {
const { current, loading } = useGazetteStore();
if (loading) return <Spinner />;
return <NewspaperLayout content={current.gazette} />;
}
Related Pages
Implemented By
- Implementation:AIScientists_Dev_WorldSeed_GazetteView_frontend
- Implementation:AIScientists_Dev_WorldSeed_useCommands
- Implementation:AIScientists_Dev_WorldSeed_useMapCamera
- Implementation:AIScientists_Dev_WorldSeed_usePausableTimer
- Implementation:AIScientists_Dev_WorldSeed_usePolling
- Implementation:AIScientists_Dev_WorldSeed_useSSE
- Implementation:AIScientists_Dev_WorldSeed_useTypewriter
- Implementation:AIScientists_Dev_WorldSeed_chronicle_parser
- Implementation:AIScientists_Dev_WorldSeed_frontend_display_helpers
- Implementation:AIScientists_Dev_WorldSeed_map_layout
- Implementation:AIScientists_Dev_WorldSeed_overlay_layout
- Implementation:AIScientists_Dev_WorldSeed_stream_format
- Implementation:AIScientists_Dev_WorldSeed_subtitle_classifier
- Implementation:AIScientists_Dev_WorldSeed_subtitle_measure
- Implementation:AIScientists_Dev_WorldSeed_frontend_types
- Implementation:AIScientists_Dev_WorldSeed_ui_config
- Implementation:AIScientists_Dev_WorldSeed_replay_store
- Implementation:AIScientists_Dev_WorldSeed_stream_store
- Implementation:AIScientists_Dev_WorldSeed_pilot_format
- Implementation:AIScientists_Dev_WorldSeed_pilot_graph_model
- Implementation:AIScientists_Dev_WorldSeed_pilot_run_data
- Implementation:AIScientists_Dev_WorldSeed_CharacterDetail
- Implementation:AIScientists_Dev_WorldSeed_StreamPanel
- Implementation:AIScientists_Dev_WorldSeed_sidebar_ui
- Implementation:AIScientists_Dev_WorldSeed_stepper_ui
- Implementation:AIScientists_Dev_WorldSeed_pilot_data_fixtures
- Implementation:AIScientists_Dev_WorldSeed_autoresearch_snapshot
- Implementation:AIScientists_Dev_WorldSeed_i18n_locales
- Implementation:AIScientists_Dev_WorldSeed_npm_lockfiles