liteagents 2.5.2 → 2.6.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +76 -15
  2. package/README.md +58 -30
  3. package/docs/INSTALLATION_DEMO.md +1 -1
  4. package/docs/INSTALLATION_LOCATIONS.md +5 -5
  5. package/docs/INSTALLER_GUIDE.md +5 -5
  6. package/docs/KNOWLEDGE_BASE.md +5 -5
  7. package/docs/MIGRATION.md +1 -1
  8. package/docs/PASS_QUICK_START.md +1 -1
  9. package/docs/PRIVACY.md +1 -1
  10. package/docs/PUBLISHING.md +7 -7
  11. package/docs/RELEASE_NOTES_1.2.0.md +2 -2
  12. package/docs/SILENT_MODE_GUIDE.md +1 -1
  13. package/installer/cli.js +1 -1
  14. package/installer/installation-engine.js +82 -21
  15. package/installer/package-manager.js +34 -3
  16. package/package.json +7 -6
  17. package/packages/ampcode/AGENT.md +1 -0
  18. package/packages/ampcode/commands/friction/friction.js +19 -4
  19. package/packages/ampcode/commands/live-canvas/DESIGN_PRINCIPLES.md +2140 -0
  20. package/packages/ampcode/commands/live-canvas/README.md +273 -0
  21. package/packages/ampcode/commands/live-canvas/templates/.claude/settings.local.json +8 -0
  22. package/packages/ampcode/commands/live-canvas/templates/demo/post-variants.html +205 -0
  23. package/packages/ampcode/commands/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +1299 -0
  24. package/packages/ampcode/commands/live-canvas/templates/feedback-react/format-utils.ts +283 -0
  25. package/packages/ampcode/commands/live-canvas/templates/feedback-react/index.ts +62 -0
  26. package/packages/ampcode/commands/live-canvas/templates/feedback-react/selector-utils.ts +423 -0
  27. package/packages/ampcode/commands/live-canvas/templates/feedback-react/types.ts +118 -0
  28. package/packages/ampcode/commands/live-canvas/templates/overlay-vanilla.js +477 -0
  29. package/packages/ampcode/commands/live-canvas.md +1104 -0
  30. package/packages/claude/CLAUDE.md +1 -0
  31. package/packages/claude/commands/friction/friction.js +19 -4
  32. package/packages/claude/plugins/live-canvas-marketplace/.claude-plugin/marketplace.json +14 -0
  33. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/.claude-plugin/plugin.json +18 -0
  34. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +89 -0
  35. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/package-lock.json +1142 -0
  36. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/package.json +17 -0
  37. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/schema.json +37 -0
  38. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/server.js +179 -0
  39. package/packages/claude/plugins/live-canvas-marketplace/setup.sh +61 -0
  40. package/packages/claude/skills/live-canvas/DESIGN_PRINCIPLES.md +2140 -0
  41. package/packages/claude/skills/live-canvas/INTEGRATION_NOTES.md +210 -0
  42. package/packages/claude/skills/live-canvas/README.md +273 -0
  43. package/packages/claude/skills/live-canvas/SKILL.md +1119 -0
  44. package/packages/claude/skills/live-canvas/templates/.claude/settings.local.json +8 -0
  45. package/packages/claude/skills/live-canvas/templates/demo/post-variants.html +205 -0
  46. package/packages/claude/skills/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +1299 -0
  47. package/packages/claude/skills/live-canvas/templates/feedback-react/format-utils.ts +283 -0
  48. package/packages/claude/skills/live-canvas/templates/feedback-react/index.ts +62 -0
  49. package/packages/claude/skills/live-canvas/templates/feedback-react/selector-utils.ts +423 -0
  50. package/packages/claude/skills/live-canvas/templates/feedback-react/types.ts +118 -0
  51. package/packages/claude/skills/live-canvas/templates/overlay-vanilla.js +477 -0
  52. package/packages/claude/variants.json +2 -1
  53. package/packages/droid/AGENTS.md +1 -0
  54. package/packages/droid/commands/friction/friction.js +19 -4
  55. package/packages/droid/commands/live-canvas/DESIGN_PRINCIPLES.md +2140 -0
  56. package/packages/droid/commands/live-canvas/README.md +273 -0
  57. package/packages/droid/commands/live-canvas/templates/.claude/settings.local.json +8 -0
  58. package/packages/droid/commands/live-canvas/templates/demo/post-variants.html +205 -0
  59. package/packages/droid/commands/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +1299 -0
  60. package/packages/droid/commands/live-canvas/templates/feedback-react/format-utils.ts +283 -0
  61. package/packages/droid/commands/live-canvas/templates/feedback-react/index.ts +62 -0
  62. package/packages/droid/commands/live-canvas/templates/feedback-react/selector-utils.ts +423 -0
  63. package/packages/droid/commands/live-canvas/templates/feedback-react/types.ts +118 -0
  64. package/packages/droid/commands/live-canvas/templates/overlay-vanilla.js +477 -0
  65. package/packages/droid/commands/live-canvas.md +1104 -0
  66. package/packages/opencode/AGENTS.md +1 -0
  67. package/packages/opencode/command/friction/friction.js +19 -4
  68. package/packages/opencode/command/live-canvas/DESIGN_PRINCIPLES.md +2140 -0
  69. package/packages/opencode/command/live-canvas/README.md +273 -0
  70. package/packages/opencode/command/live-canvas/templates/.claude/settings.local.json +8 -0
  71. package/packages/opencode/command/live-canvas/templates/demo/post-variants.html +205 -0
  72. package/packages/opencode/command/live-canvas/templates/feedback-react/FeedbackOverlay.tsx +1299 -0
  73. package/packages/opencode/command/live-canvas/templates/feedback-react/format-utils.ts +283 -0
  74. package/packages/opencode/command/live-canvas/templates/feedback-react/index.ts +62 -0
  75. package/packages/opencode/command/live-canvas/templates/feedback-react/selector-utils.ts +423 -0
  76. package/packages/opencode/command/live-canvas/templates/feedback-react/types.ts +118 -0
  77. package/packages/opencode/command/live-canvas/templates/overlay-vanilla.js +477 -0
  78. package/packages/opencode/command/live-canvas.md +1104 -0
  79. package/packages/opencode/opencode.jsonc +4 -0
  80. package/packages/subagentic-manual.md +18 -15
@@ -0,0 +1,273 @@
1
+ # Live Canvas
2
+
3
+ Click-to-annotate UI design tool for Claude Code. Renders N variants of a component or page in your browser, you click an element and type what to change, and Claude edits the variant file while you watch in the browser. No window switching, no pasted JSON.
4
+
5
+ Ships as a Claude Code skill plus an MCP channel plugin. Works in every tool liteagents supports (Claude, Droid, Amp, Opencode), but **Live mode only works in Claude Code** — other tools run in Batch mode only (see modes below).
6
+
7
+ ---
8
+
9
+ ## How it works
10
+
11
+ ```
12
+ ┌──────────────────────┐ POST /feedback ┌─────────────────────┐
13
+ │ Overlay in browser │ ─────────────────────────► │ live-canvas-channel │
14
+ │ (vanilla JS or React)│ │ (Node MCP server) │
15
+ └──────────────────────┘ └──────────┬──────────┘
16
+ ▲ │
17
+ │ dev server hot-reloads the page │ notifications/
18
+ │ after Claude edits the variant │ claude/channel
19
+ │ ▼
20
+ ┌──────────────────────┐ ┌─────────────────────┐
21
+ │ Dev server (yours) │ ◄──── Claude edits ─────── │ Claude Code session │
22
+ │ e.g. pnpm dev :3000 │ variant file │ (with --dangerously-│
23
+ └──────────────────────┘ │ load-development- │
24
+ │ channels flag) │
25
+ └─────────────────────┘
26
+ ```
27
+
28
+ Each Save in the overlay streams into the Claude session as a `<channel>` tag with the variant, element selector, and user comment. Claude edits the corresponding `.claude-design/lab/variants/Variant<X>.tsx` file. Your dev server hot-reloads. You never leave the browser.
29
+
30
+ ---
31
+
32
+ ## Modes
33
+
34
+ The overlay auto-selects at runtime, the user never toggles manually.
35
+
36
+ | Mode | Trigger | What happens per Save |
37
+ |---|---|---|
38
+ | **Live** | Channel server answers `GET /health`, session was started with the dev-channels flag | Comment streams into Claude's context; Claude edits the file; dev server hot-reloads. Toast: "Pushed to Claude ✨". |
39
+ | **Batch** | No channel, or running under Droid/Amp/Opencode | Comment stays local. On Finish/Submit it writes JSONL (or downloads the file if no endpoint). User pastes or says "check" in the CLI to have the assistant act on the whole batch. |
40
+
41
+ Live mode gracefully degrades to Batch if a push ever fails mid-session.
42
+
43
+ ---
44
+
45
+ ## One-time setup (Live mode, Claude Code only)
46
+
47
+ Run this once per machine. Without it, the skill still works in Batch mode.
48
+
49
+ ### 1. Install plugin npm dependencies
50
+
51
+ ```bash
52
+ bash ~/.claude/plugins/live-canvas-marketplace/setup.sh
53
+ ```
54
+
55
+ Checks Node >= 18, runs `npm install` inside the plugin dir. Idempotent.
56
+
57
+ ### 2. Register the marketplace in Claude Code
58
+
59
+ ```
60
+ /plugin marketplace add ~/.claude/plugins/live-canvas-marketplace
61
+ ```
62
+
63
+ ### 3. Install the plugin
64
+
65
+ ```
66
+ /plugin install live-canvas-channel@live-canvas-marketplace
67
+ ```
68
+
69
+ ### 4. Start Claude Code with the dev-channels flag
70
+
71
+ ```bash
72
+ claude --dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace
73
+ ```
74
+
75
+ Accept the safety prompt (custom channels are in research preview and not on the default allowlist).
76
+
77
+ **Save yourself typing** — add to `~/.bashrc` or `~/.zshrc`:
78
+
79
+ ```bash
80
+ alias claude-live='claude --dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace'
81
+ ```
82
+
83
+ From now on, `claude-live` to enable Live mode, plain `claude` for everything else.
84
+
85
+ ---
86
+
87
+ ## Everyday use
88
+
89
+ ### Start a session
90
+
91
+ Either `claude` (Batch only) or `claude-live` (Live available).
92
+
93
+ ### Invoke the skill in a project
94
+
95
+ ```
96
+ /live-canvas
97
+ ```
98
+
99
+ Phase 0 probes the channel and decides what to do:
100
+
101
+ | State | Skill behavior |
102
+ |---|---|
103
+ | Channel responding | Announces Live mode, goes straight into the interview |
104
+ | Plugin installed but channel not responding (you forgot the dev flag) | AskUserQuestion: Batch now, or close and restart with the flag? |
105
+ | Plugin not installed at all (first run) | AskUserQuestion: set up Live, or just use Batch? Prints the 4-step setup. |
106
+
107
+ ### Interview & generation
108
+
109
+ Skill asks 5 short questions (scope, pain points, inspiration, persona, constraints). Then generates 5 variants in `.claude-design/lab/variants/` and wires a route at `/__live_canvas` in your app.
110
+
111
+ ### Iterate in the browser
112
+
113
+ Open `http://localhost:<dev-port>/__live_canvas`. Click **Add Feedback** (bottom right), click any element in any variant, type a one-liner, Save.
114
+
115
+ - Live mode: toast says "Pushed to Claude ✨", Claude acknowledges and edits the file, dev server hot-reloads.
116
+ - Batch mode: toast says "Saved — submit when ready", pin stays on the element, counter in the Submit button ticks up.
117
+
118
+ Keep clicking until a winner emerges.
119
+
120
+ ### Finish
121
+
122
+ Click the pink **Finish** (Live) or **Submit** (Batch) button:
123
+
124
+ 1. Type the overall direction: e.g. *"Go with B's layout, A's button styling"*
125
+ 2. Click Finish
126
+
127
+ Skill then:
128
+ - Generates `DESIGN_PLAN.md` in project root (winner, files to change, component API, states, a11y checklist)
129
+ - Updates or creates `DESIGN_MEMORY.md` with the patterns it learned
130
+ - Deletes `.claude-design/` and the `/__live_canvas` route
131
+
132
+ Done.
133
+
134
+ ---
135
+
136
+ ## Files and where they live
137
+
138
+ ### In this repo (source)
139
+
140
+ ```
141
+ packages/claude/
142
+ ├── skills/live-canvas/
143
+ │ ├── SKILL.md # Skill instructions (phases, flow)
144
+ │ ├── DESIGN_PRINCIPLES.md # UX/a11y/motion reference
145
+ │ ├── INTEGRATION_NOTES.md # Design-time notes (channel paths explored)
146
+ │ ├── README.md # This file
147
+ │ └── templates/
148
+ │ ├── overlay-vanilla.js # Framework-agnostic overlay (~400 lines)
149
+ │ ├── feedback-react/ # React overlay for React/Next/Vite projects
150
+ │ └── demo/post-variants.html # Standalone demo for testing the overlay
151
+ └── plugins/
152
+ └── live-canvas-marketplace/
153
+ ├── .claude-plugin/marketplace.json
154
+ ├── setup.sh # Runs npm install and prints manual steps
155
+ └── plugins/live-canvas-channel/
156
+ ├── .claude-plugin/plugin.json
157
+ ├── server.js # MCP server + HTTP listener on :8788
158
+ ├── schema.json # Feedback payload schema (v1.0)
159
+ ├── package.json # @modelcontextprotocol/sdk dep
160
+ └── README.md # Plugin-specific docs (protocol, debug)
161
+ ```
162
+
163
+ ### On the user's disk after liteagents install
164
+
165
+ ```
166
+ ~/.claude/
167
+ ├── skills/live-canvas/ # Copied from packages/claude/skills/
168
+ └── plugins/live-canvas-marketplace/ # Copied from packages/claude/plugins/
169
+ ```
170
+
171
+ `node_modules/` is NOT copied — `setup.sh` creates it locally via `npm install`.
172
+
173
+ ### After `/plugin install` (Claude Code's own register step)
174
+
175
+ ```
176
+ ~/.claude/plugins/cache/live-canvas-marketplace/ # Claude Code's registered copy
177
+ ```
178
+
179
+ Two different dirs:
180
+ - `~/.claude/plugins/live-canvas-marketplace/` — where liteagents puts the source
181
+ - `~/.claude/plugins/cache/live-canvas-marketplace/` — where Claude Code puts its own registered copy after `/plugin install`
182
+
183
+ The skill checks the cache dir to tell first-time vs returning users apart.
184
+
185
+ ### Per-project, during a session
186
+
187
+ ```
188
+ <project-root>/
189
+ └── .claude-design/
190
+ ├── lab/variants/VariantA.tsx … VariantE.tsx
191
+ ├── lab/FeedbackOverlay.tsx (React) OR overlay-vanilla.js (other)
192
+ ├── design-brief.json # Structured output from the interview
193
+ └── feedback.jsonl # Batch mode only; deleted on Finish
194
+ ```
195
+
196
+ Plus a temporary route (e.g. `app/__live_canvas/page.tsx` for Next.js App Router). Everything under `.claude-design/` and the temporary route is deleted on Finish or Abort.
197
+
198
+ ### What survives after Finish
199
+
200
+ ```
201
+ <project-root>/
202
+ ├── DESIGN_PLAN.md # Winner + implementation steps
203
+ └── DESIGN_MEMORY.md # Accumulated design-system patterns
204
+ ```
205
+
206
+ ---
207
+
208
+ ## The install pipeline, end to end
209
+
210
+ 1. **Liteagents installer** copies files:
211
+ - `packages/claude/skills/live-canvas/` → `~/.claude/skills/live-canvas/`
212
+ - `packages/claude/plugins/live-canvas-marketplace/` → `~/.claude/plugins/live-canvas-marketplace/`
213
+ 2. **User, once:** runs `bash ~/.claude/plugins/live-canvas-marketplace/setup.sh` → installs the plugin's npm deps
214
+ 3. **User, once:** in a Claude session, runs `/plugin marketplace add ~/.claude/plugins/live-canvas-marketplace` + `/plugin install live-canvas-channel@live-canvas-marketplace`
215
+ 4. **User, every session that wants Live mode:** starts Claude with `--dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace` (or `claude-live` alias)
216
+ 5. **User, whenever:** `/live-canvas` in any project
217
+
218
+ Steps 1, 2, 3 are truly one-time. Step 4 is per-session. Step 5 is per-project-use.
219
+
220
+ ---
221
+
222
+ ## Troubleshooting
223
+
224
+ ### "Listening for channel messages…" appears on session start, but skill still says Batch
225
+
226
+ Port 8788 is stuck from an earlier session's server process. Kill it:
227
+
228
+ ```bash
229
+ lsof -i :8788
230
+ kill <pid>
231
+ ```
232
+
233
+ Then `/reload-plugins` in the new session.
234
+
235
+ ### Skill says "No response on :8788" even though I set everything up
236
+
237
+ Three common causes, in order of likelihood:
238
+
239
+ 1. You didn't start this session with the dev flag. Close it, reopen with `claude-live`.
240
+ 2. The plugin subprocess died on startup. In the session, run `/mcp` — look for `live-canvas` with its status. "Failed to connect" means a node/dep error: check `~/.claude/debug/<session-id>.txt` for the stderr.
241
+ 3. You never ran step 2 of setup. Re-run `bash ~/.claude/plugins/live-canvas-marketplace/setup.sh`.
242
+
243
+ ### Overlay loads in the browser but no pills appear
244
+
245
+ The overlay script didn't load. Most common cause: you started the Python server inside the wrong directory so the relative `../overlay-vanilla.js` path couldn't resolve. Start the server one level up and navigate with the `/demo/` prefix.
246
+
247
+ ### "Pushed to Claude ✨" toast appears but nothing happens in the terminal
248
+
249
+ Either (a) you're not in a dev-flag session, or (b) an older channel server process is answering on 8788 and is stdio-connected to a dead session. See the two troubleshooting items above.
250
+
251
+ ### I want to uninstall
252
+
253
+ 1. Remove the plugin from Claude Code: `/plugin uninstall live-canvas-channel`
254
+ 2. Delete the marketplace: `/plugin marketplace remove live-canvas-marketplace`
255
+ 3. Remove the dev flag from your alias/shortcut
256
+ 4. Rerun liteagents installer in remove mode (or delete `~/.claude/skills/live-canvas/` and `~/.claude/plugins/live-canvas-marketplace/` by hand)
257
+
258
+ ---
259
+
260
+ ## Why the multi-step setup can't be hidden
261
+
262
+ The `--dangerously-load-development-channels` flag is a per-session startup argument of Claude Code itself. A running session can't promote itself to channel-enabled mid-flight; only the next session launched with the flag gets it. Same reason a skill can't silently do `/plugin install` on your behalf — the plugin system needs explicit user consent for research-preview plugins.
263
+
264
+ Until channels leave research preview and custom channels are allowlisted, step 4 is the irreducible friction. The alias removes the retyping cost.
265
+
266
+ ---
267
+
268
+ ## Pointers
269
+
270
+ - Plugin details: [`~/.claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md`](../../plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md)
271
+ - Skill flow: [`SKILL.md`](./SKILL.md)
272
+ - Design principles reference: [`DESIGN_PRINCIPLES.md`](./DESIGN_PRINCIPLES.md)
273
+ - Channels reference (upstream): <https://code.claude.com/docs/en/channels-reference>
@@ -0,0 +1,8 @@
1
+ {
2
+ "enabledMcpjsonServers": [
3
+ "aurora-lsp-poc",
4
+ "cclsp",
5
+ "baremobile",
6
+ "barebrowse"
7
+ ]
8
+ }
@@ -0,0 +1,205 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Live Canvas — Post card demo</title>
6
+ <style>
7
+ :root { color-scheme: light; }
8
+ body { margin: 0; font-family: -apple-system, system-ui, sans-serif; background: #f4f4f5; color: #18181b; }
9
+ header { padding: 24px 32px; border-bottom: 1px solid #e4e4e7; background: #fff; }
10
+ header h1 { margin: 0 0 4px; font-size: 20px; }
11
+ header p { margin: 0; color: #71717a; font-size: 13px; }
12
+ main { padding: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; max-width: 1400px; margin: 0 auto; }
13
+ .variant-wrap { background: #fff; border: 1px solid #e4e4e7; border-radius: 12px; padding: 16px; }
14
+ .variant-wrap h3 { margin: 0 0 4px; font-size: 13px; color: #71717a; text-transform: uppercase; letter-spacing: .5px; }
15
+ .variant-wrap .why { margin: 0 0 14px; font-size: 12px; color: #a1a1aa; }
16
+ .post { padding: 14px; border-radius: 10px; }
17
+
18
+ /* ============ Variant A — classic Twitter-ish, icon row ============ */
19
+ [data-variant="A"] .post { background: #fff; border: 1px solid #e4e4e7; }
20
+ .va-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
21
+ .va-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #d946ef); }
22
+ .va-name { font-weight: 700; font-size: 14px; }
23
+ .va-handle { color: #71717a; font-size: 13px; }
24
+ .va-body { font-size: 15px; line-height: 1.45; margin: 0 0 12px; }
25
+ .va-actions { display: flex; justify-content: space-between; color: #71717a; font-size: 13px; }
26
+ .va-actions button { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 4px 8px; display: flex; gap: 6px; align-items: center; border-radius: 999px; font-size: 13px; }
27
+ .va-actions button:hover { background: #f4f4f5; }
28
+
29
+ /* ============ Variant B — card with big engagement bar on top ============ */
30
+ [data-variant="B"] .post { background: #fafafa; border: 1px solid #e4e4e7; padding: 0; overflow: hidden; }
31
+ .vb-strip { background: #18181b; color: #fff; padding: 10px 14px; display: flex; gap: 18px; font-size: 12px; font-weight: 600; }
32
+ .vb-strip .vb-metric { display: flex; gap: 6px; align-items: center; }
33
+ .vb-strip .vb-metric b { color: #d946ef; }
34
+ .vb-body { padding: 14px; }
35
+ .vb-text { font-size: 15px; line-height: 1.5; margin: 8px 0 12px; }
36
+ .vb-author { font-size: 13px; color: #71717a; }
37
+ .vb-foot { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #e4e4e7; }
38
+ .vb-foot button { flex: 1; background: #fff; border: 1px solid #e4e4e7; padding: 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
39
+ .vb-foot button:hover { background: #f4f4f5; }
40
+ .vb-foot button[data-testid="reply-b"] { background: #2563eb; color: #fff; border-color: #1d4ed8; }
41
+ .vb-foot button[data-testid="reply-b"]:hover { background: #1d4ed8; }
42
+
43
+ /* ============ Variant C — compact / list style, data-dense ============ */
44
+ [data-variant="C"] .post { background: #fff; border: 1px solid #e4e4e7; padding: 10px 12px; font-size: 13px; }
45
+ .vc-row { display: flex; gap: 10px; align-items: flex-start; }
46
+ .vc-avatar { width: 28px; height: 28px; border-radius: 50%; background: #27272a; flex-shrink: 0; }
47
+ .vc-main { flex: 1; min-width: 0; }
48
+ .vc-meta { color: #71717a; font-size: 12px; }
49
+ .vc-text { margin: 2px 0 6px; line-height: 1.4; }
50
+ .vc-metrics { display: flex; gap: 12px; font-size: 12px; color: #52525b; }
51
+ .vc-metrics span { cursor: pointer; }
52
+ .vc-metrics span:hover { color: #18181b; }
53
+
54
+ /* ============ Variant D — spacious / premium feel, big type ============ */
55
+ [data-variant="D"] .post { background: #fff; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.04); padding: 24px; border-radius: 14px; }
56
+ .vd-author { font-size: 12px; color: #71717a; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
57
+ .vd-text { font-size: 18px; line-height: 1.55; font-weight: 500; margin: 0 0 20px; color: #18181b; }
58
+ .vd-divider { height: 1px; background: #e4e4e7; margin-bottom: 16px; }
59
+ .vd-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
60
+ .vd-metric { text-align: center; }
61
+ .vd-metric b { display: block; font-size: 20px; font-weight: 700; }
62
+ .vd-metric span { font-size: 11px; color: #71717a; text-transform: uppercase; letter-spacing: .5px; }
63
+
64
+ /* ============ Variant E — playful / colorful, chips for actions ============ */
65
+ [data-variant="E"] .post { background: linear-gradient(135deg, #fdf4ff, #eff6ff); border: 2px solid #fff; padding: 18px; border-radius: 16px; }
66
+ .ve-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
67
+ .ve-avatar { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #f59e0b, #ef4444); }
68
+ .ve-name { font-weight: 800; font-size: 15px; }
69
+ .ve-text { font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
70
+ .ve-chips { display: flex; gap: 8px; flex-wrap: wrap; }
71
+ .ve-chip { background: #fff; border: 0; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: flex; gap: 6px; align-items: center; }
72
+ .ve-chip[data-kind="like"] { color: #ef4444; }
73
+ .ve-chip[data-kind="retweet"] { color: #22c55e; }
74
+ .ve-chip[data-kind="reply"] { color: #3b82f6; }
75
+ </style>
76
+ </head>
77
+ <body>
78
+
79
+ <header>
80
+ <h1>Live Canvas — Post card demo</h1>
81
+ <p>5 variations of a social post (likes, retweets, comments). Click <b>Add Feedback</b> bottom-right → click any element → leave a comment. Right-click the pill to submit.</p>
82
+ </header>
83
+
84
+ <main>
85
+
86
+ <!-- ============ Variant A ============ -->
87
+ <section class="variant-wrap" data-variant="A">
88
+ <h3>Variant A</h3>
89
+ <p class="why">Classic layout — header row, body, actions in a row of icons</p>
90
+ <div>
91
+ <article class="post">
92
+ <div class="va-head">
93
+ <div class="va-avatar"></div>
94
+ <div>
95
+ <div class="va-name">Ada Lovelace</div>
96
+ <div class="va-handle">@ada · 2h</div>
97
+ </div>
98
+ </div>
99
+ <p class="va-body">Shipped a draft of the analytical engine today. Feedback welcome — especially on the punch-card UX.</p>
100
+ <div class="va-actions">
101
+ <button data-testid="reply-a">💬 <span>48</span></button>
102
+ <button data-testid="retweet-a">🔁 <span>132</span></button>
103
+ <button data-testid="like-a">❤️ <span>1.2k</span></button>
104
+ <button data-testid="share-a">↗️</button>
105
+ </div>
106
+ </article>
107
+ </div>
108
+ </section>
109
+
110
+ <!-- ============ Variant B ============ -->
111
+ <section class="variant-wrap" data-variant="B">
112
+ <h3>Variant B</h3>
113
+ <p class="why">Metrics strip on top — data-forward, actions as buttons below</p>
114
+ <div>
115
+ <article class="post">
116
+ <div class="vb-strip">
117
+ <div class="vb-metric">❤️ <b>1,204</b> likes</div>
118
+ <div class="vb-metric">🔁 <b>132</b> retweets</div>
119
+ <div class="vb-metric">💬 <b>48</b> replies</div>
120
+ </div>
121
+ <div class="vb-body">
122
+ <div class="vb-author">Ada Lovelace · @ada · 2h</div>
123
+ <p class="vb-text">Shipped a draft of the analytical engine today. Feedback welcome — especially on the punch-card UX.</p>
124
+ </div>
125
+ <div class="vb-foot">
126
+ <button data-testid="reply-b">Reply</button>
127
+ <button data-testid="retweet-b">Retweet</button>
128
+ <button data-testid="like-b">Like</button>
129
+ </div>
130
+ </article>
131
+ </div>
132
+ </section>
133
+
134
+ <!-- ============ Variant C ============ -->
135
+ <section class="variant-wrap" data-variant="C">
136
+ <h3>Variant C</h3>
137
+ <p class="why">Compact / list-style — maximum density, small avatar, inline metrics</p>
138
+ <div>
139
+ <article class="post">
140
+ <div class="vc-row">
141
+ <div class="vc-avatar"></div>
142
+ <div class="vc-main">
143
+ <div class="vc-meta"><b style="color:#18181b">Ada Lovelace</b> · @ada · 2h</div>
144
+ <div class="vc-text">Shipped a draft of the analytical engine today. Feedback welcome — especially on the punch-card UX.</div>
145
+ <div class="vc-metrics">
146
+ <span data-testid="reply-c">💬 48</span>
147
+ <span data-testid="retweet-c">🔁 132</span>
148
+ <span data-testid="like-c">❤️ 1.2k</span>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </article>
153
+ </div>
154
+ </section>
155
+
156
+ <!-- ============ Variant D ============ -->
157
+ <section class="variant-wrap" data-variant="D">
158
+ <h3>Variant D</h3>
159
+ <p class="why">Spacious / premium — big body type, metrics as a stat block</p>
160
+ <div>
161
+ <article class="post">
162
+ <div class="vd-author">Ada Lovelace · 2 hours ago</div>
163
+ <p class="vd-text">Shipped a draft of the analytical engine today. Feedback welcome — especially on the punch-card UX.</p>
164
+ <div class="vd-divider"></div>
165
+ <div class="vd-metrics">
166
+ <div class="vd-metric" data-testid="likes-d"><b>1,204</b><span>Likes</span></div>
167
+ <div class="vd-metric" data-testid="retweets-d"><b>132</b><span>Retweets</span></div>
168
+ <div class="vd-metric" data-testid="replies-d"><b>48</b><span>Replies</span></div>
169
+ </div>
170
+ </article>
171
+ </div>
172
+ </section>
173
+
174
+ <!-- ============ Variant E ============ -->
175
+ <section class="variant-wrap" data-variant="E">
176
+ <h3>Variant E</h3>
177
+ <p class="why">Expressive / playful — rounded avatar, gradient bg, colored action chips</p>
178
+ <div>
179
+ <article class="post">
180
+ <div class="ve-head">
181
+ <div class="ve-avatar"></div>
182
+ <div class="ve-name">Ada Lovelace <span style="font-weight:400;color:#71717a">· 2h</span></div>
183
+ </div>
184
+ <p class="ve-text">Shipped a draft of the analytical engine today. Feedback welcome — especially on the punch-card UX.</p>
185
+ <div class="ve-chips">
186
+ <button class="ve-chip" data-kind="like" data-testid="like-e">❤️ 1.2k</button>
187
+ <button class="ve-chip" data-kind="retweet" data-testid="retweet-e">🔁 132</button>
188
+ <button class="ve-chip" data-kind="reply" data-testid="reply-e">💬 48</button>
189
+ </div>
190
+ </article>
191
+ </div>
192
+ </section>
193
+
194
+ </main>
195
+
196
+ <!-- Overlay (relative path works with file://) -->
197
+ <script src="../overlay-vanilla.js"></script>
198
+ <script>
199
+ LiveCanvas.init({
200
+ target: 'PostCard',
201
+ channelUrl: 'http://localhost:8788',
202
+ });
203
+ </script>
204
+ </body>
205
+ </html>