zsui 0.3.0-alpha.2

Rust-first feature-gated native UI framework for Win32, AppKit, and Linux.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ZsuiComponentCategory {
    Layout,
    Navigation,
    Input,
    Collection,
    Feedback,
    Overlay,
    Media,
    Composite,
}

impl ZsuiComponentCategory {
    pub const fn category_name(self) -> &'static str {
        match self {
            Self::Layout => "layout",
            Self::Navigation => "navigation",
            Self::Input => "input",
            Self::Collection => "collection",
            Self::Feedback => "feedback",
            Self::Overlay => "overlay",
            Self::Media => "media",
            Self::Composite => "composite",
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ZsuiComponentStatus {
    Ready,
    FirstPass,
    ContractOnly,
    NotStarted,
}

impl ZsuiComponentStatus {
    pub const fn status_name(self) -> &'static str {
        match self {
            Self::Ready => "ready",
            Self::FirstPass => "first_pass",
            Self::ContractOnly => "contract_only",
            Self::NotStarted => "not_started",
        }
    }

    pub const fn has_runtime_surface(self) -> bool {
        matches!(self, Self::Ready | Self::FirstPass)
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
pub struct ZsuiComponentDescriptor {
    pub component_name: &'static str,
    pub winui_analogue: &'static str,
    pub category: ZsuiComponentCategory,
    pub status: ZsuiComponentStatus,
    pub feature_name: Option<&'static str>,
    pub source_path: &'static str,
    pub missing_before_ready: &'static [&'static str],
}

impl ZsuiComponentDescriptor {
    pub const fn category_name(self) -> &'static str {
        self.category.category_name()
    }

    pub const fn status_name(self) -> &'static str {
        self.status.status_name()
    }
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct ZsuiComponentCatalogSummary {
    pub total_count: usize,
    pub ready_count: usize,
    pub first_pass_count: usize,
    pub contract_only_count: usize,
    pub not_started_count: usize,
    pub runtime_surface_count: usize,
    pub missing_component_names: Vec<&'static str>,
}

pub fn zsui_component_catalog() -> &'static [ZsuiComponentDescriptor] {
    ZSUI_COMPONENT_CATALOG
}

pub fn zsui_component_catalog_summary() -> ZsuiComponentCatalogSummary {
    let ready_count = ZSUI_COMPONENT_CATALOG
        .iter()
        .filter(|component| component.status == ZsuiComponentStatus::Ready)
        .count();
    let first_pass_count = ZSUI_COMPONENT_CATALOG
        .iter()
        .filter(|component| component.status == ZsuiComponentStatus::FirstPass)
        .count();
    let contract_only_count = ZSUI_COMPONENT_CATALOG
        .iter()
        .filter(|component| component.status == ZsuiComponentStatus::ContractOnly)
        .count();
    let not_started_count = ZSUI_COMPONENT_CATALOG
        .iter()
        .filter(|component| component.status == ZsuiComponentStatus::NotStarted)
        .count();

    ZsuiComponentCatalogSummary {
        total_count: ZSUI_COMPONENT_CATALOG.len(),
        ready_count,
        first_pass_count,
        contract_only_count,
        not_started_count,
        runtime_surface_count: ready_count + first_pass_count,
        missing_component_names: ZSUI_COMPONENT_CATALOG
            .iter()
            .filter(|component| !component.status.has_runtime_surface())
            .map(|component| component.component_name)
            .collect(),
    }
}

