Skip to content

Open in RV web action as dynamic action - #89

Draft
BigRoy wants to merge 2 commits into
developfrom
77-yn-0546-open-review-workfile-with-ocio-context-dynamic-action
Draft

Open in RV web action as dynamic action#89
BigRoy wants to merge 2 commits into
developfrom
77-yn-0546-open-review-workfile-with-ocio-context-dynamic-action

Conversation

@BigRoy

@BigRoy BigRoy commented Jul 16, 2026

Copy link
Copy Markdown
Member

Changelog Description

Open in RV web action as dynamic action.

Additional review information

This requires the server and frontend to actually start serving the dynamic actions, which it doesn't currently. So would require a new server release first.

⚠️ This currently does not work. ⚠️ ☝️

Fix #88

Testing notes:

  1. Open in RV web action should show when relevant.

This requires the server and frontend to actually start serving the dynamic actions, which it doesn't currently. So would require a new server release first.
@BigRoy
BigRoy requested a review from Copilot July 16, 2026 08:06
@BigRoy BigRoy self-assigned this Jul 16, 2026
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Jul 16, 2026
Comment on lines +171 to +173

if not getattr(self, "review_controller", None):
return

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change was actually irrelevant to this PR - will make a separate PR as well.

Comment thread server/action.py
Comment on lines +47 to +48

logger.info(f"Checking if can be opened in context: {context}")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just there for now to debug when this would be called - so that when server gets support for dynamic action we can start checking whether this doesn't call an awful an amount of times and becomes slow or not. :)

But since server doesn't support the get dynamic actions yet... it will never trigger it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the “Open in RV” server action from a static/simple action into a context-dependent dynamic action so it only appears when valid for the current selection, and adds a small client-side guard to avoid panel-opening errors when the review controller is not available.

Changes:

  • Switch server action manifest from SimpleActionManifest to DynamicActionManifest and expose it via get_dynamic_actions gated by can_open_in_rv(context).
  • Add logging inside can_open_in_rv (currently at INFO).
  • Prevent _open_visible_panels from running when review_controller is missing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
server/action.py Converts action manifest to dynamic and adds logging during can_open_in_rv evaluation.
server/__init__.py Switches addon hook from get_simple_actions to get_dynamic_actions and gates action visibility via can_open_in_rv.
client/ayon_openrv/startup/pkgs_source/ayon_menus/ayon_menus.py Adds a guard to avoid calling panel logic when review_controller is not set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/__init__.py Outdated
Comment thread server/action.py
async def can_open_in_rv(context: "ActionContext") -> bool:
"""Return True if the action can run for the given context."""

logger.info(f"Checking if can be opened in context: {context}")
Comment thread server/__init__.py
Comment on lines +24 to +37
async def get_dynamic_actions(
self,
project_name: Optional[str] = None,
context,
variant: str = "production",
) -> list[SimpleActionManifest]:
return [get_open_in_rv_simple_action()]
) -> list["DynamicActionManifest"]:
"""Return dynamic actions for the given context.

The Open in RV action should only be shown when it is valid for the
selected version (i.e. when can_open_in_rv(context) is True).
"""
actions = []
if await can_open_in_rv(context):
actions.append(get_open_in_rv_action())
return actions
@BigRoy
BigRoy marked this pull request as draft July 16, 2026 08:09
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open in RV web action should only show when relevant

2 participants