Skip to main content

euv_example/state/
struct.rs

1use super::*;
2
3/// Decoded Media Studio sample assets assembled off the UI critical path and committed atomically.
4#[derive(Clone, Getter)]
5pub struct MediaSampleBundle {
6    /// Decoded LZW GIF89a animation sample.
7    pub(crate) gif: GifAnimation,
8    /// Sample LIVE Photo motion asset.
9    pub(crate) live: LivePhotoAsset,
10    /// Decoded ISOBMFF MP4 HDR video track.
11    pub(crate) video: VideoTrack,
12    /// Synthesized WAV audio waveform track.
13    pub(crate) audio: AudioTrack,
14    /// Multi-page native PDF sample document.
15    pub(crate) pdf: PdfDocument,
16}
17
18/// Pre-built `.wasm` OTA registry entry `(url, bytes, etag, fault)` generated off the UI critical path.
19#[derive(Clone, Getter)]
20pub struct WasmRegistryEntry {
21    /// Target CDN bundle URL.
22    pub(crate) url: String,
23    /// Encoded WebAssembly module bytes.
24    pub(crate) bytes: Vec<u8>,
25    /// Cache ETag token for conditional fetches.
26    pub(crate) etag: String,
27    /// Fault injection mode exercised by the registry fetcher.
28    #[get(type(copy))]
29    pub(crate) fault: WasmFaultKind,
30}
31
32/// Collection of pre-built `.wasm` OTA registry payloads generated off the UI critical path.
33#[derive(Clone, Getter)]
34pub struct WasmSampleBundle {
35    /// Ordered list of registry entries ready to register on the UI thread.
36    pub(crate) entries: Vec<WasmRegistryEntry>,
37}
38
39/// Lazily initialized signals powering the `/reactive` showcase page.
40#[derive(Clone, Copy, Getter)]
41pub struct ReactiveSignals {
42    /// Interactive counter signal for fine-grained reactivity demos.
43    #[get(type(copy))]
44    pub(crate) counter: Signal<i32>,
45    /// Derived memo computing `counter * 2` without redundant notifications.
46    #[get(type(copy))]
47    pub(crate) doubled: Memo<i32>,
48}
49
50/// Lazily initialized signals powering the `/render` and `/window` showcase pages.
51#[derive(Clone, Copy, Getter)]
52pub struct RenderWindowSignals {
53    /// Active component-scoped demo render pipeline preview index (`0 = Auto`, `1 = Software`, `2 = Hardware`, `3 = Hybrid`).
54    #[get(type(copy))]
55    pub(crate) render_mode_index: Signal<usize>,
56    /// Active component-scoped demo FPS cap index on `/window` (`0 = Native Uncapped` .. `6 = 360`).
57    #[get(type(copy))]
58    pub(crate) demo_fps_cap_index: Signal<usize>,
59    /// Controlled fullscreen window toggle state.
60    #[get(type(copy))]
61    pub(crate) fullscreen: Signal<bool>,
62    /// Live Dynamic Island / Live Activity active state.
63    #[get(type(copy))]
64    pub(crate) island_active: Signal<bool>,
65    /// Live Dynamic Island progress percentage (`0..=100`).
66    #[get(type(copy))]
67    pub(crate) island_progress: Signal<u8>,
68    /// Live Camera system permission status text.
69    #[get(type(copy))]
70    pub(crate) camera_perm_status: Signal<String>,
71    /// Live protocol registration and deep link telemetry text.
72    #[get(type(copy))]
73    pub(crate) protocol_status: Signal<String>,
74    /// Total accessibility live announcements emitted interactively.
75    #[get(type(copy))]
76    pub(crate) a11y_announcements: Signal<u32>,
77    /// Total haptic pulses emitted interactively.
78    #[get(type(copy))]
79    pub(crate) haptic_pulses: Signal<u32>,
80    /// Simulated target platform index for cross-platform Dynamic Island & permissions matrix (`0..7`).
81    #[get(type(copy))]
82    pub(crate) os_target_platform_idx: Signal<usize>,
83    /// Active Dynamic Island presentation mode index (`0..6`).
84    #[get(type(copy))]
85    pub(crate) island_mode_idx: Signal<usize>,
86    /// Live notification delivery stack displayed via `EuvSonner`.
87    #[get(type(copy))]
88    pub(crate) system_notifications: Signal<Vec<(String, String)>>,
89    /// Per-permission status map across all 14 `SystemPermission` categories.
90    #[get(type(copy))]
91    pub(crate) permission_statuses: Signal<Vec<PermissionStatus>>,
92}
93
94/// Lazily initialized signals powering the `/forms` showcase page.
95#[derive(Clone, Copy, Getter)]
96pub struct FormsSignals {
97    /// Controlled form text input value.
98    #[get(type(copy))]
99    pub(crate) username: Signal<String>,
100    /// Controlled multi-line textarea value.
101    #[get(type(copy))]
102    pub(crate) bio: Signal<String>,
103    /// Controlled numeric stepper value.
104    #[get(type(copy))]
105    pub(crate) stepper_value: Signal<i64>,
106    /// Controlled radio group selection index.
107    #[get(type(copy))]
108    pub(crate) radio_index: Signal<usize>,
109    /// Controlled continuous slider value.
110    #[get(type(copy))]
111    pub(crate) slider_value: Signal<f32>,
112    /// Controlled select dropdown index.
113    #[get(type(copy))]
114    pub(crate) select_index: Signal<usize>,
115    /// Controlled select dropdown open state.
116    #[get(type(copy))]
117    pub(crate) select_open: Signal<bool>,
118    /// Controlled star rating value.
119    #[get(type(copy))]
120    pub(crate) rating_value: Signal<usize>,
121    /// Controlled toggle pill pressed state.
122    #[get(type(copy))]
123    pub(crate) pin_toggled: Signal<bool>,
124    /// Controlled toggle switch for hardware acceleration preference.
125    #[get(type(copy))]
126    pub(crate) hardware_accel: Signal<bool>,
127    /// Controlled checkbox for terms acknowledgment.
128    #[get(type(copy))]
129    pub(crate) agree_terms: Signal<bool>,
130    /// Controlled tab bar index.
131    #[get(type(copy))]
132    pub(crate) active_tab: Signal<usize>,
133    /// Controlled pagination page number.
134    #[get(type(copy))]
135    pub(crate) page_index: Signal<usize>,
136    /// Controlled steps indicator active index.
137    #[get(type(copy))]
138    pub(crate) step_index: Signal<usize>,
139    /// Controlled accordion expanded item index.
140    #[get(type(copy))]
141    pub(crate) accordion_open: Signal<Option<usize>>,
142    /// Controlled accent color selection for `EuvColorPicker`.
143    #[get(type(copy))]
144    pub(crate) picker_color: Signal<Color>,
145    /// Controlled 24-hour `(hour, minute)` selection for `EuvTimePicker`.
146    #[get(type(copy))]
147    pub(crate) picker_time: Signal<(u8, u8)>,
148    /// Controlled dynamic tag list for `EuvTagInput`.
149    #[get(type(copy))]
150    pub(crate) tag_items: Signal<Vec<String>>,
151    /// Controlled selected node label for interactive `EuvTree`.
152    #[get(type(copy))]
153    pub(crate) tree_selected: Signal<Option<String>>,
154    /// Controlled active breadcrumb index for interactive `EuvBreadcrumb`.
155    #[get(type(copy))]
156    pub(crate) breadcrumb_active: Signal<usize>,
157}
158
159/// Lazily initialized signals powering the `/overlays` showcase page.
160#[derive(Clone, Copy, Getter)]
161pub struct OverlaysSignals {
162    /// Controlled modal visibility flag.
163    #[get(type(copy))]
164    pub(crate) modal_open: Signal<bool>,
165    /// Controlled drawer visibility flag.
166    #[get(type(copy))]
167    pub(crate) drawer_open: Signal<bool>,
168    /// Controlled bottom sheet visibility flag.
169    #[get(type(copy))]
170    pub(crate) sheet_open: Signal<bool>,
171    /// Controlled popover visibility flag.
172    #[get(type(copy))]
173    pub(crate) popover_open: Signal<bool>,
174    /// Controlled dropdown menu open flag.
175    #[get(type(copy))]
176    pub(crate) dropdown_open: Signal<bool>,
177    /// Controlled dropdown last selected index.
178    #[get(type(copy))]
179    pub(crate) dropdown_selected: Signal<Option<usize>>,
180    /// Controlled toast banner visibility flag.
181    #[get(type(copy))]
182    pub(crate) toast_visible: Signal<bool>,
183    /// Controlled corner notification visibility flag.
184    #[get(type(copy))]
185    pub(crate) notif_visible: Signal<bool>,
186    /// Controlled loading overlay active flag.
187    #[get(type(copy))]
188    pub(crate) loading_active: Signal<bool>,
189}
190
191/// Lazily initialized signals powering the `/data` virtualized list page.
192#[derive(Clone, Copy, Getter)]
193pub struct DataSignals {
194    /// Reactive vertical scroll offset driving the 10,000-row virtualized list.
195    #[get(type(copy))]
196    pub(crate) list_scroll_y: Signal<f32>,
197}
198
199/// Lazily initialized signals powering the `/game3d` PBR + BVH ray-tracing page.
200#[derive(Clone, Copy, Debug, Getter)]
201pub struct Engine3dSignals {
202    /// Shared mutable runtime 3D graphics/ray-tracing configuration adjusted live from UI controls.
203    #[get(type(copy))]
204    pub(crate) engine3d_quality: Signal<RenderQualityConfig>,
205    /// Reactive 3D quality preset index (`0=Low, 1=Medium, 2=High, 3=Ultra, 4=Cinematic`).
206    #[get(type(copy))]
207    pub(crate) engine3d_preset_idx: Signal<usize>,
208    /// Reactive 3D ray-tracing mode index (`0=Off, 1=Shadows, 2=Shadows+Refl, 3=Full GI`).
209    #[get(type(copy))]
210    pub(crate) engine3d_rt_idx: Signal<usize>,
211    /// Reactive 3D internal resolution scale percentage (`40.0..=125.0`).
212    #[get(type(copy))]
213    pub(crate) engine3d_res_scale: Signal<f32>,
214    /// Reactive 3D open-world time of day (`6.0..=23.0` hours).
215    #[get(type(copy))]
216    pub(crate) engine3d_time_of_day: Signal<f32>,
217    /// Pending live 3D model import request counter consumed on the next 3D tick.
218    #[get(type(copy))]
219    pub(crate) engine3d_import_queue: Signal<u64>,
220    /// Human-readable status of the most recent 3D model import.
221    #[get(type(copy))]
222    pub(crate) engine3d_import_status: Signal<String>,
223    /// Active 3D camera perspective mode (`0=Chase, 1=Hood, 2=Orbit, 3=Aerial`).
224    #[get(type(copy))]
225    pub(crate) engine3d_camera_mode: Signal<u8>,
226}
227
228/// Lazily initialized signals powering the `/dynamic` OTA & WASM showcase page.
229#[derive(Clone, Copy, Getter)]
230pub struct DynamicSignals {
231    /// Sibling counter preserved untouched during surgical component-level dynamic updates.
232    #[get(type(copy))]
233    pub(crate) sibling_counter: Signal<i32>,
234    /// Human-readable log of the most recent action dispatched from a dynamically updated control.
235    #[get(type(copy))]
236    pub(crate) dynamic_action_log: Signal<String>,
237    /// Simulated offline network mode toggle for verifying verified offline WASM cache hits.
238    #[get(type(copy))]
239    pub(crate) wasm_offline: Signal<bool>,
240    /// Live human-readable readout of the latest dynamic WASM download or fault verification case.
241    #[get(type(copy))]
242    pub(crate) wasm_fault_status: Signal<String>,
243    /// Active background worker handle building `.wasm` OTA fixtures off the UI thread.
244    #[get(type(copy))]
245    pub(crate) wasm_bg_task: Signal<Option<BackgroundTask<WasmSampleBundle>>>,
246}
247
248/// Lazily initialized signals powering the `/lab` UI & Edge Lab page.
249#[derive(Clone, Copy, Getter)]
250pub struct LabSignals {
251    /// Controlled shadcn `EuvAlertDialog` open state.
252    #[get(type(copy))]
253    pub(crate) alert_dialog_open: Signal<bool>,
254    /// Controlled shadcn `EuvAlertDialog` confirmed status.
255    #[get(type(copy))]
256    pub(crate) alert_dialog_confirmed: Signal<bool>,
257    /// Controlled shadcn `EuvCollapsible` expanded state.
258    #[get(type(copy))]
259    pub(crate) collapsible_open: Signal<bool>,
260    /// Controlled shadcn `EuvToggleGroup` active option index.
261    #[get(type(copy))]
262    pub(crate) toggle_group_index: Signal<usize>,
263    /// Controlled shadcn `EuvInputOtp` passcode string.
264    #[get(type(copy))]
265    pub(crate) otp_code: Signal<String>,
266    /// Controlled shadcn `EuvCommand` search filter text.
267    #[get(type(copy))]
268    pub(crate) command_query: Signal<String>,
269    /// Controlled shadcn `EuvCommand` selected action index.
270    #[get(type(copy))]
271    pub(crate) command_selected: Signal<Option<usize>>,
272    /// Controlled shadcn `EuvHoverCard` open flag.
273    #[get(type(copy))]
274    pub(crate) hover_card_open: Signal<bool>,
275    /// Controlled shadcn `EuvCalendar` selected day of month.
276    #[get(type(copy))]
277    pub(crate) calendar_day: Signal<u32>,
278    /// Controlled shadcn `EuvMenubar` active menu index.
279    #[get(type(copy))]
280    pub(crate) menubar_active: Signal<Option<usize>>,
281    /// Controlled shadcn `EuvCarousel` active slide index.
282    #[get(type(copy))]
283    pub(crate) carousel_index: Signal<usize>,
284    /// Controlled search query for `EuvCombobox` in the UI & Edge Lab.
285    #[get(type(copy))]
286    pub(crate) lab_combobox_query: Signal<String>,
287    /// Controlled selected index for `EuvCombobox`.
288    #[get(type(copy))]
289    pub(crate) lab_combobox_selected: Signal<usize>,
290    /// Controlled open flag for `EuvCombobox`.
291    #[get(type(copy))]
292    pub(crate) lab_combobox_open: Signal<bool>,
293    /// Controlled filter string for `EuvDataTable`.
294    #[get(type(copy))]
295    pub(crate) lab_table_filter: Signal<String>,
296    /// Controlled sort order for `EuvDataTable`.
297    #[get(type(copy))]
298    pub(crate) lab_table_sort_asc: Signal<bool>,
299    /// Controlled selected row index for `EuvDataTable`.
300    #[get(type(copy))]
301    pub(crate) lab_table_selected: Signal<Option<usize>>,
302    /// Controlled selected day for `EuvDatePicker`.
303    #[get(type(copy))]
304    pub(crate) lab_date_day: Signal<u32>,
305    /// Controlled open flag for `EuvDatePicker`.
306    #[get(type(copy))]
307    pub(crate) lab_date_open: Signal<bool>,
308    /// Controlled domain input value for `EuvInputGroup`.
309    #[get(type(copy))]
310    pub(crate) lab_input_group_val: Signal<String>,
311    /// Controlled selected index for `EuvNativeSelect`.
312    #[get(type(copy))]
313    pub(crate) lab_native_select_idx: Signal<usize>,
314    /// Controlled active dropdown index for `EuvNavigationMenu`.
315    #[get(type(copy))]
316    pub(crate) lab_nav_menu_active: Signal<Option<usize>>,
317    /// Controlled split ratio for `EuvResizable`.
318    #[get(type(copy))]
319    pub(crate) lab_split_ratio: Signal<f32>,
320    /// Toggle controlling whether the nested edge-case box blocks scroll penetration (`true`) or allows chaining (`false`).
321    #[get(type(copy))]
322    pub(crate) lab_block_scroll_chain: Signal<bool>,
323    /// Toggle controlling whether the nested edge-case box stops click event bubbling (`true`) or allows bubbling (`false`).
324    #[get(type(copy))]
325    pub(crate) lab_stop_click_bubble: Signal<bool>,
326    /// Counter tracking clicks received by the outer parent card in the event bubbling test.
327    #[get(type(copy))]
328    pub(crate) lab_parent_clicks: Signal<u32>,
329    /// Counter tracking clicks received by the inner button in the event bubbling test.
330    #[get(type(copy))]
331    pub(crate) lab_child_clicks: Signal<u32>,
332    /// Persistent counter proving live resize never destroys or resets page state.
333    #[get(type(copy))]
334    pub(crate) lab_resize_preserve_count: Signal<u32>,
335    /// Controlled direction mode toggle (`false=LTR, true=RTL`).
336    #[get(type(copy))]
337    pub(crate) lab_rtl_mode: Signal<bool>,
338}
339
340/// Lazily initialized signals powering the `/media` Media Studio page.
341#[derive(Clone, Copy, Getter)]
342pub struct MediaSignals {
343    /// Reactive animated GIF playback state for the Media Studio showcase.
344    #[get(type(copy))]
345    pub(crate) media_gif: Signal<GifAnimation>,
346    /// Reactive LIVE Photo motion state for the Media Studio showcase.
347    #[get(type(copy))]
348    pub(crate) media_live: Signal<LivePhotoAsset>,
349    /// Reactive cross-platform video track state for the Media Studio showcase.
350    #[get(type(copy))]
351    pub(crate) media_video: Signal<VideoTrack>,
352    /// Reactive WAV audio track and waveform state for the Media Studio showcase.
353    #[get(type(copy))]
354    pub(crate) media_audio: Signal<AudioTrack>,
355    /// Reactive multi-page PDF document state for the Media Studio showcase.
356    #[get(type(copy))]
357    pub(crate) media_pdf: Signal<PdfDocument>,
358    /// Most recently clicked native HTML hyperlink URI in the Media Studio showcase.
359    #[get(type(copy))]
360    pub(crate) media_html_link_log: Signal<String>,
361    /// Reactive indicator set while Media Studio codecs decode on a background worker thread.
362    #[get(type(copy))]
363    pub(crate) media_loading: Signal<bool>,
364    /// Active background worker handle decoding Media Studio sample codecs off the UI thread.
365    #[get(type(copy))]
366    pub(crate) media_bg_task: Signal<Option<BackgroundTask<MediaSampleBundle>>>,
367}
368
369/// Lazily initialized signals powering the `/markdown` Markdown & Code Studio page.
370#[derive(Clone, Copy, Getter)]
371pub struct MarkdownSignals {
372    /// Latest copied code block telemetry readout on `/markdown`.
373    #[get(type(copy))]
374    pub(crate) markdown_copy_log: Signal<String>,
375    /// Latest clicked Markdown hyperlink URL readout on `/markdown`.
376    #[get(type(copy))]
377    pub(crate) markdown_link_log: Signal<String>,
378    /// Total GFM checklist tasks toggled interactively on `/markdown`.
379    #[get(type(copy))]
380    pub(crate) markdown_tasks_toggled: Signal<u32>,
381    /// Selected code example language tab index on `/markdown` (`0=Rust, 1=TS, 2=JSON, 3=Diff`).
382    #[get(type(copy))]
383    pub(crate) markdown_lang_tab: Signal<usize>,
384    /// Toggle controlling whether text inside the Markdown & Code Studio is selectable.
385    #[get(type(copy))]
386    pub(crate) markdown_selectable: Signal<bool>,
387}
388
389/// Lazily initialized signals powering the `/stress` Stress Lab page.
390#[derive(Clone, Copy, Getter)]
391pub struct StressSignals {
392    /// Live interactive UI stress benchmark results for `/stress`.
393    #[get(type(copy))]
394    pub(crate) stress_results: Signal<Vec<StressCaseResult>>,
395    /// Latest interactive UI stress benchmark status readout for `/stress`.
396    #[get(type(copy))]
397    pub(crate) stress_summary: Signal<String>,
398}
399
400/// Lazily initialized signals powering the `/charts` ECharts Studio page.
401#[derive(Clone, Copy, Getter)]
402pub struct ChartsSignals {
403    /// Active category filter index on `/charts` (`0=All`, `1=Cartesian`, `2=Financial`, `3=Radial`, `4=Hierarchy`, `5=Geo & Flow`).
404    #[get(type(copy))]
405    pub(crate) charts_category_idx: Signal<usize>,
406    /// Live interaction readout updated when hovering, clicking, toggling legends, or dragging DataZoom on `/charts`.
407    #[get(type(copy))]
408    pub(crate) charts_event_log: Signal<String>,
409}
410
411/// Lazily initialized signals powering the `/water` gyroscope liquid physics studio page.
412#[derive(Clone, Copy, Debug, Getter)]
413pub struct WaterSignals {
414    /// Liquid tank fill ratio percentage (`25.0..=80.0`).
415    #[get(type(copy))]
416    pub(crate) fill_pct: Signal<f32>,
417    /// Active viscosity preset index (`0 = Water 1.0 mPa·s`, `1 = Light Oil`, `2 = Honey`).
418    #[get(type(copy))]
419    pub(crate) viscosity_idx: Signal<usize>,
420    /// Toggle controlling whether Archimedes buoyant bodies (orb and ice cube) are active.
421    #[get(type(copy))]
422    pub(crate) buoyant_enabled: Signal<bool>,
423    /// Fullscreen portal visibility flag for the liquid tank.
424    #[get(type(copy))]
425    pub(crate) fullscreen_open: Signal<bool>,
426    /// Status message displayed for browser/OS motion sensor permission requests.
427    #[get(type(copy))]
428    pub(crate) sensor_perm_status: Signal<String>,
429    /// Reactive live physics, gravity, and frame-timing telemetry mirrored from `GyroLiquidGameScene`.
430    #[get(type(copy))]
431    pub(crate) stats: Signal<GyroLiquidStats>,
432}
433
434/// Zero-boot-cost lazy `GameScene` wrapper deferring `GyroLiquidGameScene` allocation until `/water` is visited.
435#[derive(Clone, Debug, Getter)]
436pub struct LazyWaterScene {
437    /// Shared lazily allocated liquid scene handle (`None` at boot until `/water` is visited).
438    pub(crate) scene_cell: Rc<RefCell<Option<GyroLiquidGameScene>>>,
439    /// Shared lazy cell holding `/water` control and telemetry signals.
440    pub(crate) signals_cell: Rc<Cell<Option<WaterSignals>>>,
441}
442
443/// Reactive application state powering the cross-platform showcase with minimal boot signals and lazy route-scoped signal groups.
444#[derive(Clone, Getter)]
445pub struct ShowcaseState {
446    /// Active route path signal.
447    #[get(type(copy))]
448    pub(crate) route: Signal<String>,
449    /// Root ownership scope retaining lazily materialized showcase signals across route evictions and global WASM slot swaps.
450    #[get(type(copy))]
451    pub(crate) state_scope: Scope,
452    /// Active reactive theme state across all 17 design schemes and light/dark modes.
453    pub(crate) theme: UiThemeState,
454    /// Embedded deterministic 2D physics game host rendered directly inside `euv`.
455    pub(crate) game_host: GameEngineHost,
456    /// Embedded AAA 3D open-world PBR + BVH ray-tracing game host.
457    pub(crate) game3d_host: GameEngineHost,
458    /// Embedded real-time SI PBF gyroscope liquid water host (zero allocation at boot until `/water` is visited).
459    pub(crate) water_host: GameEngineHost,
460    /// Lazily materialized `GyroLiquidGameScene` handle shared between `water_host` and `/water` UI controls.
461    pub(crate) water_scene_cell: Rc<RefCell<Option<GyroLiquidGameScene>>>,
462    /// Shared hub managing live component-level and page-level dynamic OTA updates.
463    pub(crate) dynamic_hub: DynamicUpdateHub,
464    /// Cross-platform in-memory WASM CDN registry serving real `.wasm` binaries and fault scenarios.
465    pub(crate) wasm_registry: RegistryWasmFetcher,
466    /// Dynamic WASM download, verification, sandbox execution, cache, and rollback manager.
467    pub(crate) wasm_manager: WasmDynamicManager,
468    /// Controlled global Command Palette modal visibility flag.
469    #[get(type(copy))]
470    pub(crate) cmd_palette_open: Signal<bool>,
471    /// Controlled global Command Palette filter query.
472    #[get(type(copy))]
473    pub(crate) cmd_palette_query: Signal<String>,
474    /// Reactive preference controlling whether shell chrome auto-hides on content scroll.
475    #[get(type(copy))]
476    pub(crate) auto_hide_chrome: Signal<bool>,
477    /// Reactive preference controlling live FPS counter pill visibility in the topbar.
478    #[get(type(copy))]
479    pub(crate) show_fps_hud: Signal<bool>,
480    /// Reactive preference controlling horizontal swipe navigation across registered routes.
481    #[get(type(copy))]
482    pub(crate) swipe_routing: Signal<bool>,
483    /// Reactive accessibility preference minimizing non-essential animations.
484    #[get(type(copy))]
485    pub(crate) reduced_motion: Signal<bool>,
486    /// Persistent lazy-loading page-lifecycle router shared across the showcase shell.
487    pub(crate) router: EuvRouter,
488    /// Guard flag ensuring routes are registered on `router` once.
489    pub(crate) router_ready: Rc<Cell<bool>>,
490    /// Total lazy page `on_mount` lifecycle hooks executed.
491    #[get(type(copy))]
492    pub(crate) lifecycle_mounts: Signal<u32>,
493    /// Total `PageRetention::Freeze` `on_freeze` hooks executed on route leave.
494    #[get(type(copy))]
495    pub(crate) lifecycle_freezes: Signal<u32>,
496    /// Total `on_resume` hooks executed when returning to a frozen page.
497    #[get(type(copy))]
498    pub(crate) lifecycle_resumes: Signal<u32>,
499    /// Total `on_destroy` hooks executed on page disposal.
500    #[get(type(copy))]
501    pub(crate) lifecycle_destroys: Signal<u32>,
502    /// Latest human-readable page lifecycle transition log line.
503    #[get(type(copy))]
504    pub(crate) lifecycle_last_event: Signal<String>,
505    /// Rolling log of recent normalized cross-platform `SystemEvent` entries.
506    #[get(type(copy))]
507    pub(crate) system_event_log: Signal<Vec<String>>,
508    /// Total count of normalized `SystemEvent` notifications observed in this session.
509    #[get(type(copy))]
510    pub(crate) system_event_count: Signal<u32>,
511    /// Reactive flag indicating whether showcase pages are currently frozen in background.
512    #[get(type(copy))]
513    pub(crate) bg_frozen: Signal<bool>,
514    /// Total count of background freeze transitions executed across showcase pages.
515    #[get(type(copy))]
516    pub(crate) bg_freeze_count: Signal<u32>,
517    /// Total count of lossless foreground restore transitions executed across showcase pages.
518    #[get(type(copy))]
519    pub(crate) bg_restore_count: Signal<u32>,
520    /// Snapshot of whether the 2D physics game host was running immediately before entering background.
521    pub(crate) bg_snap_game2d_running: Rc<Cell<bool>>,
522    /// Snapshot of whether the 3D ray-tracing host was running immediately before entering background.
523    pub(crate) bg_snap_game3d_running: Rc<Cell<bool>>,
524    /// Snapshot of whether the gyroscope liquid water host was running immediately before entering background.
525    pub(crate) bg_snap_water_running: Rc<Cell<bool>>,
526    /// Snapshot of whether Media Studio animated GIF playback was playing before background.
527    pub(crate) bg_snap_gif_playing: Rc<Cell<bool>>,
528    /// Snapshot of whether Media Studio LIVE Photo motion burst was playing before background.
529    pub(crate) bg_snap_live_playing: Rc<Cell<bool>>,
530    /// Snapshot of whether Media Studio video playback was playing before background.
531    pub(crate) bg_snap_video_playing: Rc<Cell<bool>>,
532    /// Snapshot of whether Media Studio audio playback was playing before background.
533    pub(crate) bg_snap_audio_playing: Rc<Cell<bool>>,
534    /// Guard flag ensuring Media Studio sample codecs/frames hydrate lazily on first `/media` visit.
535    pub(crate) media_loaded: Rc<Cell<bool>>,
536    /// Guard flag ensuring `.wasm` OTA binaries populate lazily on first `/dynamic` visit.
537    pub(crate) wasm_registry_loaded: Rc<Cell<bool>>,
538    /// Guard flag ensuring Stress Lab workload catalog hydrates lazily on first `/stress` visit.
539    pub(crate) stress_loaded: Rc<Cell<bool>>,
540    /// Guard flag ensuring ECharts Studio 20-series catalog hydrates lazily on first `/charts` visit.
541    pub(crate) charts_loaded: Rc<Cell<bool>>,
542    /// Enables off-main-thread background workers for heavy `/media`, `/dynamic`, and `/game3d` route payloads on interactive native targets.
543    pub(crate) bg_workers_enabled: Rc<Cell<bool>>,
544    /// Default host platform index applied lazily when `/window` signals initialize.
545    pub(crate) default_host_plat_idx: Rc<Cell<usize>>,
546    /// Lazily materialized `/reactive` signals (`None` at boot).
547    pub(crate) reactive_signals: Rc<Cell<Option<ReactiveSignals>>>,
548    /// Lazily materialized `/render` and `/window` signals (`None` at boot).
549    pub(crate) render_window_signals: Rc<Cell<Option<RenderWindowSignals>>>,
550    /// Lazily materialized `/forms` signals (`None` at boot).
551    pub(crate) forms_signals: Rc<Cell<Option<FormsSignals>>>,
552    /// Lazily materialized `/overlays` signals (`None` at boot).
553    pub(crate) overlays_signals: Rc<Cell<Option<OverlaysSignals>>>,
554    /// Lazily materialized `/data` signals (`None` at boot).
555    pub(crate) data_signals: Rc<Cell<Option<DataSignals>>>,
556    /// Lazily materialized `/game3d` signals (`None` at boot).
557    pub(crate) engine3d_signals: Rc<Cell<Option<Engine3dSignals>>>,
558    /// Lazily materialized `/dynamic` signals (`None` at boot).
559    pub(crate) dynamic_signals: Rc<Cell<Option<DynamicSignals>>>,
560    /// Lazily materialized `/lab` signals (`None` at boot).
561    pub(crate) lab_signals: Rc<Cell<Option<LabSignals>>>,
562    /// Lazily materialized `/media` signals (`None` at boot).
563    pub(crate) media_signals: Rc<Cell<Option<MediaSignals>>>,
564    /// Lazily materialized `/markdown` signals (`None` at boot).
565    pub(crate) markdown_signals: Rc<Cell<Option<MarkdownSignals>>>,
566    /// Lazily materialized `/stress` signals (`None` at boot).
567    pub(crate) stress_signals: Rc<Cell<Option<StressSignals>>>,
568    /// Lazily materialized `/charts` signals (`None` at boot).
569    pub(crate) charts_signals: Rc<Cell<Option<ChartsSignals>>>,
570    /// Lazily materialized `/water` signals (`None` at boot).
571    pub(crate) water_signals: Rc<Cell<Option<WaterSignals>>>,
572}
573
574/// Full-featured 2D arcade arena scene powered by `GameWorld`, `PhysicsWorld2D`, `Camera2D`, `ParticleSystem`, `TileMap`, `ActionMap`, and `AudioBus`.
575#[derive(Clone, Data, Debug)]
576pub struct DemoPhysicsScene {
577    /// Generational ECS entity arena holding player, drones, projectiles, and obstacles.
578    pub(crate) world: GameWorld,
579    /// Spatial-hash 2D rigid-body physics and raycast solver.
580    pub(crate) physics: PhysicsWorld2D,
581    /// 2D follow camera with trauma-based screen shake and frustum culling.
582    #[get(type(copy))]
583    pub(crate) camera: Camera2D,
584    /// Zero-allocation pooled neon particle engine.
585    pub(crate) particles: ParticleSystem,
586    /// Frustum-culled tiled arena map with solid corner pillars.
587    pub(crate) tilemap: TileMap,
588    /// Declarative arcade input bindings (WASD, Arrows, Space/Click fire, E dash, R wave).
589    pub(crate) actions: ActionMap,
590    /// Deterministic cross-platform sound cue bus.
591    pub(crate) audio: AudioBus,
592    /// Player ship entity handle.
593    #[get(type(copy))]
594    pub(crate) player_id: EntityId,
595    /// Remaining weapon cooldown in seconds.
596    #[get(type(copy))]
597    pub(crate) fire_cooldown: f32,
598    /// Remaining dash cooldown in seconds.
599    #[get(type(copy))]
600    pub(crate) dash_cooldown: f32,
601    /// Current player arcade score.
602    #[get(type(copy))]
603    pub(crate) score: u32,
604    /// Current wave counter.
605    #[get(type(copy))]
606    pub(crate) wave: u32,
607    /// Toggle for wireframe collider debug visualization.
608    #[get(type(copy))]
609    pub(crate) show_colliders: bool,
610    /// Smoothed real-time frames-per-second telemetry.
611    #[get(type(copy))]
612    pub(crate) smoothed_fps: f32,
613    /// Total fixed physics ticks simulated.
614    #[get(type(copy))]
615    pub(crate) ticks: u64,
616    /// Last rendered viewport size in logical pixels for responsive camera framing in inline and fullscreen modes.
617    #[get(type(copy))]
618    pub(crate) viewport_size: Size,
619    /// Whether the full arena tilemap, entities, and particle pool have been lazily initialized.
620    #[get(type(copy))]
621    pub(crate) initialized: bool,
622    /// Double-buffered immutable 2D world snapshots enabling discontinuity-safe alpha interpolation.
623    pub(crate) snapshots: DoubleBufferedSnapshot<World2DSnapshot>,
624    /// Reusable per-tick despawn buffer preventing fresh `Vec` allocation during collision resolution.
625    pub(crate) to_despawn_scratch: Vec<(EntityId, Point, bool)>,
626    /// Fixed tick counter corresponding to `cached_interp`.
627    #[get(type(copy))]
628    pub(crate) last_sampled_tick: u64,
629    /// Quantized alpha (`(alpha * 1000.0).round() as i32`) corresponding to `cached_interp`.
630    #[get(type(copy))]
631    pub(crate) last_sampled_alpha_milli: i32,
632    /// Cached interpolated snapshot preventing duplicate interpolation on HUD-only repaints.
633    pub(crate) cached_interp: Option<World2DSnapshot>,
634}
635
636/// Interactive AAA 3D open-world city scene with PBR shading, BVH ray tracing, model importing, and runtime settings.
637#[derive(Clone, Data, Debug)]
638pub struct DemoOpenWorld3DScene {
639    /// Open-world 3D city scene graph with instanced towers, reflective wet boulevard, and drivable GT car.
640    pub(crate) world: World3D,
641    /// Zero-allocation PBR + BVH ray-tracing renderer.
642    pub(crate) renderer: Renderer3D,
643    /// Shared arcade action bindings for driving/flying the 3D scene.
644    pub(crate) actions: ActionMap,
645    /// Shared lazy cell holding `/game3d` control signals (`None` at boot until `/game3d` is entered).
646    pub(crate) signals_cell: Rc<Cell<Option<Engine3dSignals>>>,
647    /// Root ownership scope retaining lazily materialized `/game3d` signals across route evictions.
648    #[get(type(copy))]
649    pub(crate) state_scope: Scope,
650    /// Shared flag enabling off-main-thread `World3D::create_open_world_city()` initialization on interactive native apps.
651    pub(crate) bg_workers_enabled: Rc<Cell<bool>>,
652    /// Active background task constructing the Vice Boulevard 3D city meshes and BVH off the UI thread.
653    pub(crate) bg_city_task: Option<BackgroundTask<World3D>>,
654    /// Last processed import counter.
655    #[get(type(copy))]
656    pub(crate) last_import_seq: u64,
657    /// Smoothed real-time FPS telemetry.
658    #[get(type(copy))]
659    pub(crate) smoothed_fps: f32,
660    /// Whether the 3D city meshes, materials, and BVH acceleration structure have been lazily built.
661    #[get(type(copy))]
662    pub(crate) initialized: bool,
663    /// Double-buffered immutable 3D world snapshots for high-refresh alpha interpolation and camera-cut snapping.
664    pub(crate) snapshots: DoubleBufferedSnapshot<World3DSnapshot>,
665    /// Bounded reusable RGBA8 frame pool avoiding steady-state per-frame heap allocations on CPU fallback.
666    pub(crate) frame_pool: RenderBufferPool,
667    /// Same-device GPU composite target tracking independent world and HUD dirty revisions.
668    pub(crate) gpu_target: GpuCompositeTarget,
669    /// Monotonic frame submission fence value guarding pooled 3D frame leases.
670    #[get(type(copy))]
671    pub(crate) frame_fence: u64,
672    /// Last applied 3D camera mode for instant discontinuity-safe camera-cut detection.
673    #[get(type(copy))]
674    pub(crate) last_camera_mode: u8,
675    /// Monotonic fixed simulation tick counter for 3D snapshot commits.
676    #[get(type(copy))]
677    pub(crate) ticks: u64,
678    /// Cached rendered 3D world frame reused across HUD-only overlay updates without re-ray-tracing.
679    pub(crate) cached_world_frame: Option<ImageBuffer>,
680    /// World revision matching `cached_world_frame`.
681    #[get(type(copy))]
682    pub(crate) cached_world_rev: u64,
683    /// Quantized interpolation alpha matching `cached_world_frame`.
684    #[get(type(copy))]
685    pub(crate) cached_alpha_milli: i32,
686    /// Internal render dimensions `(width, height)` matching `cached_world_frame`.
687    #[get(type(copy))]
688    pub(crate) cached_dims: (u32, u32),
689    /// Active quality configuration matching `cached_world_frame`.
690    #[get(type(copy))]
691    pub(crate) cached_quality: RenderQualityConfig,
692}