Buttons
Add actions in three places: the right-click menus, the topbar, and a selected item in the info panel.
Where they go
- Context menus: declare
contributions.contextMenus, or register at runtime. NeedscontextMenu.register. - Topbar:
contributions.topbarActions, which users can pin. Needstopbar.register. - Item actions:
itemActions[]puts a button on a selected item, optionally only when it matches certain media kinds or metadata. Needsview.mount.
The five contexts
A context menu contribution declares which menus it appears in: image, folder, empty, item, or create. The create context covers Atlas's creation menus such as Add and Smart Folders. Media-kind and extension filters require an image or item context.
Registering at runtime
atlas.ui registers the same actions imperatively, and each returns a function that removes it again. There are five: registerImageAction, registerFolderAction, registerEmptyAction, registerCreateAction, and registerTopbarAction. The first four need contextMenu.register; the last needs topbar.register.
Matching an item
An item action can declare a match so it shows only on relevant items, and an open block that hands the item's metadata to the window it launches. That is how CivitAI's Details button shows only on CivitAI images and passes the model id.
"itemActions": [{
"id": "model-details", "label": "Details", "placement": "preview-overlay",
"match": { "mediaKinds": ["image"], "metadataKeys": ["noct_civitai_model_id"] },
"open": { "title": "Model Details", "data": { "modelId": "noct_civitai_model_id" } }
}]