[ui/core] Add Validators paradigm#3088
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3088 +/- ##
===========================================
+ Coverage 83.47% 83.62% +0.14%
===========================================
Files 81 83 +2
Lines 10301 10395 +94
===========================================
+ Hits 8599 8693 +94
Misses 1702 1702 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5c972ee to
3559a29
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces an attribute “validators” mechanism in meshroom.core and wires it through to the QML UI so invalid attributes and nodes can be visually flagged and warned about on submit.
Changes:
- Add reusable attribute validators (
NotEmptyValidator,RangeValidator) and expose validation state/messages on runtime attributes/nodes. - Update Graph Editor QML to display per-attribute and per-node warning indicators (orange styling + tooltip messages).
- Add tests and a test node description to exercise the new validation behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
meshroom/core/desc/validators.py |
Adds validator interfaces/helpers and two concrete validators. |
meshroom/core/desc/attribute.py |
Extends attribute description classes to accept validators=. |
meshroom/core/attribute.py |
Executes validators and exposes validation-related properties to the UI layer. |
meshroom/core/node.py |
Adds node-level hasInvalidAttribute property + change signal emission. |
meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml |
Adds per-attribute warning icon/border and tooltip changes. |
meshroom/ui/qml/GraphEditor/Node.qml |
Adds node-level warning icon and orange selection/border when warnings exist. |
meshroom/ui/qml/Application.qml |
Adds a warning dialog when submitting graphs containing nodes with warnings. |
tests/nodes/test/nodeValidators.py |
Adds a test node description that uses validators. |
tests/test_attributes.py |
Adds tests for NotEmpty and Range validation behavior. |
meshroom/common/PySignal.py |
Allows ClassSignal(...) to accept args/kwargs (for typed-signal parity). |
meshroom/core/graph.py |
Adds a new attributeValueChanged signal (currently only declared). |
meshroom/ui/qml/Utils/format.js |
Guards plainToHtml for falsy inputs. |
meshroom/ui/qml/Utils/Colors.qml |
Adds a warning color constant. |
meshroom/ui/commands.py |
Refactors attribute set to go through a single attribute reference. |
Comments suppressed due to low confidence (1)
meshroom/core/desc/attribute.py:4
typesis imported but not used in this module. Please remove the unused import to keep the file clean (and to avoid failing lint checks if/when they are enabled).
import ast
import os
import re
from collections.abc import Iterable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _hasDisplayableShape(self): | ||
| """ |
There was a problem hiding this comment.
name is declared twice on BaseNode (first as constant=True, then again later with notify=nodeNameChanged). The earlier declaration is redundant and can be misleading; please remove the duplicate name = Property(str, getName, constant=True) to keep a single source of truth for the Qt property.
3559a29 to
b4dfda0
Compare
Description
Alicevision related PR
Add a standard way to validate the attribute value.
It add a way to apply validators to an attribute description and to represent in the UI when these attributes are not valid.
Validators
Validators usage (can be a lambda)
Features list