Skip to content

Invite logged-out users to log in with a new login dialog, behind an Unleash experiment (STA-574) - #24969

Open
rjp-coder wants to merge 1 commit into
masterfrom
ryanparry-sta-574
Open

rjp-coder wants to merge 1 commit into
masterfrom
ryanparry-sta-574

Conversation

@rjp-coder

@rjp-coder rjp-coder commented Nov 18, 2026 •

Copy link
Copy Markdown

Part of STA-574, split into three PRs:

Closes STA-574.

When Vortex starts and the user isn't logged in, a modal now invites them to log in, following the Figma design. The login dialog itself is redesigned to match.

Shipped as an Unleash experiment, so we can measure whether they bring in more logins before deciding to keep them.

The experiment

Unleash flag vortex-sta-574-login-prompt splits installs into two cohorts:

test cohort (flag on) control cohort (flag off)
Startup login modal Shown Not shown
Login dialog from the header, Health Check and ensureLoggedIn New dialog, straight to the progress view Old dialog, old flow, unchanged
  • One cohort per session: the cohort is fixed the first time the user would see a difference: the startup check for the modal, a login click, or the login dialog opening. The modal, the dialog and the login event then all agree, even if flags arrive mid-session, and each login records the cohort it was made in. Fixing it is the only getFlag call, so Unleash counts one evaluation per session rather than one per re-render.
  • Flags not loaded yet: if the cohort is fixed before flags arrive, that session is control.
  • The code: it lives in nexus_integration/experiments/. See "Ending the experiment" below.

Before switching the flag on in production: merge #24991. Without it, a logged-out install falls back to Unleash's per-launch sessionId and would change cohort every launch. That PR also covers the Unleash setup.

The startup modal

  • Contents: an account pictogram, the copy from the Figma, and a "Don’t show this again" tickbox above "No, thanks" and "Log in to Vortex".
  • Closing it: the modal has no X, and Escape or a click outside does nothing. It only closes with an answer, "No, thanks" or "Log in to Vortex", so "Don't show this again" is never left undecided. The login dialog it hands over to keeps its X.
  • "Don't show this again": saved by either answer when ticked. The choice is stored with the suppressed notifications (settings.notifications.suppress["login-prompt"]), so Settings → Interface → "Reset suppressed notifications" brings it back.
  • Not shown when: the user is logged in, a forced-logout notice is already asking them to log in, or another dialog is open. That covers both registered dialogs and api.showDialog ones.
  • New pictogram: account, the Figma's variant of the web's user pictogram.

The new login dialog (test cohort)

  • Same id: it keeps the login-dialog id. Health Check, the classic header and ensureLoggedIn callers (nxm links, profiles, and extensions such as Stardew Valley and BepInEx) all open it, so it couldn't be deleted.
  • Three views:
    • Progress: the Figma progress view, shown while a login waits on the website, with the address to copy.
    • Log in with token: the token fallback. The Figma has no design for it, so it's built in the same style. A token that can't be read says so. A readable token whose login fails shows the real error.
    • Start: a start view for callers that open the dialog before a login has begun.
  • Closing it: the X or Escape cancels the login, as in the old dialog. A click outside is ignored, like the old dialog's static backdrop, so clicking Vortex to bring it forward mid-login doesn't cancel it.
  • No flash of the start view: login buttons no longer open the dialog first. It opens once the login is under way, so the header, the modal and Health Check go straight to the progress view.

Ending the experiment

  1. Delete nexus_integration/experiments/.
  2. Remove its call sites:
  3. In index.tsx, register the winning dialog as login-dialog.
  4. If the new dialog wins, also delete:
    • views/LoginDialog.tsx;
    • controls/CopyClipboardInput.tsx;
    • controls/PlaceholderTextArea.tsx;
    • vortex/dialog-login.scss, and its import in style.scss.
  5. To drop the cohort hash (Keep each install in one Unleash experiment cohort across launches (STA-574) #24991), delete unleash/experimentCohort.ts, its call in Application.ts, and the setter and property in unleash/client.ts.
  6. Remove the flag from flags.ts.

Not in this PR

  • The Figma's "Frame 4" variant: a "Cancel" button, and "full Vortex experience" in the title.
  • The copy icon sits beside the address box rather than inside it.
  • Two issues from review that predate this PR:
    • Vortex can start with no flags at all until its first fetch completes, which puts that session in control (client.ts).
    • Closing the login dialog clears whichever registered dialog is visible.

Testing

Unit tests cover:

  • the modal's buttons and tickbox rules;
  • the startup and cohort checks;
  • all three views of the new dialog;
  • the cohort dialog switch, and fixing the cohort for the session.

Typecheck and lint pass. E2E was not run.

Tested live in a dev build, before the experiment gate was added, so every launch got the new flow. Browser launches were blocked or simulated, so no real login took place.

Scenario master This PR
Open Vortex logged out No modal Login modal shows
Click "Log in to Vortex" in the modal n/a Modal closes, login dialog opens on the progress view
Click "Log in" in the header Old dialog New dialog, straight to the progress view, no start view first
Click "Login with token" Old token view New token view
Tick "Don’t show this again", answer, reopen n/a No modal
Answer "No, thanks" without ticking, reopen n/a Modal shows again
Press Escape on the modal n/a Nothing, and there's no X (unit tested only)

The cohort split was then tested live with the flag in the development Unleash environment:

  • control (flag off): no modal on a logged-out start. The header button opens the old dialog and old progress view, unchanged from master.
  • test (flag on): the modal, its "No, thanks" and tickbox rules, and the new dialog's progress and token views all behave as in the table above.

Open Logged Out Before
Open Logged Out After

Login Progress After

Log In With Token After

Control Cohort (Old Dialog, Unchanged)

🤖 Generated with Claude Code

@rjp-coder
rjp-coder requested a review from a team as a code owner November 18, 2026 16:51
@github-actions

Copy link
Copy Markdown

This PR has conflicts. You need to rebase the PR before it can be merged.

@rjp-coder rjp-coder changed the title Invite logged-out users to log in when Vortex starts, with a "Don't show this again" tickbox (STA-574) Invite logged-out users to log in, with a redesigned login dialog, as an Unleash experiment (STA-574) Nov 19, 2026
@github-actions

Copy link
Copy Markdown

This PR doesn't have conflicts anymore. It can be merged after all status checks have passed and it has been reviewed.

…Unleash experiment (STA-574)

The `vortex-sta-574-login-prompt` flag splits installs into `test` and
`control`. With the flag off, as in production until it's switched on,
everyone is `control` and nothing changes.

`test` gets:
- a startup modal for logged-out users, from the Figma, with "No, thanks",
  "Log in to Vortex" and a "Don't show this again" tickbox. It has no X and
  only closes with an answer; either answer saves the tickbox through the
  suppressed notifications.
- a redesigned `login-dialog` on every route (header, Health Check,
  `ensureLoggedIn`): the Figma progress view, a token fallback, and a start
  view. Login buttons no longer open it first, so it goes straight to the
  progress view; clicks outside it don't cancel the login.

`control` keeps the old dialog and flow. The cohort is fixed for the session
at the first decision the user would see, so the modal and the dialog agree
even if flags arrive late. Adds an `account` pictogram.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rjp-coder rjp-coder changed the title Invite logged-out users to log in, with a redesigned login dialog, as an Unleash experiment (STA-574) Invite logged-out users to log in with a new login dialog, behind an Unleash experiment (STA-574) Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant