@nxxxsooo/opencode-annotate 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +100 -24
- package/bridge/native-host.mjs +1 -1
- package/browser/capture.js +23 -3
- package/browser/manifest.json +2 -2
- package/browser/panel.css +123 -3
- package/browser/panel.html +50 -17
- package/browser/panel.mjs +469 -109
- package/browser/protocol.mjs +5 -1
- package/browser/worker.mjs +156 -25
- package/package.json +3 -2
- package/review.mjs +120 -37
- package/theme.mjs +115 -0
- package/tui.ts +27 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 — one-key send and browser review rounds
|
|
4
|
+
|
|
5
|
+
### Text review
|
|
6
|
+
|
|
7
|
+
- Pass `PLANNOTATOR_TUI_SEND_INTENT` to the TUI. With the fork's `local/opencode` branch
|
|
8
|
+
(proposed upstream as plannotator/plannotator-tui#109), `q` with notes returns and sends
|
|
9
|
+
without the OpenCode confirmation; `Ctrl+S`, `E` and `S` send too, following `[keys]`,
|
|
10
|
+
and `Ctrl+S` saves an open comment first. `Ctrl+C` returns so OpenCode asks. The header
|
|
11
|
+
shows one **Send N back (q)** button; the clipboard copy and Review menu are hidden.
|
|
12
|
+
Upstream binaries are unaffected.
|
|
13
|
+
|
|
14
|
+
### Browser review rounds
|
|
15
|
+
|
|
16
|
+
- Sending closes a review round: delivered notes leave the list, page markers renumber,
|
|
17
|
+
and the panel is ready for the next round. **Restore last round** brings the latest
|
|
18
|
+
delivered notes back; the last ten rounds per page are kept.
|
|
19
|
+
- Without a live session, the primary action is **Copy N notes & continue**; a copy icon
|
|
20
|
+
beside Send offers the same when connected. Copying closes the round and supersedes a
|
|
21
|
+
failed batch; a blocked clipboard keeps the round open.
|
|
22
|
+
- Copy writes the clipboard within the click, before saving an open draft, and falls back
|
|
23
|
+
to the new `clipboardWrite` permission, so Chrome no longer refuses it on slow pages.
|
|
24
|
+
- Separate the two delivery modes: a **Live**/**Offline** marker beside the destination,
|
|
25
|
+
**Send N notes** only with a live session, **Copy N notes** otherwise. A session that
|
|
26
|
+
drops during Send keeps the notes and switches to Copy instead of showing an error.
|
|
27
|
+
- Detect a stale background worker after an update and offer **Reload Annotate**
|
|
28
|
+
instead of `Unknown annotation action`.
|
|
29
|
+
- Strip invisible format characters from page titles, such as Feishu's title watermark.
|
|
30
|
+
- Reconnect page tools automatically after a reload or same-site navigation, fixing
|
|
31
|
+
`Could not establish connection. Receiving end does not exist.` on Pick, Show on page
|
|
32
|
+
and markers. When Chrome has withdrawn access, the panel asks for one icon click.
|
|
33
|
+
|
|
34
|
+
## 0.6.0 — annotate any session text
|
|
35
|
+
|
|
36
|
+
### Text review
|
|
37
|
+
|
|
38
|
+
- Add `/annotate-pick` to choose among recent replies and mid-turn progress updates, and
|
|
39
|
+
`/annotate-selection` to review the message containing the last transcript selection.
|
|
40
|
+
- Move browser review to `/annotate-web` (pairing, URL, HTML file or `off`); `/annotate`
|
|
41
|
+
now handles replies and documents only. Retire numbered `/annotate N`.
|
|
42
|
+
|
|
43
|
+
### Inherited TUI colors
|
|
44
|
+
|
|
45
|
+
- Add opt-in `inheritTheme` support for the color-capable Plannotator fork, including
|
|
46
|
+
the OpenCode canvas, text, Markdown, borders, selection and cursor contrast pairs.
|
|
47
|
+
Inherited colors also cover strong/emphasis text, list markers, rules, link labels,
|
|
48
|
+
table headers and the send button.
|
|
49
|
+
- Validate a private per-review configuration before suspending the terminal; preserve
|
|
50
|
+
the user's layout settings, including the fork's `doc_width`, and keep the themed
|
|
51
|
+
config with recoverable drafts.
|
|
52
|
+
|
|
53
|
+
### Compact browser workspace
|
|
54
|
+
|
|
55
|
+
- Replace the always-expanded browser form with a selection-focused composer, numbered
|
|
56
|
+
note queue, and persistent destination/delivery bar; keep controls visible at narrow widths and zoom.
|
|
57
|
+
- Autosave unfinished feedback by page, recover it after navigation or panel reload, and
|
|
58
|
+
protect selection changes and competing-panel edits with explicit draft choices.
|
|
59
|
+
- Fix cancelling and reselecting the same element, add safe Show on page and revision-aware
|
|
60
|
+
deletion Undo, and keep the intended destination visible while disconnected.
|
|
61
|
+
- Show pending/sent counts, distinguish original-batch retries from new feedback, and move
|
|
62
|
+
copy/export/context utilities into More review options. **Save note** is now **Add note**.
|
|
63
|
+
|
|
3
64
|
## 0.5.0 — new package name
|
|
4
65
|
|
|
5
66
|
- Publish as `@nxxxsooo/opencode-annotate` from `nxxxsooo/opencode-annotate`. The old
|
package/README.md
CHANGED
|
@@ -17,23 +17,28 @@ Published on npm as `@nxxxsooo/opencode-annotate`. It replaces `opencode-plannot
|
|
|
17
17
|
|
|
18
18
|
```text
|
|
19
19
|
/annotate Review the last completed assistant reply
|
|
20
|
-
/annotate 2 Review the second most recent reply
|
|
21
|
-
/annotate 3 Review the third most recent reply
|
|
22
20
|
/annotate docs/plan.md Review a Markdown document
|
|
23
21
|
/annotate "docs/release plan.md" Review a path containing spaces
|
|
24
22
|
/annotate ~/Documents/notes.txt Review a plain-text document
|
|
25
|
-
/annotate
|
|
26
|
-
/annotate
|
|
27
|
-
/annotate
|
|
28
|
-
/annotate
|
|
23
|
+
/annotate-pick Choose a recent reply or mid-turn progress update
|
|
24
|
+
/annotate-selection Review the message containing your last transcript selection
|
|
25
|
+
/annotate-web Open this session for browser pairing
|
|
26
|
+
/annotate-web page.html Review the specified local HTML in Chrome
|
|
27
|
+
/annotate-web https://example.com Review the specified webpage
|
|
28
|
+
/annotate-web off Revoke this session's browser pairing
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
`/annotate-last` always reviews the latest completed reply; any supplied argument is ignored.
|
|
32
32
|
|
|
33
|
+
Progress updates written during a long tool run are not replies, so `/annotate` skips them.
|
|
34
|
+
Reach them with `/annotate-pick`, or drag over text in the transcript and run
|
|
35
|
+
`/annotate-selection`: the plugin opens the reply or progress update containing that text,
|
|
36
|
+
or just the selected text when it spans messages. Numbered `/annotate N` is retired.
|
|
37
|
+
|
|
33
38
|
## Install
|
|
34
39
|
|
|
35
40
|
Requires **OpenCode 2.0.22+** and a separately installed `plannotator-tui` on your PATH.
|
|
36
|
-
Tested with OpenCode 2.1.
|
|
41
|
+
Tested with OpenCode 2.1.2 and Plannotator TUI 0.9.4 on macOS; unit tests also run on
|
|
37
42
|
Linux. Windows terminal handoff has not been verified.
|
|
38
43
|
|
|
39
44
|
Install the upstream TUI on macOS or Linux:
|
|
@@ -64,6 +69,21 @@ Manual configuration, preserving other entries:
|
|
|
64
69
|
}
|
|
65
70
|
```
|
|
66
71
|
|
|
72
|
+
### Match OpenCode's colors (fork required)
|
|
73
|
+
|
|
74
|
+
Set `"inheritTheme": true` in the plugin's `options`, alongside `binary`. It requires
|
|
75
|
+
the extended color-capable Plannotator fork
|
|
76
|
+
([nxxxsooo/plannotator-tui](https://github.com/nxxxsooo/plannotator-tui), branch
|
|
77
|
+
`local/opencode`); upstream 0.9.4 does not support it. The same branch adds `[ui].doc_width`
|
|
78
|
+
to cap the text column on wide terminals (proposed upstream in
|
|
79
|
+
[plannotator/plannotator-tui#108](https://github.com/plannotator/plannotator-tui/pull/108)). See [TUI theme integration](docs/tui-theme.md).
|
|
80
|
+
|
|
81
|
+
Each review uses OpenCode's current resolved colors for the canvas, text, Markdown,
|
|
82
|
+
borders, highlights, cursor and selection. The plugin asks the chosen binary for its
|
|
83
|
+
effective configuration, copies it into that review's private directory, and validates
|
|
84
|
+
the themed copy before taking over the terminal. Your original settings stay intact.
|
|
85
|
+
Launchers must honor an existing `PLANNOTATOR_TUI_CONFIG`.
|
|
86
|
+
|
|
67
87
|
## Browser review (optional)
|
|
68
88
|
|
|
69
89
|
Requirements: macOS and Chrome 116+, plus Node 22+ for the native host.
|
|
@@ -75,28 +95,55 @@ Requirements: macOS and Chrome 116+, plus Node 22+ for the native host.
|
|
|
75
95
|
opens no HTTP port.
|
|
76
96
|
3. Reopen the OpenCode terminal client; the shared service needs no restart.
|
|
77
97
|
|
|
78
|
-
Run `/annotate
|
|
79
|
-
session is shown automatically; with several sessions, choose one once.
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
Run `/annotate-web` in a target session, then open the Chrome extension. A sole live
|
|
99
|
+
session is shown automatically; with several sessions, choose one once. Click the
|
|
100
|
+
destination beside **To** to change or refresh it. Its title stays visible beside Send,
|
|
101
|
+
including while disconnected, with its directory available on hover and in the chooser.
|
|
102
|
+
A sole target is only preselected: no binding or model turn occurs until
|
|
82
103
|
the user clicks **Send & continue**. A disconnected destination never silently switches to another session.
|
|
83
104
|
|
|
84
|
-
Pick
|
|
85
|
-
|
|
86
|
-
|
|
105
|
+
Choose **Pick element** or select text, then write a comment or question. The composer
|
|
106
|
+
appears for that selection. **Send N notes & continue** saves the current feedback and
|
|
107
|
+
sends pending notes in one action; **Add note** collects feedback locally for a batch.
|
|
108
|
+
Cmd/Ctrl+Enter adds a note or saves an edit. This sends pending notes to that captured
|
|
87
109
|
session and starts a normal model turn; pairing and saving notes make no model call.
|
|
88
|
-
Switching terminal tabs never changes the paired target. Revoke with `/annotate
|
|
110
|
+
Switching terminal tabs never changes the paired target. Revoke with `/annotate-web off`.
|
|
111
|
+
|
|
112
|
+
The numbered queue matches the page markers. Click a note's quoted target to show it
|
|
113
|
+
on the page without activating the element; **Edit** changes the feedback, and **Undo**
|
|
114
|
+
restores a deleted note. The delivery bar shows the round's note count and destination.
|
|
115
|
+
|
|
116
|
+
Each send closes a review round: delivered notes leave the list and the panel is ready
|
|
117
|
+
for the next round. **Restore last round** returns the most recent delivered notes to the
|
|
118
|
+
list; the last ten rounds per page are kept.
|
|
119
|
+
|
|
120
|
+
Delivery has two modes, shown beside the destination. With a **Live** session the primary
|
|
121
|
+
button is **Send N notes**, and the copy icon beside it copies the round instead. When the
|
|
122
|
+
session is **Offline**, or none is connected, the button is **Copy N notes**: it copies the
|
|
123
|
+
round as Markdown for any agent and closes it the same way. Run `/annotate-web` in a
|
|
124
|
+
session to switch back to Send. If a session drops during Send, the notes are kept and the
|
|
125
|
+
panel switches to Copy.
|
|
126
|
+
**More review options** contains a non-closing Markdown copy, JSON export, and a preview
|
|
127
|
+
of the current round.
|
|
128
|
+
|
|
129
|
+
After a page reload or same-site navigation, the panel reconnects its page tools
|
|
130
|
+
automatically. If Chrome has withdrawn access (for example after moving to another site),
|
|
131
|
+
the panel asks you to click the extension icon once; saved notes are kept.
|
|
89
132
|
|
|
90
133
|
### Explicit routing
|
|
91
134
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
135
|
+
`/annotate`, `/annotate-pick` and `/annotate-selection` always use the TUI; Markdown and
|
|
136
|
+
plain-text files do too. Only `/annotate-web` enters the browser workflow; passing a URL or
|
|
137
|
+
HTML file to `/annotate` points you there. A reply containing HTML links or code fences does
|
|
138
|
+
not change the default.
|
|
95
139
|
|
|
96
140
|
### Browser safeguards and limitations
|
|
97
141
|
|
|
98
|
-
|
|
99
|
-
|
|
142
|
+
Written drafts autosave locally and restore after panel reload or a return to the same URL,
|
|
143
|
+
including SPA routes. Selecting another target with unfinished feedback offers **Add/Save
|
|
144
|
+
& switch**, **Keep editing**, or **Discard & switch**. Storage failures keep the input and
|
|
145
|
+
offer a retry; competing panels require an explicit choice of draft. Saved-note revision
|
|
146
|
+
checks likewise prevent stale tabs overwriting newer feedback. Full JSON/Markdown exports include
|
|
100
147
|
redacted URLs, exact selected text/context, verified selector hints, styles and accessibility.
|
|
101
148
|
Missing/changed/ambiguous targets are labeled in the sidebar instead of silently rebound.
|
|
102
149
|
Comments and drafts live in extension-owned UI/storage; the page receives only selection
|
|
@@ -104,8 +151,10 @@ metadata and numbered markers, not your written feedback.
|
|
|
104
151
|
|
|
105
152
|
Native delivery requires an open, paired local TUI. If the receiver closes, feedback stays
|
|
106
153
|
pending. A failed batch retains its original target and ID for safe retry; if that target
|
|
107
|
-
is permanently gone, export the notes before starting a new review.
|
|
108
|
-
|
|
154
|
+
is permanently gone, export the notes before starting a new review. **Retry N notes &
|
|
155
|
+
continue** retries that original batch; newly composed feedback stays local for the next
|
|
156
|
+
send. Copying a round instead supersedes a failed batch.
|
|
157
|
+
Clipboard failures expose a selectable preview and keep the round open. Browser-internal pages, PDF,
|
|
109
158
|
cross-origin iframes, Canvas and remote SSH TUI clients are outside this version's scope.
|
|
110
159
|
Page Context is retired only after exporting its drafts and verifying this replacement.
|
|
111
160
|
|
|
@@ -115,6 +164,21 @@ See [implementation plan](docs/annotate-html-integration-plan.md) and
|
|
|
115
164
|
`npm run test:browser` verify each layer; the browser test uses an existing Playwright installation
|
|
116
165
|
(`PLAYWRIGHT_MODULE`) and browser executable (`CHROMIUM_PATH`) in an isolated profile.
|
|
117
166
|
|
|
167
|
+
### Reload after browser companion updates
|
|
168
|
+
|
|
169
|
+
After updating the unpacked `browser/` files, open `chrome://extensions` and click
|
|
170
|
+
**Reload** for **OpenCode Annotate**. Return to the target webpage and open Annotate
|
|
171
|
+
using its extension icon or **Alt+Shift+A**.
|
|
172
|
+
|
|
173
|
+
A newly opened sidebar can load the updated `panel.mjs` while Chrome still runs an
|
|
174
|
+
older `worker.mjs`. The panel detects this protocol mismatch and shows **Annotate was
|
|
175
|
+
updated** with a **Reload Annotate** button; reopen the panel afterwards.
|
|
176
|
+
Saved extension-local data survives an extension reload.
|
|
177
|
+
|
|
178
|
+
For diagnosis, compare the running worker's source (DevTools/CDP
|
|
179
|
+
`Debugger.getScriptSource`) with `browser/worker.mjs` in the loaded checkout.
|
|
180
|
+
The manifest version alone cannot identify edits to an unpacked extension.
|
|
181
|
+
|
|
118
182
|
## Review and send
|
|
119
183
|
|
|
120
184
|
1. Run `/annotate` or `/annotate path/to/file.md` in a session.
|
|
@@ -128,6 +192,16 @@ See [implementation plan](docs/annotate-html-integration-plan.md) and
|
|
|
128
192
|
The upstream **`E`** action copies to the clipboard. This adapter's automatic
|
|
129
193
|
delivery path is **q → confirm** and does not need clipboard access.
|
|
130
194
|
|
|
195
|
+
With the [fork](#match-opencodes-colors-fork-required) (branch `local/opencode`; proposed
|
|
196
|
+
upstream in [plannotator/plannotator-tui#109](https://github.com/plannotator/plannotator-tui/pull/109)),
|
|
197
|
+
**`q`** with notes returns and submits them without the OpenCode dialog. **`Ctrl+S`**
|
|
198
|
+
does the same mid-comment, saving the comment first, and also works while a Chinese
|
|
199
|
+
input method is active. The header's **Send N back (q)** button does the same.
|
|
200
|
+
**`Ctrl+C`** returns without sending, and OpenCode asks whether to send. `E` and `S` send as well,
|
|
201
|
+
following any `[keys]` rebinding, and the clipboard copy and Review menu (resend, finish, archive) are hidden
|
|
202
|
+
because OpenCode owns delivery. Upstream binaries ignore the handoff and keep
|
|
203
|
+
**q → confirm**.
|
|
204
|
+
|
|
131
205
|
Opening a review makes no model call. Confirming sends a normal user prompt and
|
|
132
206
|
resumes the **original session**, even if the active tab changes. Empty and
|
|
133
207
|
cancelled reviews submit nothing.
|
|
@@ -237,11 +311,13 @@ See [release instructions](docs/releasing.md) and [changelog](CHANGELOG.md).
|
|
|
237
311
|
这是**非官方 OpenCode 批注插件**:文本用 Plannotator TUI,网页用 Chrome 伴随扩展。
|
|
238
312
|
|
|
239
313
|
- `/annotate`:批注上一条完整回复。
|
|
240
|
-
- `/annotate 2`:批注倒数第二条,`3`、`4` 依次往前;`1` 等同于默认。
|
|
241
314
|
- `/annotate 文档.md`:批注文档,支持中文、空格和相对路径。
|
|
315
|
+
- `/annotate-pick`:从最近的回复和运行中的进度说明里选一条批注。
|
|
316
|
+
- `/annotate-selection`:先在会话里拖选文字,再批注包含这段文字的消息。
|
|
242
317
|
- `/annotate-last`:固定批注最新一条完整回复,忽略附带参数。
|
|
243
|
-
- `/annotate 页面.html`、`/annotate https
|
|
318
|
+
- `/annotate-web`:配对 Chrome;`/annotate-web 页面.html`、`/annotate-web https://…` 批注网页;`/annotate-web off` 撤销配对。
|
|
244
319
|
- 选中文字 → `c` 写批注 → Enter 保存 → `q` 返回 →「Send and continue」。
|
|
320
|
+
- 用 fork 时:有批注时按 `q` 直接返回并发送;写批注中途按 `Ctrl+S`,一步保存、返回并发送(中文输入法开着也有效);`Ctrl+C` 不发送,返回后由 OpenCode 询问。
|
|
245
321
|
- 文档采用独立快照,反馈附原文件路径,确认后发回发起批注的会话。
|
|
246
322
|
- 更新:`opencode plugin update @nxxxsooo/opencode-annotate@latest`,然后重新打开终端客户端。
|
|
247
323
|
|
package/bridge/native-host.mjs
CHANGED
|
@@ -21,7 +21,7 @@ decodeStream(process.stdin, async message => {
|
|
|
21
21
|
response = { ok: true, targets: live.filter(Boolean) }
|
|
22
22
|
} else {
|
|
23
23
|
const target = targets.find(target => target.id === message.targetID)
|
|
24
|
-
if (!target) throw new Error("Paired session is offline; run /annotate
|
|
24
|
+
if (!target) throw new Error("Paired session is offline; run /annotate-web in it to reconnect")
|
|
25
25
|
response = await request(target.socket, message)
|
|
26
26
|
}
|
|
27
27
|
} catch (error) { response = { ok: false, error: error.message } }
|
package/browser/capture.js
CHANGED
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
host.style.cssText = "all:initial!important;position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483647!important"
|
|
10
10
|
const root = host.attachShadow({ mode: "closed" })
|
|
11
11
|
const style = document.createElement("style")
|
|
12
|
-
style.textContent = '.box{position:fixed;pointer-events:none;border:2px solid #c96442;background:#c9644210}.pin{position:fixed;background:#c96442;color:#fff;border:2px solid #fff;border-radius:50%;font:600 12px system-ui;width:26px;height:26px;pointer-events:none}'
|
|
12
|
+
style.textContent = '.box{position:fixed;pointer-events:none;border:2px solid #c96442;background:#c9644210}.pin{position:fixed;display:grid;place-items:center;background:#c96442;color:#fff;border:2px solid #fff;border-radius:50%;font:600 12px/1 system-ui;width:26px;height:26px;pointer-events:none}'
|
|
13
13
|
root.append(style); document.documentElement.append(host)
|
|
14
14
|
const box = document.createElement("div"); box.className = "box"
|
|
15
|
+
const highlight = document.createElement("div"); highlight.className = "box"
|
|
16
|
+
let highlighted, highlightTimer
|
|
15
17
|
let picking = false, url = location.href, timer, markers = [], active = true
|
|
16
18
|
function send(anchor = null, error = null, modeOnly = false) {
|
|
17
19
|
if (!active) return
|
|
@@ -53,6 +55,20 @@
|
|
|
53
55
|
if (message.action === "pick") { setPicking(!picking); respond({ ok: true, picking }) }
|
|
54
56
|
if (message.action === "markers") { markers = message.notes || []; draw(); respond({ ok: true }) }
|
|
55
57
|
if (message.action === "locate") respond({ states: message.anchors.map(locate) })
|
|
58
|
+
if (message.action === "reveal") {
|
|
59
|
+
const state = locate(message.anchor)
|
|
60
|
+
if (state !== "located") {
|
|
61
|
+
respond({ ok: false, error: `This element is ${state}. Your feedback is kept.` })
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
setPicking(false)
|
|
65
|
+
highlighted = document.querySelector(message.anchor.selector)
|
|
66
|
+
highlighted.scrollIntoView({ block: "center", inline: "nearest", behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth" })
|
|
67
|
+
root.append(highlight); draw()
|
|
68
|
+
clearTimeout(highlightTimer)
|
|
69
|
+
highlightTimer = setTimeout(() => { highlighted = null; highlight.remove() }, 1600)
|
|
70
|
+
respond({ ok: true })
|
|
71
|
+
}
|
|
56
72
|
}
|
|
57
73
|
chrome.runtime.onMessage.addListener(onMessage)
|
|
58
74
|
function locate(anchor) {
|
|
@@ -68,6 +84,10 @@
|
|
|
68
84
|
} catch { return "invalid selector" }
|
|
69
85
|
}
|
|
70
86
|
function draw() {
|
|
87
|
+
if (highlighted?.isConnected) {
|
|
88
|
+
const rect = highlighted.getBoundingClientRect()
|
|
89
|
+
highlight.style.cssText = `left:${rect.left}px;top:${rect.top}px;width:${rect.width}px;height:${rect.height}px`
|
|
90
|
+
} else highlight.remove()
|
|
71
91
|
root.querySelectorAll(".pin").forEach(node => node.remove())
|
|
72
92
|
for (const [index, note] of markers.entries()) {
|
|
73
93
|
let matches
|
|
@@ -81,13 +101,13 @@
|
|
|
81
101
|
pin.style.cssText = `left:${rect.left - 10}px;top:${rect.top - 10}px`; root.append(pin)
|
|
82
102
|
}
|
|
83
103
|
}
|
|
84
|
-
on(
|
|
104
|
+
on(document, "scroll", draw, { capture: true, passive: true }); on(window, "resize", draw)
|
|
85
105
|
const observer = new MutationObserver(() => { clearTimeout(timer); timer = setTimeout(draw, 160) })
|
|
86
106
|
observer.observe(document.body, { childList: true, subtree: true, characterData: true })
|
|
87
107
|
const routeTimer = setInterval(() => { if (!active) { observer.disconnect(); return } if (url !== location.href) { url = location.href; markers = []; draw(); send() } }, 700)
|
|
88
108
|
function dispose() {
|
|
89
109
|
if (!active) return
|
|
90
|
-
active = false; listeners.abort(); clearInterval(routeTimer); clearTimeout(timer); observer.disconnect(); host.remove()
|
|
110
|
+
active = false; listeners.abort(); clearInterval(routeTimer); clearTimeout(timer); clearTimeout(highlightTimer); observer.disconnect(); host.remove()
|
|
91
111
|
try { chrome.runtime.onMessage.removeListener(onMessage) } catch { /* previous extension context may already be invalidated */ }
|
|
92
112
|
delete globalThis.__opencodeAnnotate
|
|
93
113
|
}
|
package/browser/manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "OpenCode Annotate",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"description": "Annotate HTML-based page feedback, private drafts, and paired OpenCode delivery.",
|
|
6
6
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp7TG2yzekNKpQvHBtj4jqkOxtoeDIBhNIjPi37Os/ksuhzPp1pHnrJPV4WV2ToatUaD5x5/SpLP8qZKLBD+wuraEE/TeclEZ8HvEs1yhlnx/S7piTG/s0eV5umuTEx2w66Hi0w3dhTC7ZZfJXCLyqs1feBtWzQx6ClgaHNYly4iJ03pV7RfguqpIaG9LV8Oa8ELA+7Ubr0BAujXrSlvqLF5oAKGoXXcpvTL5rgMRIH4Q/85tnvrk0pRVg+1z9IGNzSfjN82iveC/JAriyWABp8YuswtvKfI2Wb+KspaisBh39Y3BRqlyo8I2Cr+01uE6G5pWiJIWMLhe0glrMr5I2wIDAQAB",
|
|
7
|
-
"permissions": ["activeTab", "scripting", "storage", "sidePanel", "nativeMessaging"],
|
|
7
|
+
"permissions": ["activeTab", "scripting", "storage", "sidePanel", "nativeMessaging", "clipboardWrite"],
|
|
8
8
|
"action": { "default_title": "Annotate this page", "default_icon": "icons/icon-32.png" },
|
|
9
9
|
"background": { "service_worker": "worker.mjs", "type": "module" },
|
|
10
10
|
"side_panel": { "default_path": "panel.html" },
|
package/browser/panel.css
CHANGED
|
@@ -1,3 +1,123 @@
|
|
|
1
|
-
:root{
|
|
2
|
-
|
|
3
|
-
:
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light dark;
|
|
3
|
+
--bg: light-dark(#faf9f5, #20201f);
|
|
4
|
+
--surface: light-dark(#fff, #292927);
|
|
5
|
+
--soft: light-dark(#f0eee8, #33322f);
|
|
6
|
+
--text: light-dark(#27251f, #f2eee5);
|
|
7
|
+
--muted: light-dark(#686257, #c2bbae);
|
|
8
|
+
--line: light-dark(#ddd8ce, #49463f);
|
|
9
|
+
--input: light-dark(#8c8475, #928a7e);
|
|
10
|
+
--accent: light-dark(#944525, #f2ad90);
|
|
11
|
+
--on-accent: light-dark(#fff, #29201b);
|
|
12
|
+
--success: light-dark(#3c6548, #a5c6ab);
|
|
13
|
+
--warning: light-dark(#865122, #e9bb7e);
|
|
14
|
+
--error: light-dark(#a12929, #ffb3ac);
|
|
15
|
+
}
|
|
16
|
+
* { box-sizing: border-box; }
|
|
17
|
+
[hidden] { display: none !important; }
|
|
18
|
+
body { height: 100dvh; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, sans-serif; }
|
|
19
|
+
p, h1, h2 { margin: 0; }
|
|
20
|
+
button, select, textarea { font: inherit; color: var(--text); }
|
|
21
|
+
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--input); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 550; }
|
|
22
|
+
button:hover { border-color: var(--accent); }
|
|
23
|
+
button:disabled { color: var(--muted); opacity: .6; cursor: default; }
|
|
24
|
+
button:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
25
|
+
::selection { background: var(--accent); color: var(--on-accent); }
|
|
26
|
+
textarea { caret-color: var(--accent); }
|
|
27
|
+
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
|
|
28
|
+
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
|
|
29
|
+
.panel-header { padding: 12px 16px 13px; border-bottom: 1px solid var(--line); }
|
|
30
|
+
.identity-row { display: flex; align-items: center; gap: 8px; }
|
|
31
|
+
.identity-row h1 { flex: 1; font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
|
|
32
|
+
.identity-row > .icon { width: 19px; height: 19px; color: var(--accent); }
|
|
33
|
+
.icon-button { width: 32px; height: 32px; min-height: 32px; padding: 0; flex: none; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); }
|
|
34
|
+
.icon-button:hover { background: var(--soft); color: var(--text); border-color: transparent; }
|
|
35
|
+
.page-context { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin-top: 9px; font-size: 13px; }
|
|
36
|
+
#page-title { min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
|
|
37
|
+
#page-url { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
38
|
+
main { min-height: 0; min-width: 0; overflow: auto; padding: 14px 16px 20px; scrollbar-width: thin; scrollbar-color: var(--input) transparent; scroll-padding: 16px; }
|
|
39
|
+
.picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
|
|
40
|
+
#pick { flex: none; }
|
|
41
|
+
#pick-hint { font-size: 13px; color: var(--muted); }
|
|
42
|
+
#pick[aria-pressed="true"] { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
|
|
43
|
+
.composer { margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
|
|
44
|
+
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
|
|
45
|
+
.section-heading h2 { font-size: 14px; font-weight: 650; }
|
|
46
|
+
.section-heading > span { font-size: 13px; color: var(--muted); }
|
|
47
|
+
.selected-quote { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
|
|
48
|
+
.selected-quote .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
|
|
49
|
+
#quote { max-height: 80px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; }
|
|
50
|
+
.kind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 11px; }
|
|
51
|
+
.kind-row button { min-height: 32px; padding: 4px 9px; gap: 5px; background: transparent; border-color: transparent; border-radius: 5px; color: var(--muted); font-weight: 400; }
|
|
52
|
+
.kind-row button[aria-checked="true"] { background: var(--surface); border-color: var(--input); color: var(--text); }
|
|
53
|
+
.kind-row .icon { width: 15px; height: 15px; }
|
|
54
|
+
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
|
|
55
|
+
textarea, select { width: 100%; display: block; border: 1px solid var(--input); border-radius: 6px; background: var(--surface); padding: 10px; }
|
|
56
|
+
textarea { min-height: 96px; resize: vertical; line-height: 1.5; font-size: 14px; }
|
|
57
|
+
textarea::placeholder { color: var(--muted); opacity: 1; }
|
|
58
|
+
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
|
|
59
|
+
kbd { font: 12px/1.3 system-ui; color: var(--muted); }
|
|
60
|
+
.text-button { min-height: 32px; padding: 4px 3px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
|
|
61
|
+
.text-button:hover { color: var(--text); text-decoration-color: currentColor; }
|
|
62
|
+
.soft { background: transparent; border-color: var(--line); }
|
|
63
|
+
.switch-notice, .draft-error { margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
|
|
64
|
+
.switch-notice strong { display: block; margin-bottom: 4px; color: var(--warning); }
|
|
65
|
+
.switch-notice p, .draft-error p { margin-bottom: 8px; color: var(--muted); }
|
|
66
|
+
.switch-actions { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
67
|
+
.notes-section { margin-top: 22px; }
|
|
68
|
+
ol { list-style: none; margin: 0; padding: 0; }
|
|
69
|
+
.note { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; border-top: 1px solid var(--line); padding: 15px 0 14px; }
|
|
70
|
+
.note:first-child { border-top: 0; padding-top: 5px; }
|
|
71
|
+
.note-number { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; border: 1px solid var(--input); border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
|
|
72
|
+
.note.is-current .note-number { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
|
|
73
|
+
.note-target { display: flex; align-items: flex-start; gap: 6px; width: 100%; min-height: 28px; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; line-height: 1.5; font-weight: 400; text-align: left; }
|
|
74
|
+
.note-target span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
75
|
+
.note-target .icon { width: 14px; height: 14px; margin-top: 3px; }
|
|
76
|
+
.note-target:hover { color: var(--accent); }
|
|
77
|
+
.note-comment { margin: 4px 0 7px; overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
78
|
+
.note-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
79
|
+
.note-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 90px; font-size: 13px; color: var(--muted); }
|
|
80
|
+
.note-bottom .text-button { padding-right: 6px; }
|
|
81
|
+
.warning { margin: 7px 0; font-size: 13px; color: var(--warning); }
|
|
82
|
+
.error, .draft-error .error { color: var(--error); overflow-wrap: anywhere; }
|
|
83
|
+
#page-error { margin-bottom: 12px; font-size: 13px; }
|
|
84
|
+
.empty-state { margin-top: 28px; }
|
|
85
|
+
.empty-state h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin-bottom: 9px; }
|
|
86
|
+
.empty-state p { color: var(--muted); max-width: 28ch; }
|
|
87
|
+
.empty-state .empty-footnote { margin-top: 24px; font-size: 13px; }
|
|
88
|
+
.inline-notice { display: flex; align-items: center; gap: 8px; padding: 10px 0; margin-top: 12px; font-size: 13px; color: var(--muted); }
|
|
89
|
+
.inline-notice span { flex: 1; }
|
|
90
|
+
.delivery { min-width: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--bg); }
|
|
91
|
+
.destination { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; min-width: 0; }
|
|
92
|
+
.destination > .icon { width: 16px; height: 16px; color: var(--muted); }
|
|
93
|
+
.destination-label { color: var(--muted); font-size: 13px; }
|
|
94
|
+
.destination-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; min-width: 0; flex: 1; min-height: 28px; padding: 3px 0; border: 0; background: transparent; font-size: 13px; font-weight: 400; text-align: left; }
|
|
95
|
+
#paired { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
96
|
+
.destination-button .icon { width: 14px; height: 14px; color: var(--muted); }
|
|
97
|
+
.send-row { display: flex; gap: 6px; }
|
|
98
|
+
#send { flex: 1; min-width: 0; min-height: 39px; font-size: 14px; font-weight: 600; }
|
|
99
|
+
#copy-round { width: 39px; height: 39px; min-height: 39px; border-color: var(--line); }
|
|
100
|
+
.empty-state #restore-round { margin-top: 10px; }
|
|
101
|
+
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
|
|
102
|
+
.primary:disabled { opacity: 1; background: var(--soft); border-color: var(--line); color: var(--muted); }
|
|
103
|
+
#status { margin-top: 7px; min-height: 19px; font-size: 13px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
|
|
104
|
+
.link-state { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
|
|
105
|
+
.link-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
|
|
106
|
+
.link-state:empty { display: none; }
|
|
107
|
+
.link-state.live { color: var(--success); }
|
|
108
|
+
.link-state.offline { color: var(--warning); }
|
|
109
|
+
.update-notice { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
|
|
110
|
+
.update-notice p { margin: 4px 0 10px; color: var(--muted); }
|
|
111
|
+
#status.error { color: var(--error); }
|
|
112
|
+
#status.warning { color: var(--warning); }
|
|
113
|
+
#status.success { color: var(--success); }
|
|
114
|
+
.session-chooser, .utilities { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
|
|
115
|
+
.session-chooser select { padding: 8px; font-size: 13px; }
|
|
116
|
+
.hint { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
|
|
117
|
+
#connection-hint { margin-top: 7px; }
|
|
118
|
+
#refresh-targets { margin-top: 8px; }
|
|
119
|
+
.utility-row { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
120
|
+
details { margin-top: 10px; }
|
|
121
|
+
summary { min-height: 30px; padding: 4px 0; cursor: pointer; color: var(--muted); font-size: 13px; }
|
|
122
|
+
pre { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font: 12px/1.5 ui-monospace, monospace; }
|
|
123
|
+
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
|
package/browser/panel.html
CHANGED
|
@@ -1,23 +1,56 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenCode Annotate</title><link rel="stylesheet" href="panel.css"></head>
|
|
3
4
|
<body>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
<svg class="icon-definitions" aria-hidden="true"><defs>
|
|
6
|
+
<symbol id="icon-annotate" viewBox="0 0 24 24"><path d="M4 4h16v12H9l-5 4V4Z"/><path d="m9 12 6-6 3 3-6 6H9v-3Z"/></symbol>
|
|
7
|
+
<symbol id="icon-pick" viewBox="0 0 24 24"><path d="M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5M9 9l3 10 2-5 5-2-10-3Z"/></symbol>
|
|
8
|
+
<symbol id="icon-more" viewBox="0 0 24 24"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></symbol>
|
|
9
|
+
<symbol id="icon-chevron" viewBox="0 0 24 24"><path d="m7 10 5 5 5-5"/></symbol>
|
|
10
|
+
<symbol id="icon-comment" viewBox="0 0 24 24"><path d="M4 4h16v12H9l-5 4V4Z"/></symbol>
|
|
11
|
+
<symbol id="icon-question" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M9.5 8a2.7 2.7 0 0 1 5 .7c0 2-2.5 2.2-2.5 4.3m0 3v.1"/></symbol>
|
|
12
|
+
<symbol id="icon-arrow" viewBox="0 0 24 24"><path d="M5 12h14m-6-6 6 6-6 6"/></symbol>
|
|
13
|
+
<symbol id="icon-reveal" viewBox="0 0 24 24"><path d="M13 5h6v6m0-6L9 15M9 5H5v14h14v-4"/></symbol>
|
|
14
|
+
<symbol id="icon-trash" viewBox="0 0 24 24"><path d="M4 6h16M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7"/></symbol>
|
|
15
|
+
<symbol id="icon-session" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3m6 0h4"/></symbol>
|
|
16
|
+
<symbol id="icon-copy" viewBox="0 0 24 24"><rect x="8" y="8" width="12" height="13" rx="2"/><path d="M16 8V3H3v13h5"/></symbol>
|
|
17
|
+
<symbol id="icon-download" viewBox="0 0 24 24"><path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/></symbol>
|
|
18
|
+
</defs></svg>
|
|
19
|
+
<header class="panel-header">
|
|
20
|
+
<div class="identity-row"><svg class="icon" aria-hidden="true"><use href="#icon-annotate"/></svg><h1>Annotate</h1><button id="more" class="icon-button" aria-label="More review options" title="More review options" aria-expanded="false" aria-controls="utilities"><svg class="icon" aria-hidden="true"><use href="#icon-more"/></svg></button></div>
|
|
21
|
+
<div class="page-context"><strong id="page-title">Open a page</strong><span id="page-url"></span></div>
|
|
22
|
+
</header>
|
|
23
|
+
<main id="panel-body">
|
|
24
|
+
<section id="utilities" class="utilities" aria-label="Review utilities" hidden>
|
|
25
|
+
<div class="utility-row"><button id="copy"><svg class="icon" aria-hidden="true"><use href="#icon-copy"/></svg>Copy Markdown</button><button id="export"><svg class="icon" aria-hidden="true"><use href="#icon-download"/></svg>Export JSON</button></div>
|
|
26
|
+
<details id="context-details"><summary>Review context · current round</summary><pre id="preview"></pre></details>
|
|
10
27
|
</section>
|
|
11
|
-
<section
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<label for="kind">Feedback type</label><select id="kind"><option value="comment">Comment</option><option value="ask">Question</option></select>
|
|
15
|
-
<label for="comment">My feedback</label><textarea id="comment" rows="4" maxlength="8000" placeholder="What should change, or what would you like to understand?"></textarea>
|
|
16
|
-
<div class="actions"><button id="save">Save note</button><button id="cancel">Cancel edit</button></div>
|
|
28
|
+
<section id="session-options" class="session-chooser" aria-label="Destination selection" hidden>
|
|
29
|
+
<label for="targets">Choose session</label><select id="targets"><option value="">Choose a session…</option></select>
|
|
30
|
+
<p id="connection-hint" class="hint" aria-live="polite"></p><button id="refresh-targets">Refresh sessions</button>
|
|
17
31
|
</section>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
32
|
+
<div id="update-notice" class="update-notice" role="status" hidden><strong>Annotate was updated</strong><p>Reload once to finish. Notes and drafts are kept; reopen the panel with the icon or Alt+Shift+A afterwards.</p><button id="reload-extension" class="primary">Reload Annotate</button></div>
|
|
33
|
+
<p id="page-error" class="error" role="alert" hidden></p>
|
|
34
|
+
<div class="picker-row"><button id="pick" aria-pressed="false"><svg class="icon" aria-hidden="true"><use href="#icon-pick"/></svg><span id="pick-label">Pick element</span></button><span id="pick-hint">or select text</span></div>
|
|
35
|
+
<section id="composer" class="composer" aria-label="Current annotation" hidden>
|
|
36
|
+
<div class="section-heading"><h2 id="composer-title">New note</h2><span id="draft-state" aria-live="polite"></span></div>
|
|
37
|
+
<blockquote class="selected-quote"><svg class="icon" aria-hidden="true"><use href="#icon-pick"/></svg><p id="quote"></p></blockquote>
|
|
38
|
+
<p id="anchor-warning" class="warning" hidden></p>
|
|
39
|
+
<div id="switch-notice" class="switch-notice" aria-live="polite" hidden><strong>Keep feedback with this selection</strong><p id="switch-description"></p><div class="switch-actions"><button id="save-switch">Add & switch</button><button id="keep-editing" class="soft">Keep editing</button><button id="discard-switch" class="text-button">Discard & switch</button></div></div>
|
|
40
|
+
<div id="kind" class="kind-row" role="radiogroup" aria-label="Feedback type"><button id="kind-comment" role="radio" aria-checked="true" tabindex="0" data-kind="comment"><svg class="icon" aria-hidden="true"><use href="#icon-comment"/></svg>Comment</button><button id="kind-ask" role="radio" aria-checked="false" tabindex="-1" data-kind="ask"><svg class="icon" aria-hidden="true"><use href="#icon-question"/></svg>Question</button></div>
|
|
41
|
+
<label for="comment">Your feedback</label><textarea id="comment" rows="4" maxlength="8000" placeholder="What should change, or what would you like to know?"></textarea>
|
|
42
|
+
<div id="draft-error" class="draft-error" hidden><p id="draft-error-text" class="error" role="alert"></p><div class="switch-actions"><button id="retry-draft">Retry saving draft</button><button id="reload-draft">Load saved draft</button><button id="keep-draft">Keep my draft</button><button id="copy-draft" class="text-button">Copy my draft</button></div></div>
|
|
43
|
+
<div class="composer-actions"><button id="save" aria-keyshortcuts="Control+Enter Meta+Enter"><span id="save-label">Add note</span><kbd id="save-shortcut" title="Command or Control + Enter" aria-hidden="true">⌘↵</kbd></button><button id="cancel" class="text-button">Discard draft</button></div>
|
|
44
|
+
</section>
|
|
45
|
+
<div id="undo-notice" class="inline-notice" aria-live="polite" hidden><span>Note removed.</span><button id="undo" class="text-button">Undo</button></div>
|
|
46
|
+
<section id="notes-section" class="notes-section" aria-label="Collected notes" hidden><div class="section-heading"><h2>Notes</h2><span id="count">0 notes</span></div><ol id="notes"></ol></section>
|
|
47
|
+
<section id="empty-state" class="empty-state"><h2 id="empty-title">Start with what you see.</h2><p>Pick an element or highlight text on the page, then describe what needs attention.</p><p id="empty-footnote" class="empty-footnote">Send one note straight away, or collect a few first. Your feedback stays local until you send.</p><button id="restore-round" class="text-button" hidden>Restore last round</button></section>
|
|
20
48
|
</main>
|
|
21
|
-
<footer
|
|
49
|
+
<footer class="delivery">
|
|
50
|
+
<div class="destination"><svg class="icon" aria-hidden="true"><use href="#icon-session"/></svg><span class="destination-label">To</span><button id="change-target" class="destination-button" aria-label="Change destination session" aria-expanded="false" aria-controls="session-options"><span id="paired">Looking for your session…</span><svg class="icon" aria-hidden="true"><use href="#icon-chevron"/></svg></button><span id="link-state" class="link-state"></span></div>
|
|
51
|
+
<div class="send-row"><button id="send" class="primary" aria-describedby="paired status"><svg id="send-copy" class="icon" aria-hidden="true" hidden><use href="#icon-copy"/></svg><span id="send-label">Send & continue</span><svg id="send-arrow" class="icon" aria-hidden="true" hidden><use href="#icon-arrow"/></svg></button><button id="copy-round" class="icon-button" aria-label="Copy notes instead and start the next round" title="Copy instead · paste into any agent" hidden><svg class="icon" aria-hidden="true"><use href="#icon-copy"/></svg></button></div>
|
|
52
|
+
<p id="status" role="status" aria-live="polite">Looking for your OpenCode session…</p>
|
|
53
|
+
</footer>
|
|
22
54
|
<script type="module" src="panel.mjs"></script>
|
|
23
|
-
</body
|
|
55
|
+
</body>
|
|
56
|
+
</html>
|