Skip to content

feat(plugins): add service context menus and free-form canvases - #4038

Open
blackbartblues wants to merge 2 commits into
noctalia-dev:mainfrom
blackbartblues:agent/plugin-freeform-canvas-review
Open

feat(plugins): add service context menus and free-form canvases#4038
blackbartblues wants to merge 2 commits into
noctalia-dev:mainfrom
blackbartblues:agent/plugin-freeform-canvas-review

Conversation

@blackbartblues

Copy link
Copy Markdown
Contributor

Summary

  • expose native transient context menus to singleton plugin services through service.openContextMenu(request)
  • anchor service menus at the cursor through compositor-independent Wayland layer-shell and xdg-shell surfaces
  • add free-form declarative panel primitives: absolute positioning, x/y, zIndex, clipChildren, and input onPress
  • extend drag-and-drop callbacks to onDrop(payload, target, x, y), returning the clamped target-local preview position
  • add the API-gated decorated = false panel manifest option for plugin-owned fullscreen canvases
  • release the combined capability bundle as Plugin API 29

Motivation

Plugins can already build regular context menus from direct panel pointer callbacks, but a singleton service invoked through IPC cannot currently open the same native menu at the cursor. This prevents keyboard-driven selection workflows such as selecting text, invoking a shortcut, and choosing a plugin action without opening a full panel.

Card-based plugins also need a real free-form canvas. Existing declarative drag and drop reports only the source payload and target ID, so a dropped card cannot persist its visual position. Absolute layout and target-local drop coordinates make sticky notes, dashboards, diagram nodes, spatial organizers, and similar plugin surfaces possible without plugin-specific core code.

The service popup path is compositor-independent. It does not query global cursor coordinates or call compositor IPC.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

Follow-up to #3899 and the panel context-menu implementation in #3906.

Testing

  • just format
  • full debug build
  • meson test -C build-freeform --print-errorlogs — 90/90 passed
  • targeted coverage for plugin bindings, lifecycle, manifest parsing, UI reconciliation, drag/drop coordinates, and context-menu popup behavior
  • noctalia plugins lint against the Clipper consumer — 0 errors, 0 warnings
  • live Hyprland test with the service menu at the cursor, outside-click dismissal, and a fullscreen free-form Clipper panel

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

The popup implementation itself uses generic Wayland protocols; compositor-specific coverage remains useful before marking the PR ready.

Screenshots / Videos

Live screenshots for the cursor menu and free-form Clipper canvas are available and will be attached before the draft is marked ready.

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

API 29 intentionally groups the service-menu and free-form-canvas contracts into one cumulative plugin API level. Existing Plugin API 28 panel context menus remain unchanged.

The documentation update belongs to the separate noctalia-docs repository. Its follow-up needs to cover the API ledger, service.openContextMenu, absolute positioning, four-argument drop callbacks, input onPress, and the decorated panel manifest key.

@blackbartblues
blackbartblues marked this pull request as ready for review August 20, 2026 21:47
@blackbartblues

Copy link
Copy Markdown
Contributor Author
2026-08-20_23-42-54-github.mp4

@blackbartblues

Copy link
Copy Markdown
Contributor Author

@ItsLemmy Could you review it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant