[UI] Context details for plugin actions (#13172)

* [UI] Context details for plugin actions

Adds additional target instance context when registering custom UI actions

* Add CHANGELOG entry

* Improve test
This commit is contained in:
Oliver authored and GitHub committed 2026-11-03 17:22:26 +11:00
1 parent 461186bee9
commit 62d363a99d
26 files changed
+81 -13

No files matched your search

+8
View File
@@ -187,6 +187,14 @@ The `get_ui_template_previews` feature type can be used to provide custom templa
The `get_ui_primary_actions` method can be used to provide custom primary action, which are rendered in the header of the page, next to the title/name and any status indicators. These primary actions are typically used to provide quick access to common actions related to the current page.
The `context` dictionary provided to this method contains the following keys:
| Key | Description |
| --- | --- |
| `location` | The URL path of the current page |
| `target_model` | The model type of the current page (e.g. `part`), or the page key for index pages (e.g. `purchasing`). Not provided for all pages. |
| `target_id` | The primary key of the instance displayed on the current page. Not provided for all pages. |
::: plugin.base.ui.mixins.UserInterfaceMixin.get_ui_primary_actions
options:
show_bases: False