### Compile form doc example (cl) Source: https://github.com/helywin/rynui/blob/main/openspec/changes/075-20261024-add-native-form/evidence/astra-r1.md Compiles the C++ example extracted from docs/form.md using MSVC with C++20 and syntax-only mode. The command exits with code 0, indicating successful compilation. ```text cl /nologo /std:c++20 /permissive- /Zc:__cplusplus /utf-8 /EHsc /Zs /Iinclude out/form-doc-example.cpp ``` -------------------------------- ### Define token gallery frame tests target Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates the rynui_token_gallery_frame_tests executable from token_gallery_frame_tests.cpp, configures it, adds include directories for the token_gallery example, links required libraries, and defines validation font macros. Registers two tests: rynui.token_gallery_frame and rynui.gallery_platform_generic_journey. ```cmake add_executable( rynui_token_gallery_frame_tests token_gallery_frame_tests.cpp ) rynui_configure_cpp_target(rynui_token_gallery_frame_tests) target_include_directories( rynui_token_gallery_frame_tests PRIVATE "${PROJECT_SOURCE_DIR}/examples/token_gallery" ) target_link_libraries( rynui_token_gallery_frame_tests PRIVATE rynui_token_gallery_definition rynui_token_gallery_reference_surface rynui_token_gallery_document_viewport rynui_components rynui_renderer_common ) target_compile_definitions( rynui_token_gallery_frame_tests PRIVATE "RYNUI_VALIDATION_LATIN_FONT=\"${RYNUI_VALIDATION_LATIN_FONT_FILE}\"" "RYNUI_VALIDATION_CJK_FONT=\"${RYNUI_VALIDATION_CJK_FONT_FILE}\"" ) add_test(NAME rynui.token_gallery_frame COMMAND rynui_token_gallery_frame_tests) add_test( NAME rynui.gallery_platform_generic_journey COMMAND rynui_token_gallery_frame_tests ) ``` -------------------------------- ### Define token gallery contract test Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Registers the rynui.token_gallery_contract test, invoking CMake with definition source, runtime source, examples CMake path, and the verify_token_gallery_contract.cmake script. ```cmake add_test( NAME rynui.token_gallery_contract COMMAND ${CMAKE_COMMAND} "-DDEFINITION_SOURCE=${PROJECT_SOURCE_DIR}/examples/token_gallery/token_gallery_definition.cpp" "-DRUNTIME_SOURCE=${PROJECT_SOURCE_DIR}/examples/token_gallery/token_gallery_runtime.cpp" "-DEXAMPLES_CMAKE=${PROJECT_SOURCE_DIR}/examples/CMakeLists.txt" -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/verify_token_gallery_contract.cmake" ) ``` -------------------------------- ### Table with Pagination Example Source: https://github.com/helywin/rynui/blob/main/docs/table.md Shows a strongly-typed Table with sorting, row selection, pagination, and a Pagination component. Requires a custom Order type with equality operator and signals for data, sort, selection, and page. The Table uses controlled sort and selection, and the Pagination updates the page signal. ```cpp struct Order { ryn::String id; ryn::String customer; int amount; friend bool operator==(const Order&, const Order&) = default; }; ryn::Signal> orders{ std::vector{{u8"o-1", u8"张三", 120}, {u8"o-2", u8"李四", 80}}}; ryn::Signal sort{ryn::TableSort{}}; ryn::Signal> selected{std::vector{}}; ryn::Signal page{1}; ryn::Table(ryn::TableProps{} .dataSource(orders) .rowKey([](const Order& order) { return order.id; }) .columns({ ryn::TableColumn{u8"customer", u8"客户", [](ryn::TableCell cell) { ryn::Text(ryn::TextProps{}.content(ryn::bind([cell] { return cell.value().customer; }))); }}.width(200.0F), ryn::TableColumn{u8"amount", u8"金额", [](ryn::TableCell cell) { ryn::Text(ryn::TextProps{}.content(ryn::bind([cell] { return ryn::String::from_utf8(std::to_string(cell.value().amount)).value(); }))); }}.width(120.0F).align(ryn::TableAlign::Right) .sorter([](const Order& a, const Order& b) { return a.amount < b.amount; }) }) .sort(sort) .onSortChange([sort](ryn::TableSort value) { sort.set(std::move(value)); }) .rowSelection({selected, [selected](auto keys) { selected.set(std::move(keys)); }, {}}) .current(page).pageSize(std::size_t{10}).scrollY(200.0F).bordered()); ryn::Pagination(ryn::PaginationProps{} .total(ryn::bind([orders] { return orders.get().size(); })) .current(page).pageSize(std::size_t{10}) .onChange([page](auto next, auto) { page.set(next); })); ``` -------------------------------- ### 更新成本优先级 Source: https://github.com/helywin/rynui/blob/main/docs/architecture.md 列出从低成本到高成本的更新优先级:GPU instance update、Paint/Primitive rebuild、Layout、Structural rebuild。 ```text GPU instance update < Paint/Primitive rebuild < Layout < Structural rebuild ``` -------------------------------- ### Define token gallery benchmark target Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates the rynui_token_gallery_benchmark executable from token_gallery_benchmark.cpp, configures it, adds include directory for src, links rynui_graphics and rynui_theme, and registers the rynui.token_gallery_benchmark test. ```cmake add_executable(rynui_token_gallery_benchmark token_gallery_benchmark.cpp) rynui_configure_cpp_target(rynui_token_gallery_benchmark) target_include_directories( rynui_token_gallery_benchmark PRIVATE "${PROJECT_SOURCE_DIR}/src") target_link_libraries( rynui_token_gallery_benchmark PRIVATE rynui_graphics rynui_theme) add_test(NAME rynui.token_gallery_benchmark COMMAND rynui_token_gallery_benchmark) ``` -------------------------------- ### Linux GCC 构建、测试与运行 Source: https://github.com/helywin/rynui/blob/main/README.md 使用 CMake preset 配置、构建、测试并运行示例。需要 CMake 3.25+、Ninja 和 C++20 工具链。 ```bash cmake --preset linux-gcc cmake --build --preset linux-gcc-debug ctest --preset linux-gcc-debug ./out/build/linux-gcc/examples/Debug/rynui_token_gallery ``` -------------------------------- ### RynUI CMakeLists.txt Source: https://github.com/helywin/rynui/blob/main/CMakeLists.txt Top-level CMake configuration for the RynUI project. Sets minimum CMake version, project metadata, includes custom modules, defines options, resolves dependencies, and adds subdirectories for source, examples, and tests. ```cmake cmake_minimum_required(VERSION 3.25) project(RynUI VERSION 0.1.0 LANGUAGES C CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(RynUIMsvcDependencies) include(RynUIArchitecture) include(RynUIDependencies) include(cmake/dependencies/RynUIUtf8proc.cmake) include(cmake/dependencies/RynUISheenBidi.cmake) include(RynUIShaders) include(CTest) option(RYNUI_BUILD_EXAMPLES "Build RynUI examples" ON) include(RynUIBackends) set(RYNUI_EXPECTED_TOOLCHAIN "" CACHE STRING "Expected compiler family for preset validation") set_property(CACHE RYNUI_EXPECTED_TOOLCHAIN PROPERTY STRINGS "" msvc gcc clang) if(PROJECT_IS_TOP_LEVEL) rynui_verify_build_contract() endif() if(RYNUI_HAS_SDL_HOST) rynui_resolve_sdl3() rynui_resolve_platform_font_service() endif() if(RYNUI_HAS_SDL_GPU) rynui_resolve_shadercross_host_tool( RYNUI_SHADERCROSS_COMMAND RYNUI_SHADERCROSS_DEPENDENCY) rynui_add_shader_targets( "${RYNUI_SHADERCROSS_COMMAND}" "${RYNUI_SHADERCROSS_DEPENDENCY}") endif() rynui_resolve_text_dependencies() rynui_resolve_utf8proc() rynui_resolve_sheenbidi() rynui_resolve_validation_fonts( RYNUI_VALIDATION_LATIN_FONT_FILE RYNUI_VALIDATION_CJK_FONT_FILE ) add_subdirectory(src) rynui_verify_public_api("${CMAKE_CURRENT_SOURCE_DIR}/include/ryn") rynui_verify_core_includes("${CMAKE_CURRENT_SOURCE_DIR}/src") if(RYNUI_BUILD_EXAMPLES) add_subdirectory(examples) endif() if(BUILD_TESTING) rynui_resolve_bidi_validation_fonts() add_subdirectory(tests) endif() ``` -------------------------------- ### Custom icon with IconVector Source: https://github.com/helywin/rynui/blob/main/docs/icon.md Defines a custom icon using an immutable IconVector with a viewBox and path commands. Coordinates are absolute within the viewBox, y-axis points down. Each contour must start with Move, contain drawing segments, and end with Close. ```cpp IconVector diamond{ IconViewBox{0, 0, 100, 100}, {IconPath{IconColorRole::Primary, {IconMove{{50, 0}}, IconLine{{100, 50}}, IconLine{{50, 100}}, IconLine{{0, 50}}, IconClose{}}}}}; Icon(IconProps{}.source(IconSource{diamond})); ``` -------------------------------- ### Build and test commands for Menu and Dropdown components (Debug and Release) Source: https://github.com/helywin/rynui/blob/main/openspec/changes/067-20261023-add-native-menu-and-dropdown/evidence/windows-msvc-headless.md Commands to build and run the headless contract tests for the Menu and Dropdown components using the windows-msvc-headless preset. Debug and Release configurations are built and tested with up to 4 parallel jobs. The test filter runs only the menu_component and dropdown_component tests. ```text cmake --build --preset windows-msvc-headless-debug --parallel 4 --target rynui_portable_menu_component rynui_portable_dropdown_component ctest --preset windows-msvc-headless-debug --parallel 4 -R "^rynui.portable.(menu_component|dropdown_component)$" cmake --build --preset windows-msvc-headless-release --parallel 4 --target rynui_portable_menu_component rynui_portable_dropdown_component ctest --preset windows-msvc-headless-release --parallel 4 -R "^rynui.portable.(menu_component|dropdown_component)$" ``` -------------------------------- ### Create a Select with options, search, clear, and change handler Source: https://github.com/helywin/rynui/blob/main/docs/select.md Mounts a native single-select in an existing window's Content; the window must bind InputComponentHost. Binds a Prop for controlled value, enables search and clear, sets placeholder and not-found text, and updates the prop on change. ```cpp ryn::Signal role{ryn::SelectSelection{1}}; ryn::SelectRef role_ref; // 在已有窗口的 Content 中挂载,窗口需要绑定 InputComponentHost。 ryn::Select(ryn::SelectProps{} .options({{1, u8"管理员"}, {2, u8"成员"}, {3, u8"访客", true}}) .value(role).showSearch().allowClear().placeholder(u8"请选择角色") .notFoundContent(u8"没有匹配项").ref(role_ref) .onChange([role](ryn::SelectSelection value) mutable { role.set(std::move(value)); }) .layout(ryn::LayoutStyle{}.width(ryn::dp(240)))); ``` -------------------------------- ### CMake configure preset with dependency source dirs Source: https://github.com/helywin/rynui/blob/main/openspec/changes/075-20261024-add-native-form/evidence/platform-generic.md Configures the windows-msvc-headless preset, pointing Python and FETCHCONTENT dependency sources to the worktree's own _deps directories. Requires a VS x64 Developer Environment and the ignored out/form-build.ps1 script. ```text cmake --preset windows-msvc-headless -DPython3_EXECUTABLE=C:/Users/jiang/AppData/Local/Programs/Python/Python310/python.exe -DFETCHCONTENT_SOURCE_DIR_RYNUI_FREETYPE=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_freetype-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_HARFBUZZ=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_harfbuzz-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_UTF8PROC=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_utf8proc-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_SHEENBIDI=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_sheenbidi-src ``` -------------------------------- ### TextProps builder usage in StatusContent Source: https://github.com/helywin/rynui/blob/main/openspec/changes/003-20260827-build-text-component-foundation/design.md Example of using the typed TextProps builder to declare a text component with content, tone, and layout. The content is normalized to Prop, tone to Prop, and layout uses LayoutStyle. Convenience overloads for String/u8 literals must call the same TextProps path. ```cpp void StatusContent(const ryn::Signal& status) { ryn::Text( ryn::TextProps{} .content(status) .tone(ryn::TextTone::Secondary) .layout( ryn::LayoutStyle{} .max_width(ryn::dp(320)) .margin_bottom(ryn::dp(8)))); } ``` -------------------------------- ### Configure SYSTEM mode with vcpkg/Conan packages Source: https://github.com/helywin/rynui/blob/main/docs/development/third-party.md Use this PowerShell command to configure a SYSTEM build with version-matched SDL3, FreeType, and HarfBuzz CMake config packages. Must explicitly specify shadercross and two acceptance fonts; configure fails if packages are missing, too old, or lack required targets. ```powershell cmake --preset windows-msvc-system ` -DSDL3_ROOT=D:/deps/SDL3 ` -DFreetype_ROOT=D:/deps/freetype ` -Dharfbuzz_ROOT=D:/deps/harfbuzz ` -DRYNUI_SHADERCROSS_EXECUTABLE=D:/tools/shadercross.exe ` -DRYNUI_SYSTEM_LATIN_FONT_FILE=D:/fonts/NotoSans-Regular.ttf ` -DRYNUI_SYSTEM_CJK_FONT_FILE=D:/fonts/NotoSansCJKsc-Regular.otf ``` ```powershell cmake --build --preset windows-msvc-system-debug ``` ```powershell ctest --preset windows-msvc-system-debug ``` -------------------------------- ### 克隆仓库 Source: https://github.com/helywin/rynui/blob/main/README.md 克隆 RynUI 仓库并进入目录。需要 Git。 ```bash git clone https://github.com/helywin/RynUI.git cd RynUI ``` -------------------------------- ### HEADLESS / Recording 合同构建 Source: https://github.com/helywin/rynui/blob/main/docs/development/building.md 在 x64 Visual Studio Developer Environment 使用独立 preset 构建和测试 HEADLESS 与 RECORDING 后端。该 preset 选择 RYNUI_PLATFORM_BACKEND=HEADLESS 和 RYNUI_RENDER_BACKENDS=RECORDING,关闭原生 examples,跳过 SDL/libdecor、shader host tool、shader 输出与系统字体。 ```powershell cmake --preset windows-msvc-headless cmake --build --preset windows-msvc-headless-debug ctest --preset windows-msvc-headless-debug cmake --build --preset windows-msvc-headless-release ctest --preset windows-msvc-headless-release ``` -------------------------------- ### BUNDLED 模式依赖链 Source: https://github.com/helywin/rynui/blob/main/docs/development/third-party.md 列出 RYNUI_DEPENDENCY_MODE=BUNDLED 时 FetchContent 锁定的依赖及构建步骤。Linux 下包含 patched libdecor 和 cairo plugin,并构建 Noto 验证字体。 ```text RYNUI_DEPENDENCY_MODE=BUNDLED -> FetchContent locked URL -> SHA256 validation -> Linux only: patched libdecor core + cairo plugin in a private build prefix -> SDL3::SDL3 -> RynUI::FreeType -> RynUI::HarfBuzz -> RynUI::SheenBidi (standard C17 atomics) -> build-tree Noto Sans / Noto Sans CJK SC validation fonts -> native host: shadercross CLI -> locked SPIRV-Cross static libraries -> locked official DXC binary archive ``` -------------------------------- ### 基础复现命令 Source: https://github.com/helywin/rynui/blob/main/docs/issues/linux-wayland-resize.md 使用 Wayland 驱动运行 rynui_layout_demo 以复现 resize 问题。 ```sh SDL_VIDEO_DRIVER=wayland ./out/build/linux-gcc/examples/Release/rynui_layout_demo ``` -------------------------------- ### Build Windows Debug with SkipTests Source: https://github.com/helywin/rynui/blob/main/openspec/changes/013-20260925-extract-shared-component-runtime/evidence/pressable-windows-msvc.md Builds the project in Debug configuration, skipping tests. Used for the acceptance run on Windows 11 with MSVC x64. ```powershell ./scripts/build-windows.ps1 -Configuration Debug -SkipTests ``` -------------------------------- ### 构建与测试命令序列 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/073-20261024-add-native-empty-and-result/evidence/integration-c3190b0/closure.md 使用官方 preset `windows-msvc-headless` 配置、构建和测试独立 build tree,Debug 与 Release 均执行完整测试。配置时通过 `-DFETCHCONTENT_SOURCE_DIR_*` 复用已有依赖 source cache。 ```text cmake --preset windows-msvc-headless -B out/build/empty-result-headless -DFETCHCONTENT_SOURCE_DIR_RYNUI_FREETYPE=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_freetype-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_HARFBUZZ=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_harfbuzz-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_SHEENBIDI=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_sheenbidi-src -DFETCHCONTENT_SOURCE_DIR_RYNUI_UTF8PROC=D:/code/RynUI/out/build/windows-msvc-headless/_deps/rynui_utf8proc-src ``` ```text cmake --build out/build/empty-result-headless --config Debug --parallel 4 ``` ```text ctest --test-dir out/build/empty-result-headless -C Debug --output-on-failure -j 4 ``` ```text cmake --build out/build/empty-result-headless --config Release --parallel 4 ``` ```text ctest --test-dir out/build/empty-result-headless -C Release --output-on-failure -j 4 ``` -------------------------------- ### Windows 构建与运行示例 Source: https://github.com/helywin/rynui/blob/main/README.md 使用 PowerShell 脚本构建 Debug 配置并运行 token gallery 示例。需要 Visual Studio C++ x64 工具。 ```powershell ./scripts/build-windows.ps1 -Configuration Debug ./out/build/windows-msvc/examples/Debug/rynui_token_gallery.exe ``` -------------------------------- ### 复现 Windows 原生 Select 验收 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/058-20261023-add-native-select/evidence/windows.md 运行 Debug 和 Release 矩阵测试,然后验证证据并检查可执行文件。 ```powershell python openspec/changes/058-20261023-add-native-select/evidence/run_native_matrix.py Debug python openspec/changes/058-20261023-add-native-select/evidence/run_native_matrix.py Release python openspec/changes/058-20261023-add-native-select/evidence/verify_native_evidence.py --check-executables ``` -------------------------------- ### Define gallery document benchmark target Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates the rynui_gallery_document_benchmark executable from gallery_document_benchmark.cpp, configures it, adds include directory for src, links rynui_token_gallery_document_viewport and rynui_runtime, and registers the rynui.gallery_document_benchmark test. ```cmake add_executable( rynui_gallery_document_benchmark gallery_document_benchmark.cpp ) rynui_configure_cpp_target(rynui_gallery_document_benchmark) target_include_directories( rynui_gallery_document_benchmark PRIVATE "${PROJECT_SOURCE_DIR}/src" ) target_link_libraries( rynui_gallery_document_benchmark PRIVATE rynui_token_gallery_document_viewport rynui_runtime ) add_test( NAME rynui.gallery_document_benchmark COMMAND rynui_gallery_document_benchmark ) ``` -------------------------------- ### 复现环境信息 Source: https://github.com/helywin/rynui/blob/main/docs/issues/linux-wayland-resize.md 列出复现问题所需的系统环境与输出配置。 ```text session=Wayland desktop=GNOME 50.4 compositor=Mutter 50.4 system_libdecor=0.2.5-1 bundled_SDL=3.4.14 wayland_protocols=1.49-1 gpu_driver=Vulkan output_left=eDP-1, 2560x1600, 240 Hz, scale 1.333333 output_right=HDMI-1, 1920x1080, 60 Hz, scale 1.0 ``` -------------------------------- ### Define theme allocation benchmark Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates the rynui_theme_allocation_benchmark executable, includes the src directory, links rynui_runtime and rynui_theme, and registers the test as rynui.theme_allocation. ```cmake add_executable(rynui_theme_allocation_benchmark theme_allocation_benchmark.cpp) rynui_configure_cpp_target(rynui_theme_allocation_benchmark) target_include_directories( rynui_theme_allocation_benchmark PRIVATE "${PROJECT_SOURCE_DIR}/src") target_link_libraries( rynui_theme_allocation_benchmark PRIVATE rynui_runtime rynui_theme) add_test(NAME rynui.theme_allocation COMMAND rynui_theme_allocation_benchmark) ``` -------------------------------- ### 查询 ninja 文件中的 include 路径 Source: https://github.com/helywin/rynui/blob/main/docs/development/vscode.md 在 Windows 构建树中运行此 PowerShell 命令,以获取实际的 include 路径,用于更新 c_cpp_properties.json。 ```powershell Select-String -Path out/build/windows-msvc/CMakeFiles/impl-Debug.ninja -Pattern '^\s*INCLUDES = ' ``` -------------------------------- ### 诊断对照命令 Source: https://github.com/helywin/rynui/blob/main/docs/issues/linux-wayland-resize.md 使用 X11 驱动运行同一二进制作为诊断对照,不属于 task 6.3 验收。 ```sh SDL_VIDEO_DRIVER=x11 ./out/build/linux-gcc/examples/Release/rynui_layout_demo ``` -------------------------------- ### 运行原生 smoke 测试 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/076-20261024-add-empty-and-result-gallery/evidence/states-gallery.md 用于运行 Windows 原生 smoke 测试的可执行文件路径。 ```text out/build/windows-msvc/examples/Debug/rynui_token_gallery.exe --smoke ``` -------------------------------- ### PowerShell: Build and test affected targets with MSVC Ninja presets Source: https://github.com/helywin/rynui/blob/main/openspec/changes/077-20261025-add-native-date-picker/evidence/common.md Run incremental builds and ctest for the affected target set using the windows-msvc-headless presets in a VS x64 Developer Environment. The script defines portable targets, appends test targets, builds both debug and release configurations with four parallel jobs, then runs ctest with a regex filter. Final results were Debug 30/30 and Release 30/30. ```powershell $portable = @( 'input_component', 'input_variant', 'input_actions', 'input_public_api', 'input_display', 'input_caret_blink', 'button_component', 'button_scene_service', 'theme_algorithm', 'theme_runtime', 'select_component', 'select_theme', 'dropdown_component', 'modal_component', 'modal_boundary', 'modal_theme', 'popconfirm_component', 'tooltip_component', 'window_overlay', 'focus_lifecycle', 'pointer_route', 'scene_backend' ) $targets = @($portable | ForEach-Object { "rynui_portable_$_" }) + @( 'rynui_feedback_component_tests', 'rynui_feedback_theme_tests', 'rynui_input_number_component_tests', 'rynui_date_picker_model_tests', 'rynui_date_picker_public_api_tests', 'rynui_date_picker_component_tests', 'rynui_date_picker_theme_tests' ) cmake --build --preset windows-msvc-headless-debug --target $targets --parallel 4 cmake --build --preset windows-msvc-headless-release --target $targets --parallel 4 $pattern = '^rynui\.(portable\.(' + (($portable + @('backend_boundaries')) -join '|') + ')|feedback_component|feedback_theme|input_number_component|date_picker_(model|public_api|component|theme))$' ctest --preset windows-msvc-headless-debug -R $pattern --output-on-failure ctest --preset windows-msvc-headless-release -R $pattern --output-on-failure ``` -------------------------------- ### Spin Source: https://github.com/helywin/rynui/blob/main/docs/feedback.md Shows loading state while preserving wrapped content. Supports custom indicator and description, with pointer and keyboard blocking during loading. ```APIDOC ## Spin ### Description Shows loading state while preserving wrapped content. Supports custom indicator and description, with pointer and keyboard blocking during loading. ### Props - **spinning** (`Prop`) - Optional - Default true. Controls loading state. - **description** (`Prop`) - Optional - Text shown below the indicator. - **size** (`ControlSize::Small/Middle/Large`) - Optional - Controls indicator size; default icon 14/20/32 logical px. ### Slots - **SpinSlots::indicator** - Replaces the default loading icon; mounted once, custom animation is the slot's responsibility. - **SpinContent** - Wrapped content; always preserved. During loading, a Theme mask is drawn over it, and pointer, Tab/keyboard, and text editing are blocked. ### Behavior - Content size does not change when loading toggles; standalone Spin collapses to zero size when not spinning. - Default `LoadingOutlined` uses Icon's finite-period rotation; only animates when visible, window active, and motion preferences allow. Reduced motion shows static icon. - On restore, child controls keep their own disabled/eligible values; old focus is not automatically restored. ``` -------------------------------- ### Build test targets for windows-msvc-headless Source: https://github.com/helywin/rynui/blob/main/openspec/changes/065-20261023-add-native-feedback-components/validation.md List of test targets to build with the windows-msvc-headless presets. Use --parallel 4 and only these targets. ```text rynui_feedback_public_api_tests rynui_feedback_theme_tests rynui_feedback_component_tests rynui_tag_badge_public_api_tests rynui_tag_badge_theme_tests rynui_tag_badge_component_tests rynui_portable_icon_component rynui_portable_modal_boundary rynui_portable_modal_component rynui_portable_input_component rynui_portable_theme_algorithm rynui_portable_theme_runtime rynui_portable_logical_scene_packing rynui_portable_scene_backend ``` -------------------------------- ### 运行验收矩阵(Debug/Release)与核验脚本 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/057-20261023-complete-typography-hints-and-editor/evidence/windows.md 在仓库根目录执行,需要 Python/Pillow。先按正式 preset 构建对应 configuration,再运行 Debug 和 Release 的验收矩阵,最后核验证据。verify_native_evidence.py 不带 --check-executables 时只核对已保存产物,可在没有本机 build tree 的 checkout 使用。 ```text python openspec/changes/057-20261023-complete-typography-hints-and-editor/evidence/run_native_matrix.py Debug python openspec/changes/057-20261023-complete-typography-hints-and-editor/evidence/run_native_matrix.py Release python openspec/changes/057-20261023-complete-typography-hints-and-editor/evidence/verify_native_evidence.py --check-executables ``` -------------------------------- ### 运行格式化脚本 format-code.py Source: https://github.com/helywin/rynui/blob/main/docs/development/formatting.md 在仓库根目录运行,处理 Git 跟踪的 include/、src/、examples/、tests/、shaders/ 中的 C/C++ / HLSL 文件,排除 tests/fixtures/。--check 只检查格式,有差异时返回非零状态。 ```text python scripts/format-code.py python scripts/format-code.py --check ``` -------------------------------- ### Alert、Spin 与 Progress 使用示例 Source: https://github.com/helywin/rynui/blob/main/docs/feedback.md 展示三个原生组件的典型用法:Alert 带警告状态、消息、描述、图标、可关闭和自定义操作;Spin 包裹业务内容并显示加载状态;Progress 显示线性和仪表盘进度。使用 typed Props 和 slots,颜色和尺寸从 ThemeConfig 读取。 ```cpp ryn::Signal loading{false}; ryn::Signal visible{true}; ryn::Signal percent{35}; ryn::Alert(ryn::AlertProps{} .status(ryn::Status::Warning) .message(u8"连接不稳定") .description(u8"请检查设备后重试") .showIcon() .visible(visible) .closable() .onClose([=] { visible.set(false); }), ryn::AlertSlots{.action = ryn::AlertAction{[] { ryn::Button(ryn::ButtonProps{}, [] { ryn::Text(u8"重试"); }); }}}); ryn::Spin(ryn::SpinProps{}.spinning(loading).description(u8"正在读取"), ryn::SpinContent{[] { ryn::Text(u8"保留的业务内容"); }}); ryn::Progress(ryn::ProgressProps{}.percent(percent)); ryn::Progress(ryn::ProgressProps{}.type(ryn::ProgressType::Dashboard).percent(percent)); ``` -------------------------------- ### Windows 直接使用 CMake presets Source: https://github.com/helywin/rynui/blob/main/docs/development/building.md 在 Visual Studio Developer PowerShell 中直接执行 configure、build 和 test。根工程会检查 generator 和编译器,Windows 上未解析到 MSVC 或 generator 不是 Ninja Multi-Config 时 configure 会失败。 ```powershell cmake --preset windows-msvc cmake --build --preset windows-msvc-debug ctest --preset windows-msvc-debug ``` -------------------------------- ### 首次挂载与后续更新流程 Source: https://github.com/helywin/rynui/blob/main/docs/architecture.md 描述组件首次挂载时建立持久化 Node 和响应依赖,后续更新通过 Signal 到 Binding 或 RenderPrimitive 的路径。 ```text 首次挂载:Component -> Node Tree + Reactive Dependencies 后续更新:Signal -> Binding -> Node Property / RenderPrimitive ``` -------------------------------- ### Build and test commands for Debug and Release Source: https://github.com/helywin/rynui/blob/main/openspec/changes/068-20261023-add-native-input-number/evidence/common/main-integration.md Commands to build and run the focused integration tests in both Debug and Release configurations using the windows-msvc-headless presets. The build targets are the executable targets corresponding to the filter names; backend_boundaries is a script test with no executable target. Each ctest run uses the same filter and --no-tests=error to fail if no tests match. ```text cmake --build --preset windows-msvc-headless-debug --parallel 4 --target <上述 executable targets> ctest --preset windows-msvc-headless-debug --parallel 4 -R "<上述 filter>" --no-tests=error cmake --build --preset windows-msvc-headless-release --parallel 4 --target <上述 executable targets> ctest --preset windows-msvc-headless-release --parallel 4 -R "<上述 filter>" --no-tests=error ``` -------------------------------- ### Run goldens verification script Source: https://github.com/helywin/rynui/blob/main/openspec/changes/075-20261024-add-native-form/evidence/astra-r1.md Executes the newly built theme algorithm golden writer and then runs the Python verification script against the parent baseline commit. The script checks that five golden files and 26 existing reference IIFEs are unchanged. ```text out/build/windows-msvc-headless/tests/portable/Debug/rynui_portable_theme_algorithm.exe --write-goldens ``` ```text python out/verify-form-goldens.py 6f1b38a53486907bfc890939335180e8ac2df4b7 ``` -------------------------------- ### Windows 构建与验证命令输出 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/006-20260827-establish-ant-design-token-system/evidence/platform-generic-component-theme-migration.md 在 Windows 11 上使用 MSVC 和 Ninja 构建并运行测试、OpenSpec 验证和 git 检查,全部通过。 ```text scripts/build-windows.ps1 -Configuration Debug 120/120 passed exit code: 0 openspec validate --all --strict --no-interactive 6/6 passed exit code: 0 openspec doctor --json healthy: true exit code: 0 git diff --check exit code: 0 ``` -------------------------------- ### Windows 离线构建命令 Source: https://github.com/helywin/rynui/blob/main/docs/development/third-party.md 使用 CMake source override 进行离线构建,无需修改 lock。适用于 Windows 预设,指定各依赖的本地源码目录。 ```powershell cmake --preset windows-msvc ` -DFETCHCONTENT_SOURCE_DIR_SDL3=D:/deps/SDL ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_SDL_SHADERCROSS=D:/deps/SDL_shadercross ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_SPIRV_CROSS=D:/deps/SPIRV-Cross ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_DXC=D:/deps/dxc ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_FREETYPE=D:/deps/freetype ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_HARFBUZZ=D:/deps/harfbuzz ` -DFETCHCONTENT_SOURCE_DIR_RYNUI_SHEENBIDI=D:/deps/SheenBidi ``` -------------------------------- ### 构建与测试命令(PowerShell) Source: https://github.com/helywin/rynui/blob/main/openspec/changes/073-20261024-add-native-empty-and-result/evidence/review-r3-4efa310/acceptance.md 用于构建和运行 12 个目标(Debug 和 Release)的命令,使用 `cmake --build` 和 `ctest`。 ```powershell $targets = @('rynui_empty_result_public_api_tests', 'rynui_empty_result_theme_tests', 'rynui_empty_result_component_tests', 'rynui_input_number_theme_tests', 'rynui_portable_theme_algorithm', 'rynui_portable_theme_runtime', 'rynui_portable_text_component', 'rynui_portable_icon_component', 'rynui_portable_button_component', 'rynui_portable_input_component', 'rynui_portable_switch_features', 'rynui_portable_popconfirm_theme') $pattern = '^(rynui\.empty_result_public_api|rynui\.empty_result_theme|rynui\.empty_result_component|rynui\.input_number_theme|rynui\.portable\.theme_algorithm|rynui\.portable\.theme_runtime|rynui\.portable\.text_component|rynui\.portable\.icon_component|rynui\.portable\.button_component|rynui\.portable\.input_component|rynui\.portable\.switch_features|rynui\.portable\.popconfirm_theme)$' cmake --build out/build/empty-result-headless --config Debug --parallel 4 --target $targets ctest --test-dir out/build/empty-result-headless -C Debug -R $pattern --output-on-failure -V -j 4 cmake --build out/build/empty-result-headless --config Release --parallel 4 --target $targets ctest --test-dir out/build/empty-result-headless -C Release -R $pattern --output-on-failure -V -j 4 ``` -------------------------------- ### Windows 构建脚本(使用已有 SDL3 CMake package) Source: https://github.com/helywin/rynui/blob/main/docs/development/building.md 使用系统或 package-manager 提供的 SDL3 时,通过 -DependencyMode SYSTEM 指定,并传入 SDL3 root 和 shadercross 可执行文件路径。 ```powershell ./scripts/build-windows.ps1 -Configuration Debug -DependencyMode SYSTEM ` -Sdl3Root D:/deps/SDL3 ` -ShadercrossExecutable D:/tools/shadercross.exe ``` -------------------------------- ### 运行模态验收命令 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/061-20261023-add-native-modal/evidence/windows-native-matrix.md 在 Visual Studio Developer Environment 中,使用 windows-msvc 预设构建后,通过此命令运行模态验收测试。替换明暗主题和缩放组合;system 组合省略 scale 参数。 ```text out/build/windows-msvc/examples/Debug/rynui_token_gallery.exe --modal-acceptance --evidence-dir=out/modal-check --acceptance-theme=dark --acceptance-scale=1.25 ``` -------------------------------- ### Drawer Constructor Source: https://github.com/helywin/rynui/blob/main/docs/drawer.md Creates a Drawer component with configurable properties such as open state, title, placement, width, and cancel callback. The Drawer provides a panel that can be docked to any side and supports controlled cancellation. ```APIDOC ## Drawer Constructor ### Description Creates a Drawer component with configurable properties such as open state, title, placement, width, and cancel callback. The Drawer provides a panel that can be docked to any side and supports controlled cancellation. ### Method Constructor ### Signature ```cpp ryn::Drawer(ryn::DrawerProps props, ryn::DrawerContent content, ryn::DrawerSlots slots) ``` ### Parameters #### DrawerProps - **open** (ryn::Signal) - Required - Signal controlling the open state of the drawer. - **title** (string) - Optional - Title of the drawer. - **placement** (ryn::DrawerPlacement) - Optional - Placement of the drawer (Left, Right, Top, Bottom). Default is Right. - **width** (float) - Optional - Width of the drawer when placement is Left or Right. Default is 378. - **height** (float) - Optional - Height of the drawer when placement is Top or Bottom. Default is 378. - **onCancel** (function) - Optional - Callback invoked when the drawer is cancelled, receiving a ryn::DrawerCancelReason. - **closable** (bool) - Optional - Controls whether the close button is shown. - **keyboard** (bool) - Optional - Controls whether the Escape key can close the drawer. - **restoreFocusAfterClose** (bool) - Optional - Whether to restore focus to the trigger element after close. Default is true. - **afterOpenChange** (function) - Optional - Callback invoked after the drawer's open state changes. - **afterClose** (function) - Optional - Callback invoked after the drawer is closed. #### DrawerContent - **content** (function) - Required - A function returning the content of the drawer. #### DrawerSlots - **footer** (ryn::DrawerFooter) - Optional - Footer slot for custom footer content. ### Request Example ```cpp ryn::Signal open{false}; ryn::Drawer(ryn::DrawerProps{}.open(open).title(u8"编辑账户") .placement(ryn::DrawerPlacement::Right).width(420.0F) .onCancel([open](ryn::DrawerCancelReason) mutable { open.set(false); }), ryn::DrawerContent{[] { ryn::Input(ryn::InputProps{}.defaultValue(u8"草稿")); }}, ryn::DrawerSlots{.footer = ryn::DrawerFooter{[open]() mutable { ryn::Button(ryn::ButtonProps{}.onClick([open]() mutable { open.set(false); }), ryn::ButtonContent{[] { ryn::Text(u8"完成"); }}); }}}); ``` ### Response No return value. ``` -------------------------------- ### 阶段 1 构建与测试命令 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/077-20261025-add-native-date-picker/evidence/common.md 用于阶段 1 的 CMake 配置、构建和测试命令。Debug/Release 各 2/2 通过。 ```text cmake --preset windows-msvc-headless -DFETCHCONTENT_BASE_DIR=/out/deps cmake --build --preset windows-msvc-headless-debug --target rynui_date_picker_model_tests rynui_date_picker_public_api_tests --parallel 4 ctest --preset windows-msvc-headless-debug -R "rynui.date_picker_(model|public_api)$" --output-on-failure cmake --build --preset windows-msvc-headless-release --target rynui_date_picker_model_tests rynui_date_picker_public_api_tests --parallel 4 ctest --preset windows-msvc-headless-release -R "rynui.date_picker_(model|public_api)$" --output-on-failure ``` -------------------------------- ### 构建命令:typography-dev.ps1 Source: https://github.com/helywin/rynui/blob/main/openspec/changes/076-20261024-add-empty-and-result-gallery/evidence/states-gallery.md 用于构建 token gallery 和 frame tests 的 PowerShell 命令。 ```powershell out/typography-dev.ps1 -Preset windows-msvc -Target @('rynui_token_gallery','rynui_token_gallery_frame_tests') ``` -------------------------------- ### Define gallery document viewport tests target Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates the rynui_gallery_document_viewport_tests executable from gallery_document_viewport_tests.cpp, configures it, adds include directory for src, links rynui_token_gallery_document_viewport and rynui_runtime, and registers the rynui.gallery_document_viewport test. ```cmake add_executable( rynui_gallery_document_viewport_tests gallery_document_viewport_tests.cpp ) rynui_configure_cpp_target(rynui_gallery_document_viewport_tests) target_include_directories( rynui_gallery_document_viewport_tests PRIVATE "${PROJECT_SOURCE_DIR}/src" ) target_link_libraries( rynui_gallery_document_viewport_tests PRIVATE rynui_token_gallery_document_viewport rynui_runtime ) add_test( NAME rynui.gallery_document_viewport COMMAND rynui_gallery_document_viewport_tests ) ``` -------------------------------- ### Icon usage with source, name, rotate, spin, and twoToneColor Source: https://github.com/helywin/rynui/blob/main/docs/icon.md Shows how to create an Icon with a source signal, rotation, spin, and two-tone color customization. The name and source setters are two entry points to the same source; the last setter takes effect. Rotation is clockwise and must be finite. ```cpp Signal source{IconSource{IconName::HeartTwoTone}}; Signal angle{0}; Icon(IconProps{}.source(source).rotate(angle)); Icon(IconProps{}.name(IconName::LoadingOutlined).spin(true)); Icon(IconProps{}.name(IconName::WalletTwoTone) .twoToneColor(IconTwoToneColor{Color::rgba8(22, 119, 255), Color::rgba8(230, 244, 255)})); ``` -------------------------------- ### Run targeted ctest with windows-msvc-debug preset Source: https://github.com/helywin/rynui/blob/main/openspec/changes/013-20260925-extract-shared-component-runtime/evidence/pressable-windows-msvc.md Runs the specified rynui tests (button_component, input_*, button_spinner_benchmark, token_gallery_frame) with output on failure. All 7 tests passed in the acceptance run. ```bash ctest --preset windows-msvc-debug -R "^rynui\.(button_component|input_(component|pointer|keyboard|journey)|button_spinner_benchmark|token_gallery_frame)$" --output-on-failure ``` -------------------------------- ### Compare Theme Goldens Script Invocation Source: https://github.com/helywin/rynui/blob/main/openspec/changes/071-20261023-add-native-segmented/evidence/common.md Run after generating the current snapshot with `rynui_portable_theme_algorithm --write-goldens`. Compares five golden files field-by-field against the committed baseline, verifying 11,517 leaf fields remain identical. ```text python openspec/changes/071-20261023-add-native-segmented/evidence/compare-theme-goldens.py ``` -------------------------------- ### Release 计数输出 (gpu_driver=vulkan shader_format=SPIR-V display_scale=2) Source: https://github.com/helywin/rynui/blob/main/openspec/changes/003-20260827-build-text-component-foundation/evidence/linux-gcc.md Release 构建下真实 X11 窗口运行 `rynui_text_demo --smoke` 的计数输出。与 Debug 计数相比,`idle_waits` 为 207(Debug 为 205),其余计数一致,`exit_code=0`。 ```text gpu_driver=vulkan shader_format=SPIR-V display_scale=2 mount_runs=1 prop_updates=4 resize_updates=1 font_rasterizations=47 font_cache_hits=0 replacement_count=0 fallback_runs=10 shape_count=5 measure_count=8 layout_count=28 atlas_pages=1 atlas_entries=47 atlas_uploads=46 atlas_uploaded_bytes=7042 instance_count=107 instance_rebuilds=5 material_updates=1 geometry_updates=8 buffer_uploads=6 glyph_draws=7 submits=7 idle_waits=207 exit_code=0 ``` -------------------------------- ### Linux GCC and Clang Build and Test Results Source: https://github.com/helywin/rynui/blob/main/openspec/changes/005-20260827-build-flex-and-space-layout-foundation/evidence/linux-layout-evidence.md Output from the automatic acceptance run for tasks 6.1 and 6.2 on Linux. Shows GCC and Clang builds passing with CTest results (127/127) for Debug and Release configurations. ```text linux-gcc configure=clean linux-gcc compiler=GNU 16.2.1 linux-gcc generator=Ninja Multi-Config linux-gcc dependency_mode=BUNDLED linux-gcc fontconfig=2.18.3 linux-gcc cpp_flags=-std=c++20 linux-gcc Debug build=passed linux-gcc Debug CTest=127/127 passed linux-gcc Release build=passed linux-gcc Release CTest=127/127 passed linux-clang configure=clean linux-clang compiler=Clang 22.1.8 linux-clang generator=Ninja Multi-Config linux-clang dependency_mode=BUNDLED linux-clang cpp_flags=-std=c++20 linux-clang Debug build=passed linux-clang Debug CTest=127/127 passed ``` -------------------------------- ### Tooltip component tests Source: https://github.com/helywin/rynui/blob/main/tests/CMakeLists.txt Creates an executable for tooltip_component_tests.cpp, links against rynui_components, defines font validation macros, and registers a CTest test. ```cmake add_executable(rynui_tooltip_component_tests tooltip_component_tests.cpp) rynui_configure_cpp_target(rynui_tooltip_component_tests) target_link_libraries(rynui_tooltip_component_tests PRIVATE rynui_components) target_compile_definitions(rynui_tooltip_component_tests PRIVATE "RYNUI_VALIDATION_LATIN_FONT=\"${RYNUI_VALIDATION_LATIN_FONT_FILE}\"" "RYNUI_VALIDATION_CJK_FONT=\"${RYNUI_VALIDATION_CJK_FONT_FILE}\"") add_test(NAME rynui.tooltip_component COMMAND rynui_tooltip_component_tests) ```