Repository navigation
Cover leaving the login screen, and give firecms_cloud a test runner - #1048
Merged
Merged
Conversation
…ting `view_abandoned` shipped in d139c76 inline in the login view, where it could only be tested by standing up @firecms/ui and @firecms/core. It carries the funnel's largest number — 31.0% of login-screen visitors never clicked any sign-in method in May 2026, 42.4% in October, 41.4% in November — so it should not be the one piece of that flow with no test behind it. `useAbandonmentReporter` takes only React, so it can be covered directly. The view keeps what is genuinely its own, whether the terms box was ticked and how many times the gate stopped the visitor, and calls `markResolved` when a sign-in method is attempted. Behaviour is unchanged: the same two exits (`pagehide`, which fires on mobile where `beforeunload` does not, and unmount for in-app navigation), the same guards, the same params. The hook keeps reading the callback through a ref and subscribing on `[]`: hosts pass a fresh closure every render, and subscribing on its identity would run the cleanup — and so report an abandonment — on each one. Tests live in firecmsco/saas, whose suite already aliases @firecms/* to these sources and tests this package's contract for the same reason (see src/remote/lazy_export_contract.test.ts). Adding a runner here would mean new devDependencies and a pnpm-lock.yaml regeneration, which is a separate change. Verified: the saas app suite, which compiles this source, stays at 409 passing across 37 files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VZh1qoNGKbXQrrrFiDoeQ
fgatti675
force-pushed
the
test-login-abandonment
branch
from
November 17, 2026 12:20
a41b239 to
7e1cced
Compare
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.
view_abandonedshipped in d139c76 with no test behind it, on the screen that carries the funnel's largest number: 31.0% of login-screen visitors never clicked any sign-in method in May 2026, 42.4% in October, 41.4% in November. That is the metric the next decision about this screen will rest on, so the code producing it shouldn't be the one untested file in the flow.What changed
The reporting moves out of the view into
useAbandonmentReporter, which takes only React and so can be tested without standing up@firecms/uiand@firecms/core. The view keeps what is genuinely its own — whether the terms box was ticked, how many times the gate stopped the visitor — and callsmarkResolvedwhen a sign-in method is attempted.Behaviour is unchanged. Same two exits, same guards, same params.
Tests
Eight, covering both exits (
pagehidefor mobile, unmount for in-app navigation), silence once the visitor has done the thing, at most one report however the screen goes away, the elapsed seconds, and that the newest callback is the one called.One is a named regression: subscribing the effect to the callback identity would run its cleanup on every render and report an abandonment each time — and hosts do pass an inline closure,
SaasApp.tsxdoes. Reintroducing that bug fails that test and only that test:The runner
The package had no component runner, only
node --testover two files. This adds Jest configured exactly aspackages/uialready has it, takingsrc/**/*.spec.tsxso the two runners never collect each other's files.npm testnow runs both.Verified
node --test test/colors.test.tsstill passesfirecmsco/saasapp suite, which aliases@firecms/cloudto this source, stays at 409 passing across 37 filesGenerated by Claude Code