feat: opt-in feedback command and invite - #75
Merged
Conversation
- `mex feedback` opens a hosted form (FEEDBACK_FORM_URL) in the browser so users can opt in to maintainer user-research calls. The CLI never collects, prompts for, or transmits an email — its job ends at opening the URL. - A quiet, dismissible one-line invite appears after a successful `check`/`sync` (to stderr, so it never corrupts `--json`) and in the bare-`mex` TUI. It's TTY-gated, shown a few times then stops on its own, and `mex feedback` or `mex config set feedback off` dismisses it for good (`on` re-enables). - Kept fully separate from telemetry: the feedback module does not import the telemetry module (or vice versa), and no feedback value enters the telemetry payload. Also folds in the Copilot review nits from the E1 PR (#73): - ensureScaffoldIdentity/getScaffoldIdentity now backfill an empty scaffold_name without regenerating the id. - Reword "`.mex/config.json`" to "the scaffold's config.json" in the ScaffoldIdentity JSDoc and CHANGELOG (the context/ layout stores it at the repo root).
There was a problem hiding this comment.
Pull request overview
Adds an opt-in feedback flow to the mex CLI while keeping it isolated from telemetry, and folds in a small scaffold-identity robustness improvement (backfilling missing scaffold_name without regenerating IDs). This fits alongside the previously merged scaffold identity + telemetry handoff by providing a separate, user-initiated channel for maintainer research contact.
Changes:
- Introduces
mex feedbackto open a hosted feedback form URL and permanently dismiss future invites on engagement. - Adds a quiet invite surface after
check/syncand in the Ink TUI, with global-config persistence for dismissal/show-count. - Improves scaffold identity handling to backfill a missing/empty
scaffold_namewithout changing an existingscaffold_id, with regression coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/feedback.test.ts | Adds unit tests for feedback URL opening, TTY gating, invite show-cap, stderr behavior, and enable/disable flows. |
| test/config.test.ts | Adds regression coverage for scaffold identity backfill without regenerating scaffold_id. |
| src/types.ts | Updates ScaffoldIdentity JSDoc wording to match current scaffold config location semantics. |
| src/tui.ts | Displays the feedback invite in the TUI (subject to invite state). |
| src/global-config.ts | Extends global config schema with feedback invite dismissal and show-count keys. |
| src/feedback/index.ts | Implements feedback command behavior, browser opener seam, invite gating, persistence, and invite printing. |
| src/config.ts | Updates scaffold identity ensure/get logic to backfill missing scaffold_name while preserving scaffold_id. |
| src/cli.ts | Wires in feedback command and invite surfacing; extends mex config set with `feedback on |
| CHANGELOG.md | Documents the new feedback command/invite and updates scaffold identity wording. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
165
to
168
| // Warm moment — the user just got a drift result. Quietly invite feedback. | ||
| maybeShowInvite(); | ||
|
|
||
| if (hasErrors) process.exit(1); |
Comment on lines
+112
to
+127
| /** | ||
| * Print the invite to **stderr** (so it never corrupts machine-readable stdout | ||
| * like `check --json`) and record that it was shown. No-op when the invite | ||
| * should not show. Returns true if it was printed. | ||
| */ | ||
| export function maybeShowInvite(): boolean { | ||
| if (!shouldShowInvite()) return false; | ||
| try { | ||
| process.stderr.write(`\n ${INVITE_TEXT}\n (hide: mex config set feedback off)\n\n`); | ||
| const count = readGlobalConfig().feedbackInviteCount; | ||
| setGlobalConfigKey("feedbackInviteCount", (typeof count === "number" ? count : 0) + 1); | ||
| return true; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } |
| import { runDriftCheck } from "./drift/index.js"; | ||
| import { checkHeartbeat, type HeartbeatResult } from "./heartbeat.js"; | ||
| import { appendEvent, readEvents, type EventEntry, type EventKind } from "./events.js"; | ||
| import { isInviteDismissed, INVITE_TEXT } from "./feedback/index.js"; |
Comment on lines
+199
to
+203
| ), | ||
| h(Box, { marginTop: 1 }, h(Text, { dimColor: true }, "↑/↓ choose · enter run · r refresh · l log · esc dashboard · q quit")), | ||
| isInviteDismissed() | ||
| ? null | ||
| : h(Box, { marginTop: 1 }, h(Text, { color: COLORS.crab }, `✨ ${INVITE_TEXT}`)), |
- The check invite now fires only on a clean check (after the error-exit), not right before `process.exit(1)` on a drift-failing check — matches "after a successful check". - The TUI invite now respects the same gating as the CLI nudge: it uses shouldShowInvite() (so the INVITE_MAX_SHOWS cap and dismissal both apply) and records one show per TUI session via a useEffect. Extracted a recordInviteShown() helper so the count is bumped consistently from both surfaces without printing.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third and final piece of the telemetry + feedback handoff. Branches off
main(E1 #73 and telemetry #74 are merged).What
mex feedbackopens a hosted form (FEEDBACK_FORM_URL→ Tally) in the browser so users can opt in to maintainer user-research calls.check/syncand in the bare-mexTUI.Trust properties
check --json), shown a few times then stops on its own.mex feedbackormex config set feedback offdismisses it for good;onre-enables.Also folds in the E1 (#73) Copilot review nits
ensureScaffoldIdentity/getScaffoldIdentitynow backfill an emptyscaffold_namewithout regenerating the id..mex/config.json" → "the scaffold'sconfig.json" in theScaffoldIdentityJSDoc and CHANGELOG (thecontext/layout stores config at the repo root).Tests
229 pass, typecheck clean. New
test/feedback.test.tscovers: form URL, opener seam + error swallowing, engage-dismisses-invite, TTY gating, the show-cap, stderr-not-stdout, and re-enable. Plus a regression test for thescaffold_namebackfill.