Reference example proposal: desktop plugin (context-menu interception + composer middleware)

Đang mở
#18 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
desktop

Hướng nghiên cứu

Start with the proposed quote-comment-desktop/ directory and the desktop/plugin.js disk-plugin entry point, then compare the linked hermes-quote-comment source and gist. Check the contributing notes and developer-guide coverage before choosing the example shape. Done means an accepted, self-contained reference example demonstrating context-menu interception, fixed UI mounting, and COMPOSER_AREAS.middleware.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Proposal: a desktop-side reference example (context menu + composer middleware)

The current index covers agent-side (ctx.llm.*) and dashboard plugins, but nothing here shows a desktop/plugin.js end to end — while the desktop SDK docs send plugin authors to this repo for reference demos. Three seams this example would cover are currently discoverable only from the app source, and two of them bit us in practice:

  1. Context-menu interception. The app's own menu system listens on window capture and calls stopPropagation() on every right-click, so document-level listeners never run (window-capture listeners still do — stopPropagation does not affect same-target listeners). To keep the app's menu from flashing underneath, the example stamps message roots with data-hermes-context-menu-trigger during the right-button mousedown; on Windows contextmenu fires after mouseup, so the stamps cannot be cleared there.
  2. Floating UI without react-dom. Disk plugins cannot import react-dom, so menus/dialogs render as position: fixed nodes from a STATUSBAR_AREAS.right contribution — the only always-mounted, non-closable mount point.
  3. COMPOSER_AREAS.middleware. A queue drained on send: handler(draft) => { ...draft, text }, null to cancel, throw = pass-through.

The example is a slimmed version of a working community plugin — pwwang/hermes-quote-comment (MIT): select text in a response → right-click → Comment → the quote + comment is appended to your next message.

Per the contributing notes ("open an issue first if the surface you want to demonstrate isn't already covered in the developer-guide docs"): the context-menu interception + trigger-attribute behavior is exactly such a surface. Happy to wait if you would rather land a docs page for it first, or to restructure the example to your preferred shape — it is slightly over the ~200 LOC note, with ~80 lines being the window-capture/attribute machinery.

Would a PR for quote-comment-desktop/ be welcome?

Ngôn ngữ chính
Python
Star
49
Fork
34
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.