const BASIC_CONTROL_GAPS: &[&str] = &["accessibility", "non-Windows target interaction proof"];
const TEXT_INPUT_GAPS: &[&str] = &[
    "complete UIA rich attributes/embedded-object ranges and AppKit/GTK target assistive-technology proof",
    "real macOS/Linux CJK candidate-window and extended composition interaction matrix",
];
const VIRTUAL_LIST_GAPS: &[&str] = &["variable-height row metrics", "non-Windows runtime smoke"];
const IMAGE_PREVIEW_GAPS: &[&str] = &[
    "animated and multi-frame image formats",
    "color-profile, HDR and wide-gamut management",
    "image accessibility semantics",
    "AppKit and GTK4 target screenshot evidence",
];
const VIDEO_GAPS: &[&str] = &[
    "framework media-source adapters for camera, file and network decoding",
    "audio output, transport controls, seeking and subtitle tracks",
    "hardware surfaces, HDR and color-space management",
    "media accessibility semantics and three-platform target playback proof",
];
const PLATFORM_GAPS: &[&str] = &[
    "settings-row accessibility relationships",
    "AppKit and GTK target interaction proof",
];
const NAVIGATION_GAPS: &[&str] = &[
    "adaptive pane, compact mode, top mode and back-button behavior",
    "hover, pressed and focus-visible navigation-item state polish",
    "accessibility navigation and selected-item providers",
    "AppKit and GTK4 target interaction smoke",
];
const TOOLTIP_GAPS: &[&str] = &[
    "top-level overflow popup",
    "macOS and Linux target interaction smoke",
];
const CONTENT_DIALOG_GAPS: &[&str] = &[
    "explicit title/body labelled-by and described-by relationships",
    "custom ViewNode body plus validation and asynchronous response deferrals",
    "AppKit and Linux target interaction and assistive-technology smoke",
];
const FLYOUT_GAPS: &[&str] = &[
    "platform accessibility announcement and Flyout-specific AT-SPI action proof",
    "detachable AppKit popover and nested overlay stacking validation",
    "AppKit/Linux Escape, light-dismiss and resize target interaction matrix",
];
const TOAST_GAPS: &[&str] = &[
    "accessibility live-region announcement and reduced-motion transition",
    "hover/focus timeout pause plus multi-toast queue and priority replacement",
    "AppKit and GTK4 target interaction smoke",
];
const INFO_BAR_GAPS: &[&str] = &[
    "accessibility live-region announcement and close deferral semantics",
    "multiline custom View content plus bidirectional-layout validation",
    "AppKit and GTK4 target interaction smoke",
];
const TEACHING_TIP_GAPS: &[&str] = &[
    "accessibility announcement, semantic popover relationships and focus handoff/restoration",
    "light-dismiss, close cancellation/deferrals and scrolling-target behavior",
    "hero media, semantic icon, arbitrary View content, RTL and the full WinUI placement set",
    "AppKit and GTK4 target interaction smoke",
];
const BREADCRUMB_GAPS: &[&str] = &[
    "accessibility navigation/current/expanded relationships and focus announcements",
    "editable/file-system paths, semantic item icons, drag-and-drop and complete RTL behavior",
    "scroll/resize validation plus AppKit and GTK4 target interaction smoke",
];
const SLIDER_GAPS: &[&str] = &[
    "AppKit and GTK4 target interaction smoke",
    "touch and precision-trackpad tuning",
];
const NUMBER_BOX_GAPS: &[&str] = &[
    "localized decimal formatting and expression evaluation",
    "assistive range representation while the nullable value is empty",
    "button hover/pressed polish, press-and-hold autorepeat, mouse-wheel stepping and macOS modifier stepping",
    "AppKit and GTK4 target interaction smoke",
];
const AUTO_SUGGEST_GAPS: &[&str] = &[
    "accessibility search-field, expanded-state and active-descendant providers",
    "mouse-wheel paging for long suggestion lists",
    "AppKit and GTK4 target interaction smoke",
];
const COMMAND_PALETTE_GAPS: &[&str] = &[
    "accessibility search-dialog, result-list and active-descendant providers",
    "ranked fuzzy matching, multilingual transliteration and application-managed recent commands",
    "virtualized large command sets plus AppKit and GTK4 target interaction smoke",
];
const TREE_GAPS: &[&str] = &[
    "accessibility tree level, expanded-state and selection providers",
    "multi-selection, drag-and-drop and large-tree virtualization",
    "AppKit and GTK4 target interaction smoke",
];
const GRID_VIEW_GAPS: &[&str] = &[
    "accessibility grid, row, item and selection providers",
    "multi-selection, rubber-band selection, drag-and-drop, sections and custom item templates",
    "owned scrolling and large-collection virtualization",
    "AppKit and GTK4 target interaction smoke",
];
const TABLE_GAPS: &[&str] = &[
    "accessibility tree-grid, row, column-header and grid-cell providers",
    "cell focus/editing, validation, multi-selection and interactive column resize/reorder",
    "large-table virtualization plus AppKit and GTK4 target interaction smoke",
];
const TOGGLE_BUTTON_GAPS: &[&str] = &[
    "optional indeterminate state and grouped selection behavior",
    "AppKit and GTK4 target interaction smoke",
];
const PASSWORD_BOX_GAPS: &[&str] = &[
    "Caps Lock warning, GTK secure-text role and target assistive-technology proof",
    "Windows Alt+F8 press-and-hold reveal shortcut",
    "platform memory-lock integration beyond owned-value zeroization",
    "AppKit and GTK4 target interaction smoke",
];
const RADIO_GAPS: &[&str] = &[
    "accessibility selection provider",
    "AppKit and GTK4 target interaction smoke",
];
const PROGRESS_GAPS: &[&str] =
    &["AppKit and Linux target screenshot and assistive-technology smoke"];
const PROGRESS_RING_GAPS: &[&str] = &[
    "system reduced-motion preference",
    "AppKit and Linux target animation screenshot and assistive-technology smoke",
];
const COMBO_GAPS: &[&str] = &[
    "accessibility expanded and selection providers",
    "AppKit and GTK4 target interaction smoke",
];
const DATE_PICKER_GAPS: &[&str] = &[
    "localized date, month and weekday formatting",
    "WinUI segmented month/day/year entry fields and field visibility",
    "accessibility value and calendar-grid providers",
    "AppKit and GTK4 platform-style metrics and target interaction smoke",
];
const TIME_PICKER_GAPS: &[&str] = &[
    "system-locale clock selection and localized labels",
    "WinUI hour/minute/period entry-field structure",
    "accessibility value and picker-column providers",
    "AppKit and GTK4 target interaction smoke",
];
const COLOR_PICKER_GAPS: &[&str] = &[
    "editable RGB/HSV/hexadecimal text fields, saved swatches and eyedropper",
    "flyout commit/cancel policy and complete WinUI field layout",
    "accessibility color-value and range-value providers",
    "HDR and color-space management plus AppKit and GTK4 target interaction smoke",
];
const GRID_GAPS: &[&str] = &[
    "content-sized automatic tracks and baseline alignment",
    "accessibility grouping semantics",
    "AppKit and GTK4 target layout smoke",
];
const CANVAS_GAPS: &[&str] = &["path-construction primitives and multi-pointer or touch input"];
const MENU_FLYOUT_GAPS: &[&str] = &[];
const ACCORDION_GAPS: &[&str] = &[
    "dedicated disclosure accessibility relationship and target assistive-technology proof",
    "animated expansion and AppKit/GTK4 target interaction smoke",
];
const CONTEXT_MENU_GAPS: &[&str] = &[
    "keyboard context-menu-key invocation and target assistive-technology proof",
    "AppKit and GTK4 target interaction smoke",
];
const TABS_GAPS: &[&str] = &[
    "hover, pressed and focus-visible header state polish",
    "accessibility tab-list and tab-panel providers",
    "document-tab close, reorder and overflow behavior",
];
const DOCUMENT_SHELL_GAPS: &[&str] = &[
    "keyboard focus and accessibility provider",
    "dark and high-contrast target smoke",
    "non-Windows native host binding",
];
const ICON_GAPS: &[&str] = &[
    "GTK and macOS native icon-theme binding",
    "bundled vector fallback",
    "high-contrast target smoke",
];
const BADGE_GAPS: &[&str] = &[
    "parent-owned accessibility announcement and state-change notification",
    "AppKit and GTK target screenshot proof",
];
const SPLIT_VIEW_GAPS: &[&str] = &[
    "drag-resizable divider and persisted pane extent",
    "RTL leading and trailing resolution",
    "accessibility group relationship",
    "AppKit and Linux target interaction proof",
];

