Skip to content

fix(email-offer): say the last key exits and ignore keys while hidden - #1591

Merged
Silthus merged 11 commits into
mainfrom
fix/email-offer-followups
Nov 20, 2026
Merged

Silthus merged 11 commits into
mainfrom
fix/email-offer-followups

Conversation

@Silthus

@Silthus Silthus commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After #1508, the email provider question is the Wizard's last step, behind the flag wizard-email-provider-offer at 0%. Four small rough edges are left, all listed as known issues on #1508:

  • After "Yes", the screen says "Press any key to continue", but the key closes the Wizard.
  • While a too-small terminal hides the setup lines after "Yes", any key dismisses them unseen.
  • The Workflows link accepts any parseable pinned URL, such as file:.
  • When the directory can't be shown, "Run this in your app" doesn't say to change into the app first. A paste from a monorepo root runs in the wrong tree.

Merge risk

Note

🔵 Merge risk: low · two-way door (merge-risk rubric)

  • Every change is on the email provider question, which shows only while wizard-email-provider-offer is on. The flag is at 0%, so merging changes nothing a user sees.
  • A pinned --base-url that isn't http(s) now means no question, where feat(analytics): ask about the email provider after install #1508 asked and printed that link.
  • The setup lines change wording when they can't name the directory, or on a pinned run: they now say to change into the app's directory first.
  • While a too-small terminal hides the setup lines after "Yes", a key no longer closes the Wizard. The first key once they show again does.
  • On a pinned run or a directory it can't show, the exit summary left in the scrollback after "Yes" carries the same new lead (emailSetupBlock in exit-line.ts), as the pinned walk shows.
  • The question's picker, PickerMenu and useKeyBindings are as on main.
  • Switch-off: set wizard-email-provider-offer to off.

Tier: non-critical

Changes

  • After "Yes" (EmailProviderOfferScreen): "Press any key to exit", the words other final screens use.
  • While a too-small terminal hides the setup lines: keys don't dismiss them. The first key once they're visible exits.
  • The Workflows link (workflowsUrl in email-provider-offer.ts): only an http: or https: app host gets a link. Any other scheme means no question. The comment now credits clearing the user and password with dropping credentials.
  • The fallback lead (email-setup-command.ts): "Change into your app's directory, then run this:", and for a pinned run "…, then run this, adding the --base-url this run used:".

Test plan

  • Gates on this branch: pnpm typecheck green, pnpm lint with no errors, and the full suite green at 14cd2352.

  • Each new row fails with main's code:

    • email-provider-offer.test.ts: file:///srv/posthog and javascript:alert(1) as the pinned instance ask nothing.
    • email-setup-command.test.ts: the pinned and non-plain fallback leads.
    • EmailProviderOfferScreen.test.tsx: "Press any key to exit" after Yes.
    • EmailProviderOfferScreen.test.tsx, through the real screen container and terminal resizes: after Yes, a key on the first hidden frame asks no exit, and the next key at 120x40 asks the host to exit with 0.
  • Rows that guard main's behaviour through the real container, and fail if it breaks:

    • An Enter on the first frame a too-small terminal hides the question answers nothing.
    • A question hidden after it showed takes neither Enter nor Esc. This fails when the Esc handler drops its visible check.
  • Live walks at 14cd2352: real Wizard installs under a pty, flag on, against a sandbox app with Resend. Every run exited 0 and sent one shown and one answered, with providers: ["Resend"]. A non-web pinned instance can't be walked, because the install can't finish against it; unit tests cover it.

    Run At the question What happened
    Hidden question "Not now" highlighted; shrunk to 70x24; Down, Down, Enter, Esc; back to 120x40; Enter Nothing answered while hidden. The hidden Downs moved the highlight round to "Yes, show me how", as on main (Known issues), so Enter answered yes
    Hidden setup lines Enter; shrunk to 70x24; x; back to 120x40; x The key while hidden kept the setup lines; the first key at full size closed the Wizard
    Directory it can't show Install dir with a right-to-left override; Enter; x "Change into your app's directory, then run this:" and the full command, then "Press any key to exit"
    Pinned run --base-url https://us.posthog.com; Enter; x "…, then run this, adding the --base-url this run used:" and the command; the scrollback after exit keeps that lead

    Not now highlighted before the resize
    The question hidden at 70x24: only the notice, no answers
    Back at 120x40 after Down, Down, Enter, Esc while hidden: nothing answered, Yes highlighted
    The setup lines hidden at 70x24; a key here does not exit
    Back at 120x40 the setup lines and Press any key to exit are still there
    A directory it can't show: change into your app's directory, then run this
    A pinned run: adding the --base-url this run used
    A pinned run after Yes and exit: the scrollback keeps the new lead and the command

Known issues

Both are as on main:

  • While a too-small terminal hides the question, arrow keys still move the highlighted answer.
  • An Enter that arrives on the first frame the question shows again, after a hide longer than a second, answers it.

LLM context

Agent context and decisions

Built by Claude Code, Claude Opus 5.5 (claude-opus-5-5), as the follow-up to #1508.

