Commit 79c4a6c
committed
Beta: in-app "Send feedback" channel (Help menu + palette → API server → Discord)
Open-beta testers can now send free-text feedback from inside the app with zero friction: Help > "Send feedback…" (macOS + Linux) or the palette's "Send feedback" opens a small dialog, and the note lands on the API server and pings Discord, mirroring how error reports already flow (minus the log bundle).
- api-server: new `POST /feedback` (JSON: required `feedback` ≤ 100k code points + `appVersion`/`osVersion`, optional reply-to `email` + `buildMode`). The D1 `feedback` table (migration `0007_feedback.sql`) is the durable sink, so the write is awaited and a failure returns a soft 502 the app surfaces as a retry; the Discord embed (truncated preview, `[DEV]`/`[PROD]` prefix) rides `waitUntil` and prefers the new optional `DISCORD_FEEDBACK_WEBHOOK_URL`, falling back to `DISCORD_WEBHOOK_URL` so it works with no new secret. Abuse guards mirror the sibling routes: `FEEDBACK_LIMITER` at 5/min/IP (IP never stored), 512 KB body cap, strict shape validation. 22 new vitest tests (endpoint + Discord payload).
- Desktop backend: `feedback.rs` (trim + code-point-cap validation, payload assembly, send with the error reporter's CI/E2E skip gates) + thin async `send_feedback` command returning a typed `SendFeedbackResult` (`sent`/`invalid`/`softFailure`), no string matching. Registered in `ipc.rs` + `ipc_collectors.rs`; bindings regenerated.
- Desktop frontend: new `lib/feedback/` feature (flow store + dialog). Same 50k/100k code-point note caps as the error reporter, the same sticky "Attach my email (…) so we can reply" checkbox (gated on `analytics.email`, persisted via `updates.attachEmailToReports`), warm success toast, inline friendly retry on failure with the text preserved. A quiet line links "browse and vote on GitHub" and "book a call" via the new shared `lib/beta-links.ts` (booking URL is a placeholder until release), routed through the opener plugin.
- Command wiring: `feedback.send` in `COMMAND_IDS` + registry (palette-visible) + handler; Help-menu items on both platforms dispatch it through the usual `execute-command` path; `feedback` added to the soft-dialog registry.
- Tests: TDD red-first on the api-server endpoint and the Rust validator (the naive first cut failed exactly on trim + code-point counting); dialog gets tier-3 a11y + behavior tests; flow store and IPC wrapper unit-tested; characterization + registry pins updated. Full `pnpm check` green.
- Docs: api-server CLAUDE.md (route, limiter, data flow, migration pointer), new `lib/feedback/CLAUDE.md`, architecture.md entries, command-count refresh.
Deploy notes: apply the D1 migration (`wrangler d1 migrations apply cmdr-telemetry`) before deploying the Worker; optionally set `DISCORD_FEEDBACK_WEBHOOK_URL` for a dedicated channel.1 parent 219549d commit 79c4a6c
36 files changed
Lines changed: 1534 additions & 24 deletions
File tree
- apps
- api-server
- migrations
- src
- desktop
- src-tauri/src
- commands
- src
- lib
- commands
- feedback
- ipc
- tauri-commands
- ui
- routes/(main)
- command-handlers
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
193 | 197 | | |
194 | 198 | | |
195 | 199 | | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| |||
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
258 | 264 | | |
259 | 265 | | |
260 | 266 | | |
| |||
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
316 | 331 | | |
317 | 332 | | |
318 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
115 | 153 | | |
116 | 154 | | |
117 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
36 | 55 | | |
37 | 56 | | |
38 | 57 | | |
| |||
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
82 | 129 | | |
83 | 130 | | |
84 | 131 | | |
| |||
127 | 174 | | |
128 | 175 | | |
129 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
0 commit comments