macro_rules! component {
    ($name:literal, $analogue:literal, $category:ident, $status:ident, $feature:expr, $path:literal, $gaps:expr) => {
        ZsuiComponentDescriptor {
            component_name: $name,
            winui_analogue: $analogue,
            category: ZsuiComponentCategory::$category,
            status: ZsuiComponentStatus::$status,
            feature_name: $feature,
            source_path: $path,
            missing_before_ready: $gaps,
        }
    };
}

pub const ZSUI_COMPONENT_CATALOG: &[ZsuiComponentDescriptor] = &[
    component!(
        "stack",
        "StackPanel",
        Layout,
        FirstPass,
        None,
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "grid",
        "Grid",
        Layout,
        FirstPass,
        Some("grid"),
        "src/view/mod.rs",
        GRID_GAPS
    ),
    component!(
        "border",
        "Border",
        Layout,
        FirstPass,
        None,
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "scroll",
        "ScrollViewer",
        Layout,
        FirstPass,
        Some("scroll"),
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "split_view",
        "SplitView",
        Layout,
        FirstPass,
        Some("split-view"),
        "src/split_view.rs + src/view/widgets/split_view.rs",
        SPLIT_VIEW_GAPS
    ),
    component!(
        "canvas",
        "Canvas",
        Layout,
        FirstPass,
        Some("canvas"),
        "src/canvas.rs + src/view/widgets/canvas.rs + UiDocument + three desktop renderers",
        CANVAS_GAPS
    ),
    component!(
        "navigation",
        "NavigationView",
        Navigation,
        FirstPass,
        Some("shell"),
        "src/view/widgets/data.rs + src/view/widgets/button.rs + src/widget_render.rs",
        NAVIGATION_GAPS
    ),
    component!(
        "tabs",
        "TabView",
        Navigation,
        FirstPass,
        Some("tabs"),
        "src/components.rs + src/view/mod.rs + src/widget_render.rs",
        TABS_GAPS
    ),
    component!(
        "breadcrumb",
        "BreadcrumbBar",
        Navigation,
        FirstPass,
        Some("breadcrumb"),
        "src/breadcrumb.rs + src/view/mod.rs + src/widget_render.rs",
        BREADCRUMB_GAPS
    ),
    component!(
        "command_bar",
        "CommandBar",
        Navigation,
        FirstPass,
        Some("document-shell"),
        "src/view/widgets/data.rs + src/view/widgets/button.rs + native menu services",
        DOCUMENT_SHELL_GAPS
    ),
    component!(
        "text",
        "TextBlock",
        Input,
        FirstPass,
        Some("label"),
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "button",
        "Button",
        Input,
        FirstPass,
        Some("button"),
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "toggle_button",
        "ToggleButton",
        Input,
        FirstPass,
        Some("toggle-button"),
        "src/view/mod.rs + src/widget_render.rs + src/native_input_visuals.rs",
        TOGGLE_BUTTON_GAPS
    ),
    component!(
        "checkbox",
        "CheckBox",
        Input,
        FirstPass,
        Some("checkbox"),
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "toggle",
        "ToggleSwitch",
        Input,
        FirstPass,
        Some("toggle"),
        "src/progress.rs + src/view/widgets/button.rs + src/widget_render.rs + UIA/AppKit/AccessKit accessibility providers",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "textbox",
        "TextBox",
        Input,
        FirstPass,
        Some("textbox"),
        "src/view/mod.rs + src/native_input_visuals.rs + three desktop input runtimes",
        TEXT_INPUT_GAPS
    ),
    component!(
        "password_box",
        "PasswordBox",
        Input,
        FirstPass,
        Some("password-box"),
        "src/password_box.rs + src/view/mod.rs + src/native_input_visuals.rs",
        PASSWORD_BOX_GAPS
    ),
    component!(
        "combo_box",
        "ComboBox",
        Input,
        FirstPass,
        Some("combo"),
        "src/view/mod.rs",
        COMBO_GAPS
    ),
    component!(
        "radio_button",
        "RadioButton",
        Input,
        FirstPass,
        Some("radio"),
        "src/view/mod.rs",
        RADIO_GAPS
    ),
    component!(
        "slider",
        "Slider",
        Input,
        FirstPass,
        Some("slider"),
        "src/view/mod.rs",
        SLIDER_GAPS
    ),
    component!(
        "number_box",
        "NumberBox",
        Input,
        FirstPass,
        Some("number-box"),
        "src/view/mod.rs + src/widget_render.rs",
        NUMBER_BOX_GAPS
    ),
    component!(
        "auto_suggest",
        "AutoSuggestBox",
        Input,
        FirstPass,
        Some("auto-suggest"),
        "src/auto_suggest.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        AUTO_SUGGEST_GAPS
    ),
    component!(
        "date_picker",
        "DatePicker",
        Input,
        FirstPass,
        Some("date-picker"),
        "src/date.rs + src/view/mod.rs + src/widget_render.rs",
        DATE_PICKER_GAPS
    ),
    component!(
        "time_picker",
        "TimePicker",
        Input,
        FirstPass,
        Some("time-picker"),
        "src/time.rs + src/view/mod.rs + src/widget_render.rs",
        TIME_PICKER_GAPS
    ),
    component!(
        "color_picker",
        "ColorPicker",
        Input,
        FirstPass,
        Some("color-picker"),
        "src/color_picker.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        COLOR_PICKER_GAPS
    ),
    component!(
        "list",
        "ListView",
        Collection,
        FirstPass,
        Some("list"),
        "src/view/mod.rs",
        BASIC_CONTROL_GAPS
    ),
    component!(
        "grid_view",
        "GridView",
        Collection,
        FirstPass,
        Some("grid-view"),
        "src/grid_view.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        GRID_VIEW_GAPS
    ),
    component!(
        "tree",
        "TreeView",
        Collection,
        FirstPass,
        Some("tree"),
        "src/tree.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        TREE_GAPS
    ),
    component!(
        "table",
        "DataGrid",
        Collection,
        FirstPass,
        Some("table"),
        "src/table.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        TABLE_GAPS
    ),
    component!(
        "items_repeater",
        "ItemsRepeater",
        Collection,
        FirstPass,
        Some("virtual-list"),
        "src/view/widgets/data.rs + src/view/layout.rs + src/view/paint.rs + src/paged_list.rs",
        VIRTUAL_LIST_GAPS
    ),
    component!(
        "badge",
        "InfoBadge",
        Feedback,
        FirstPass,
        Some("badge"),
        "src/badge.rs + src/view/widgets/badge.rs + three desktop renderers",
        BADGE_GAPS
    ),
    component!(
        "progress_bar",
        "ProgressBar",
        Feedback,
        FirstPass,
        Some("progress"),
        "src/widget_render.rs",
        PROGRESS_GAPS
    ),
    component!(
        "progress_ring",
        "ProgressRing",
        Feedback,
        FirstPass,
        Some("progress-ring"),
        "src/progress.rs + src/view/mod.rs + three desktop renderers",
        PROGRESS_RING_GAPS
    ),
    component!(
        "toast",
        "TeachingTip (non-targeted)",
        Feedback,
        FirstPass,
        Some("toast"),
        "src/toast.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        TOAST_GAPS
    ),
    component!(
        "info_bar",
        "InfoBar",
        Feedback,
        FirstPass,
        Some("info-bar"),
        "src/info_bar.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        INFO_BAR_GAPS
    ),
    component!(
        "tooltip",
        "ToolTip",
        Feedback,
        FirstPass,
        Some("tooltip"),
        "src/tooltip.rs + src/view/mod.rs + src/native.rs",
        TOOLTIP_GAPS
    ),
    component!(
        "content_dialog",
        "ContentDialog",
        Overlay,
        FirstPass,
        Some("dialog"),
        "src/content_dialog.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        CONTENT_DIALOG_GAPS
    ),
    component!(
        "flyout",
        "Flyout",
        Overlay,
        FirstPass,
        Some("flyout"),
        "src/flyout.rs + src/view/widgets/flyout.rs + src/native.rs + three desktop component profiles",
        FLYOUT_GAPS
    ),
    component!(
        "menu_flyout",
        "MenuFlyout",
        Overlay,
        FirstPass,
        Some("menu-flyout"),
        "src/menu_flyout.rs + src/view/widgets/menu_flyout.rs + src/native.rs + three desktop component profiles",
        MENU_FLYOUT_GAPS
    ),
    component!(
        "context_menu",
        "MenuFlyout / ContextMenu",
        Overlay,
        FirstPass,
        Some("context-menu"),
        "src/view/widgets/menu_flyout.rs + src/view/overlay.rs + src/native.rs",
        CONTEXT_MENU_GAPS
    ),
    component!(
        "accordion",
        "Accordion",
        Composite,
        FirstPass,
        Some("accordion"),
        "src/accordion.rs + src/view/widgets/accordion.rs",
        ACCORDION_GAPS
    ),
    component!(
        "teaching_tip",
        "TeachingTip",
        Overlay,
        FirstPass,
        Some("teaching-tip"),
        "src/teaching_tip.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        TEACHING_TIP_GAPS
    ),
    component!(
        "command_palette",
        "CommandPalette",
        Overlay,
        FirstPass,
        Some("command-palette"),
        "src/command_palette.rs + src/view/mod.rs + src/widget_render.rs + three desktop input runtimes",
        COMMAND_PALETTE_GAPS
    ),
    component!(
        "image",
        "Image",
        Media,
        FirstPass,
        Some("image-preview"),
        "src/image_preview.rs + src/view/widgets/data.rs + three desktop raster renderers",
        IMAGE_PREVIEW_GAPS
    ),
    component!(
        "video",
        "MediaPlayerElement",
        Media,
        FirstPass,
        Some("video"),
        "src/video.rs + src/view/widgets/data.rs + three desktop raster renderers",
        VIDEO_GAPS
    ),
    component!(
        "icon",
        "FontIcon/ImageIcon",
        Media,
        FirstPass,
        Some("icon"),
        "src/icon.rs + src/view/widgets/icon.rs + three desktop renderers",
        ICON_GAPS
    ),
    component!(
        "settings_card",
        "SettingsCard",
        Composite,
        FirstPass,
        Some("shell"),
        "src/view/widgets/data.rs + three desktop component profiles",
        PLATFORM_GAPS
    ),
];

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn catalog_reports_runtime_and_missing_components_separately() {
        let summary = zsui_component_catalog_summary();

        assert_eq!(summary.total_count, ZSUI_COMPONENT_CATALOG.len());
        assert!(summary.runtime_surface_count >= 15);
        assert_eq!(summary.not_started_count, 0);
        assert!(!summary.missing_component_names.contains(&"grid_view"));
        assert!(!summary.missing_component_names.contains(&"tree"));
        assert!(!summary.missing_component_names.contains(&"table"));
        assert!(!summary.missing_component_names.contains(&"content_dialog"));
        assert!(!summary.missing_component_names.contains(&"progress_ring"));
        assert!(!summary.missing_component_names.contains(&"toggle"));
        assert!(!summary.missing_component_names.contains(&"toggle_button"));
        assert!(!summary.missing_component_names.contains(&"info_bar"));
        assert!(!summary.missing_component_names.contains(&"teaching_tip"));
        assert!(!summary.missing_component_names.contains(&"breadcrumb"));
        assert!(!summary.missing_component_names.contains(&"color_picker"));
        assert!(!summary.missing_component_names.contains(&"command_palette"));
        assert!(!summary.missing_component_names.contains(&"image"));
        assert!(!summary.missing_component_names.contains(&"canvas"));
        assert!(!summary.missing_component_names.contains(&"flyout"));
        assert!(!summary.missing_component_names.contains(&"video"));
        assert_eq!(summary.first_pass_count, 47);
        assert_eq!(summary.contract_only_count, 0);
    }

    #[test]
    fn every_component_has_a_unique_name_and_evidence_path() {
        let mut names = std::collections::BTreeSet::new();
        for component in ZSUI_COMPONENT_CATALOG {
            assert!(names.insert(component.component_name));
            assert!(!component.source_path.is_empty());
            assert!(!component.winui_analogue.is_empty());
        }
    }
}