Question Answer Who Where
What goes in this PR? The copy fix and the cheap known issues from #1508. The cancellation tests through a real mount stay out: they are test-only and larger 🤖 lane ticket
Does this PR change how the hidden question takes keys? No. The picker stays as on main, with both gaps under Known issues. Rejected: an active option on the shared PickerMenu and useKeyBindings, where each review round found another timing gap; and unmounting the picker while hidden, which let an Enter on the first hidden frame answer unseen 🤖 conductor lane
What does the last key say? "Press any key to exit", as on the other final screens 🤖 this PR

🤖 Generated with Claude Code

How did you test this code?

Proof What ran Result Commit
live-run Four real Wizard installs under a pty at 14cd235, flag on, sandbox app with Resend: hidden3, hiddenyes, nonplain, pinned All exit 0; one shown and one answered each in project 2; hidden picker took no Enter or Esc; setup lines kept while hidden; both fallback leads shown 14cd235
ui-walk Terminal frames of the four live installs at 14cd235, rendered at 120x40 and 70x24 The question hidden at 70x24 shows only the notice and answers nothing; the setup lines and Press any key to exit survive a hidden key; both fallback leads show, and the pinned scrollback keeps its lead 14cd235
Review 1-lens panel (gpt-6.2-sol), round 1, round 2, round 3, round 4, round 5, final read 1 14 findings: 0 fixed, 0 rejected, 14 other 45549a6 to 14cd235
Proof judge an independent model reads the evidence against the diff ❌ failed at 14cd235

Not checked: none recorded
Gaps: judge: The judge holds only on proof that a non-http(s) pinned host gets no offer. A live install cannot finish against a file: or javascript: host, so no walk can reach the question; email-provider-offer.test.ts:126 runs the real eligibility code on a completed-session fixture and fails on main. The conductor accepted this gap in d-02ded214, and the review, risk and quality questions pass., accepted by 🤖 agent 2026-11-20
Full receipt (PostHog team): https://artifacts.posthog.com/a/PVbqjAyGtw39eTxsC9Rdss

- After Yes, the screen says "Press any key to exit", since the offer is
  the run's last step.
- While a too-small terminal hides the question, the picker is not
  mounted, so arrow keys can't move a highlight nobody sees; a key while
  the setup lines are hidden doesn't dismiss them.
- The Workflows link needs an http(s) app host.
- The fallback says to change into the app's directory first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/go-sdk
  • /wizard-ci mcp-analytics/python-sdk
  • /wizard-ci mcp-analytics/ruby-sdk
  • /wizard-ci mcp-analytics/rust-sdk
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

Silthus and others added 10 commits November 20, 2026 05:12
The hidden-setup test now shrinks and grows the terminal through
ScreenContainer instead of injecting visibility, and checks the setup
lines come back before the next key exits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… question

The picker stays mounted with keys off while hidden, through a new `active`
option on PickerMenu and useKeyBindings, so a resize no longer resets the
highlight to Yes. The resize test now checks the host's exit request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ink detaches an inactive input listener in a passive effect, so a key sent
on the first frame of the viewport notice still moved the hidden picker.
The resize tests now go through the real screen container and press on
that first frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ink's isActive attaches the listener a render late too, so a key on the
first frame after the question came back was dropped. The listener now
stays attached and only the handler checks active. The hidden-start test
resizes the real screen container instead of setting the context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard reset ran in a passive effect, so an Enter on the first frame
after a long hide answered at once. It now runs in a layout effect. The
resize test checks the restored highlight on its own, and a new test
presses Enter on that first frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With color on, Ink puts escape codes between the highlight marker and the
label, and inside the viewport notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ignoring keys on a hidden picker needed a new option on the shared
PickerMenu and useKeyBindings, and each fix to it found another timing
gap. It goes back to main's behaviour and stays a known issue. The copy
fix, the hidden setup lines, the link check and the leads stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arrow keys can't move a highlight nobody can see, and the one-second
guard restarts with the remounted picker. The shared PickerMenu and
useKeyBindings stay as on main; the highlight resets to Yes after a
resize.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The container rewrite dropped main's check that a question hidden
after it showed takes neither Enter nor Esc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unmounting it while hidden let an Enter on the first hidden frame
answer through the picker's last callback. The question keeps main's
picker; a test now guards that a hidden Enter answers nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus marked this pull request as ready for review November 20, 2026 13:04
@Silthus Silthus added the stamphog Auto-merge stamp for automated PRs label Nov 20, 2026
@veria-ai

veria-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@posthog-security-review-bot posthog-security-review-bot Bot added the security-review Request a security review label Nov 20, 2026
@posthog-security-review-bot

posthog-security-review-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Security review complete — 14cd23524bbe

No findings above the confidence threshold, in 6 min.

Add the security-review label to run again on the latest commit.

@Silthus
Silthus requested a review from a team November 20, 2026 13:11

@posthog-security-review-bot posthog-security-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-driven security review - no findings.

@posthog-security-review-bot posthog-security-review-bot Bot removed the security-review Request a security review label Nov 20, 2026
@Silthus
Silthus requested a review from edwinyjlim November 20, 2026 17:41
@Silthus
Silthus merged commit 3872773 into main Nov 20, 2026
22 checks passed
@Silthus
Silthus deleted the fix/email-offer-followups branch November 20, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Auto-merge stamp for automated PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants