Skip to content

Improved support for Rive files - #182

Open
kunitoki wants to merge 3 commits into
mainfrom
dev/rive_access_nodes
Open

Improved support for Rive files#182
kunitoki wants to merge 3 commits into
mainfrom
dev/rive_access_nodes

Conversation

@kunitoki

@kunitoki kunitoki commented Sep 7, 2026

Copy link
Copy Markdown
Owner

This pull request introduces major enhancements to the Rive artboard integration, focusing on responsive layout, data binding (ViewModel) support, and improved demo examples. It also adds new configuration options and controls for the artboard demo, making it more interactive and feature-rich. Additionally, it includes updates to documentation and build configuration to support new assets and clarify coding guidelines.

Rive Artboard Features and API Enhancements:

  • Added responsive Rive Layout support to Artboard, including per-node bounds listeners and component attachment APIs (setNodeBoundsListener, attachComponentToNode, etc.), enabling components to track node bounds and transformations in real time.
  • Artboard::setFile() now supports loading a named artboard from a file, not just the default.
  • Introduced Rive ViewModel (data binding) support: new APIs for schema introspection and instance binding, allowing UI components to bind to and update artboard properties via ViewModel instances.

Demo and Example Improvements:

  • Refactored and extended the artboard demo (Artboard.h): added a base class (ArtboardDemoBase), a NodeMarker component for visualizing node tracking, and new UI controls for marker behavior (fill/track, pivot, anchor, transform). [1] [2] [3] [4] [5] [6]
  • Added a new ArtboardLayoutDemo example, which demonstrates attaching a live, nested artboard to a layout node in another artboard.
  • Updated the CMake configuration and resource bundling to include the new layout-ui.riv asset required by the new demo. [1] [2]

Testing and Documentation:

  • Expanded the Rive ViewModel data-binding tests to cover a more complex fixture, with detailed schema assertions and property change tracking.
  • Updated documentation in AGENTS.md and CLAUDE.md to instruct AI assistants to avoid adding obvious comments and instead write more expressive code.

Performance and Code Quality:

  • SDLComponentNative now caches its window units-per-point value, reducing render thread calls to SDL window methods.

These changes collectively improve the flexibility, interactivity, and test coverage of the Rive artboard integration, while making the demo codebase more maintainable and expressive.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.86134% with 325 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.41%. Comparing base (94dfafe) to head (34c8ece).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...yup_gui/artboard/yup_ArtboardViewModelInstance.cpp 52.82% 217 Missing ⚠️
modules/yup_gui/component/yup_Component.cpp 5.71% 33 Missing ⚠️
modules/yup_gui/artboard/yup_Artboard.cpp 87.50% 31 Missing ⚠️
modules/yup_gui/artboard/yup_ArtboardViewModel.cpp 71.57% 27 Missing ⚠️
modules/yup_gui/artboard/yup_ArtboardNode.cpp 81.57% 14 Missing ⚠️
modules/yup_gui/artboard/yup_ArtboardNode.h 50.00% 1 Missing ⚠️
modules/yup_gui/artboard/yup_ArtboardViewModel.h 87.50% 1 Missing ⚠️
...s/yup_gui/artboard/yup_ArtboardViewModelInstance.h 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (65.86%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
- Coverage   81.49%   81.41%   -0.08%     
==========================================
  Files         798      805       +7     
  Lines       83336    84278     +942     
==========================================
+ Hits        67911    68612     +701     
- Misses      15425    15666     +241     
Files with missing lines Coverage Δ
...ules/yup_graphics/primitives/yup_AffineTransform.h 100.00% <100.00%> (+0.50%) ⬆️
modules/yup_gui/artboard/yup_Artboard.h 100.00% <100.00%> (ø)
modules/yup_gui/artboard/yup_ArtboardFile.cpp 65.57% <100.00%> (+65.57%) ⬆️
modules/yup_gui/artboard/yup_ArtboardFile.h 100.00% <100.00%> (ø)
modules/yup_gui/artboard/yup_ArtboardNode.h 50.00% <50.00%> (ø)
modules/yup_gui/artboard/yup_ArtboardViewModel.h 87.50% <87.50%> (ø)
...s/yup_gui/artboard/yup_ArtboardViewModelInstance.h 0.00% <0.00%> (ø)
modules/yup_gui/artboard/yup_ArtboardNode.cpp 81.57% <81.57%> (ø)
modules/yup_gui/artboard/yup_ArtboardViewModel.cpp 71.57% <71.57%> (ø)
modules/yup_gui/artboard/yup_Artboard.cpp 65.17% <87.50%> (+39.08%) ⬆️
... and 2 more

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88e95d5...34c8ece. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant