Skip to content

Move ayon-ui-qt to ayon-core#1873

Open
mahesh-ynput wants to merge 28 commits into
developfrom
48-move-ayon-ui-qt-into-ayon-core
Open

Move ayon-ui-qt to ayon-core#1873
mahesh-ynput wants to merge 28 commits into
developfrom
48-move-ayon-ui-qt-into-ayon-core

Conversation

@mahesh-ynput

Copy link
Copy Markdown
Collaborator
  • Modified all imports

Changelog Description

Merge UI Qt components into core.

Additional info

Testing notes:

can be tested desktop review that using the ayon_core.ui

- Modified all imports
@mahesh-ynput mahesh-ynput requested a review from BigRoy June 3, 2026 18:10
@mahesh-ynput mahesh-ynput self-assigned this Jun 3, 2026
@mahesh-ynput mahesh-ynput linked an issue Jun 3, 2026 that may be closed by this pull request
Comment thread client/pyproject.toml Outdated
@ynbot ynbot moved this to Review In Progress in PR reviewing Jun 3, 2026
Comment thread tests/client/ayon_core/ui/test_data/avatar1.jpg

@BigRoy BigRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are lacking the tests, we are also lacking some of the readme and documentation from ayon-ui-qt that should port over to document the design, etc.

We should really not be losing much on the move.

Comment thread client/ayon_core/ui/vendor/qtmaterialsymbols/__init__.py Outdated
Comment on lines +51 to +54
try:
from qtmaterialsymbols import get_icon # type: ignore
except ImportError:
from ..vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try:
from qtmaterialsymbols import get_icon # type: ignore
except ImportError:
from ..vendor.qtmaterialsymbols import get_icon
try:
from qtmaterialsymbols import get_icon # type: ignore
except ImportError:
from ayon_core.vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iLLiCiTiT , created _get_test_data_dir() for test resources as we moved resources from client to outside in 7a6ffc5, is that bad idea?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW how is the comment related to the suggestion.

try:
from qtmaterialsymbols import get_icon # type: ignore
except ImportError:
from ..vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from ..vendor.qtmaterialsymbols import get_icon
from ayon_core.vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iLLiCiTiT , created _get_test_data_dir() for test resources as we moved resources from client to outside in 7a6ffc5, is that bad idea?

try:
from qtmaterialsymbols import get_icon # type: ignore
except ImportError:
from ..vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from ..vendor.qtmaterialsymbols import get_icon
from ayon_core.vendor.qtmaterialsymbols import get_icon

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iLLiCiTiT , created _get_test_data_dir() for test resources as we moved resources from client to outside in 7a6ffc5, is that bad idea?

…5921d5ad5f0e583dde82c76e08d58432

- removed qtpy from client/pyproject.toml
- removed duplicated client/ayon_core/ui/vendor directory
- moved resources which used for UI testing to tests/client/ayon_core/ui/test_data
- all tests and docs ported from ayon-ui-qt to here
- created _get_test_data_dir() for test resources as we moved resources from client to outside
Comment thread client/ayon_core/ui/__init__.py Outdated
Comment on lines +6 to +13
# Add the vendor directory to sys.path so that we can import vendored where needed.
_vendor_path = os.path.join(
os.path.dirname(__file__), "..", "vendor", "python"
)
if _vendor_path not in sys.path:
sys.path.insert(0, _vendor_path)


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Add the vendor directory to sys.path so that we can import vendored where needed.
_vendor_path = os.path.join(
os.path.dirname(__file__), "..", "vendor", "python"
)
if _vendor_path not in sys.path:
sys.path.insert(0, _vendor_path)

Comment thread client/ayon_core/ui/__init__.py Outdated
sys.path.insert(0, _vendor_path)


def _get_test_data_dir():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad location. Create _test_utils.py and move it there as get_test_data_dir, so it is imported as from ._test_utils import get_test_data_dir.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the end the best solution would be to move the tests to the tests too, but I would NOT do it now.

@philippe-ynput

Copy link
Copy Markdown
Contributor

I am porting over ynput/ayon-ui-qt#54

Restructure module to avoid circular imports and large source files.

Extract StyleDict, StyleData and singleton accessors in ayon_ui_qt.style_types.
Extract all drawer classes in ayon_ui_qt.style and relocate them in ayon_ui_qt.drawers.
Some relocated symbols are still exported from ayon_ui_qt.style for backward compatibility.

Signed-off-by: philippe-ynput <philippe@ynput.io>
Signed-off-by: philippe-ynput <philippe@ynput.io>
Signed-off-by: philippe-ynput <philippe@ynput.io>
@philippe-ynput

Copy link
Copy Markdown
Contributor

CI linting is passing now.

Refactor the UI module to move style-related functions and types from `style.py` to `style_types.py`. This change updates all component imports, documentation, and tests to reflect the new module structure and removes the deprecated `style_widget_and_siblings` function.

Signed-off-by: philippe-ynput <philippe@ynput.io>
Update paths for visual test resources and remove debug print to
align with the new project structure.

Signed-off-by: philippe-ynput <philippe@ynput.io>
Signed-off-by: philippe-ynput <philippe@ynput.io>
* feat(ui): implement custom menu drawer and styling

Add `MenuDrawer` to provide custom painting for `QMenu` widgets using
native `QPainter` calls instead of QSS. This includes support for
custom menu item layouts, background colors, and icon visibility
adjustments for macOS.

- Implement `MenuDrawer` for `PE_PanelMenu`, `PE_FrameMenu`, and
  `CE_MenuItem`.
- Add `QMenu` configuration to `ayon_style.json` with default and
  danger variants.
- Update `AYONStyle` to handle `QMenu` translucency and icon
  visibility in actions.
- Register `MenuDrawer` in the `AYONStyle` drawer registry.

* feat(ui): add optional action menu items and visual tests

Introduce `OptionalAction` to support menu items with secondary
action buttons (option boxes), following the Maya-style pattern.
This includes new component logic, style variants, and visual
regression tests.

- Add `OptionalAction`, `OptionBox`, and `OptionalActionWidget`
  components.
- Implement `optional-action` variant for `QPushButton`, `QLabel`,
  and `QMenu`.
- Update `AYLabel` to support explicit padding and transparent
  icon placeholders.
- Add visual regression tests for `OptionalAction` states including
  hovering on the body and the option box.
- Update `MenuDrawer` to correctly calculate icon gutters for
  complex action layouts.

* test(ui): refactor optional action hover simulation

Update `OptionalMenuTest` to use `qbot` for mouse movement simulation
instead of manually setting highlight properties. This ensures hover
states are triggered via actual input events rather than state
manipulation.

- Remove `_clear_hover` and replace with mouse movement to root.
- Replace manual `set_highlight` calls with `self._qbot.mouseMove`.
- Remove unused `get_icon` import.
- Add assertions for `_qbot` availability in test steps.

* fix(option_action): fix incorrect disabled state

* feat(ui): add contextual menu style and update optional action widget

Add Contextual_Menu variant to QFrameVariants and corresponding style
definition in ayon_style.json. Update OptionalActionWidget to use
AYFrame with the new contextual-menu variant and dynamically retrieve
icon size from style configuration instead of hardcoding.

* fix(ui): Make sure the hover state propagates to all children (frame, label, button).

Add hover propagation to OptionalActionWidget to keep child widgets
in sync with parent hover state. Update ButtonDrawer hover detection
to use widget.underMouse() for more accurate state determination.

* feat(option_action): close parent menus when option is clicked

Add _close_menu_chain method to traverse widget hierarchy and close any
QMenu parents when the option button is clicked.

* fix(ui): apply disabled opacity to button icons

Retrieve the disabled opacity value from style configuration and apply
it to icon colors when rendering disabled states, ensuring consistent
visual feedback for non-interactive buttons.

* fix(menu): Clarify intention for _base_style method and add note on action variant resolution

* fix(menu): Correct hover and disabled state logic in MenuDrawer

* fix(option_action): Update documentation and method references for clarity in OptionalAction

* fix(style): Remove unused import of QKeySequence in AYONStyle main block

* fix(style): fix incorrect single quote in print()

* fix(style): remove incorrect doubled single quote

* fix(style): remove incorrect doubled single quote

* fix(test_option_action): correct docstring.

* feat(ui): rename option action components with AY prefix and add AYMenu

Rename OptionBox, OptionalActionWidget, and OptionalAction to
AYOptionBox, AYOptionalActionWidget, and AYOptionalAction respectively
to follow the AYON UI naming convention. Add new AYMenu class that
paints menus using AYON style for consistent appearance across the
application. Update all references, imports, and visual test snapshots.

BREAKING CHANGE: OptionBox, OptionalAction, and OptionalActionWidget
have been renamed to AYOptionBox, AYOptionalAction, and
AYOptionalActionWidget respectively. Update imports accordingly.

* test(ui): add visual coverage for AYMenu drawer states

Add visual regression snapshots for AYMenu initial, open, nested submenu,
and optional action hover states. Align minimum menu item height across the
menu style, optional action widgets, and drawer row calculations to keep
rendered rows visually consistent.

* chore(AYMenu): forgot to update tests. jeez !

* ci(tests): add Qt runtime setup for PR unit tests

Install Qt runtime dependencies in the PR unit test workflow and run tests
with `QT_QPA_PLATFORM=offscreen` so Qt-based tests can execute reliably in
headless CI.

* ci(ui): Add a comment to force a CI run.

---------

Signed-off-by: philippe-ynput <philippe@ynput.io>
Signed-off-by: philippe-ynput <philippe@ynput.io>
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Jun 18, 2026
@BigRoy BigRoy added the ui label Jun 18, 2026
@moonyuet

moonyuet commented Jun 22, 2026

Copy link
Copy Markdown
Member

I have tested this branch with develop review one.
It works so far. But I assume we also need to resolve unit tests.

@iLLiCiTiT iLLiCiTiT changed the title - Moved ayon-ui-qt to ayon-core Move ayon-ui-qt to ayon-core Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition ui

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

Move ayon-ui-qt into ayon-core

6 participants