Repository navigation
fix(onboarding): one first-run card at a time, and the tunnel #2380 asked for - #2531
Conversation
The CodeQL block is a false positive — but it's the only thing redNoticed this while merging #2516/#2526/#2495. 21 pass, 3 skip, 1 fail: CodeQL — "2 new alerts including 2 high severity". Both are the same rule at the same idiom: Both are The rule is about an incomplete sanitizer standing between untrusted input and a browser. Here the input is a file read off disk in this repo and the output is a Two ways out, and the second is probably better than a dismissal:
Note the alerts are attached to the test file, not to Separately: |
…ket asked for (#2380) Four first-run surfaces landed on the Dashboard from four separate issues, none aware of the others: the hardening guide (#2380), the front desk (ent#319), the activation checklist (ent#238) and — since ent#437 folded the #2381 sign-in-email ask in with the usage-sharing consent — the finish-setup card. On a fresh marketplace install every predicate can be true at once, which put roughly 520px of chrome and four dismiss buttons above the product the operator installed Trinity for. ent#437 already collapsed what would have been a fifth card into an existing one; this caps what renders at one. Three changes, one shape: 1. The second hardening path is a Cloudflare Tunnel, not a VPN. #2380 recorded that swap on 2026-09-01 — a VPN reaches the same posture but breaks every inbound integration, since Telegram, WhatsApp, VoIP, public agent links, x402, inbound A2A and webhook triggers all call us, and only Slack survives on Socket Mode. PR #2431 merged a day later carrying the pre-decision copy, so AC #4 was never met. The copy now states the prerequisite (the domain has to be on Cloudflare), says outright that the tunnel needs the name and is therefore the second step rather than a different one, and names the half Trinity cannot perform: TUNNEL_TOKEN reaches .env and the tunnel starts under a compose profile, from the host. It deliberately carries no button, because no button here could finish the job. 2. The card face collapses to one action. Title, badge, one sentence, and `Add a domain` — the only step collectable in-app, and the completion condition that retires the card. Posture detail, both paths and the stacking sentence move behind a native <details>: keyboard-accessible, no JS, no state, and not a primitive the catalog covers. A first login should be actionable at a glance, not two columns of prose. 3. At most one card renders, ever. The four now sit in a `.onboarding-stack` wrapper under a single rule — `> * ~ * { display: none }`. Every card is v-if'd, so "the first element child" already means "the highest-priority card that wants to speak"; the gate needs no predicate lifted into Dashboard.vue, leaves each card's visibility where it lives today (its own store, its own localStorage dismissal), and makes dismissing the top card reveal the next one for free. DOM order is priority order. That also settles the spacing defect underneath all of this. Every card owned `mt-3` and nothing owned the gap below, so the last visible card's border sat flush against the pane — 0px in Timeline and worst in Grid, where a white card meets a white full-bleed surface. Each card now owns `mt-3 mb-3`; the wrapper carries no margin of its own so it collapses to a zero-height div when all four are silent. With only one card visible the "which element owns the gap" question does not arise. Verified in a browser against a live stack, with the four visibility predicates forced true: exactly one card paints in Timeline, Grid and List, in both themes; dismissing walks the whole stack in priority order — hardening guide, front desk, activation checklist, finish setup, then nothing — with a 12px gap under whichever card is showing and no phantom gap once all four are silent. The collapsed face carries exactly two buttons (`Add a domain` and dismiss), the disclosure is closed on load, its summary takes focus and toggles on Enter, and the rendered copy contains cloudflared / the tunnel profile / TUNNEL_TOKEN / the host-side step and no occurrence of Tailscale, VPN or WireGuard. Tests: onboardingStack.spec.js pins the rule, the priority order and both margins; hardeningGuide.spec.js gains a guard that fails if Tailscale or VPN returns, plus assertions for the tunnel prerequisite, the host-side step and the one-action face. Those copy assertions strip the SFC's HTML comments — which record the VPN the card no longer offers — to a FIXPOINT rather than in one pass: a single `replace(/<!--[\s\S]*?-->/g, '')` leaves a live `<!--` behind on nested input, which CodeQL flags as js/incomplete-multi-character-sanitization. Nothing untrusted reaches it (it reads a checked-in file), but the loop is both the rule's prescribed fix and the more correct strip. 84 files / 1835 tests pass; check:tokens clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01G3FfTmxVyfmLNWtAXxMSQ1
06f0eae to
8b69cb5
Compare
|
Confirmed fixed on All four call sites now route through One thing that is not yours and does not block this PR: Leaving the merge to you since you're actively pushing to it. |
vybe
left a comment
There was a problem hiding this comment.
Validated and approved.
The CSS gate holds. All four cards are single-root <div v-if> (HardeningGuide, FrontDeskPanel, ActivationChecklist, FinishSetupCard), so Vue 3 stamps the parent scope id on each root and .onboarding-stack > * ~ * actually reaches them — a fragment root anywhere in that list would have silently defeated it. A hidden card leaves a comment node, which ~ ignores, so the next card correctly becomes the first element child.
The copy's claims check out. TUNNEL_TOKEN is real (.env.example:445), cloudflared ships under profiles: [tunnel] in docker-compose.prod.yml:759-781, and gray-750 is a defined token (tailwind.config.js:25). The card points at levers that exist.
Tests execute — frontend-build runs npm run test:unit, and it's green with both new specs. e2e and guard also passed despite no ui label. CodeQL clear on 8b69cb52 as confirmed above.
Correctly not Closes #2380 — that issue's other ACs are unsettled, so it stays open by design.
Closes the unmet AC #4 on #2380. The provenance half of that issue shipped in #2431 (merged 2026-09-02); this is the copy and layout half it left behind. Deliberately not
Closes #2380— that issue carries several ACs and this PR does not settle all of them.What this changes
1. The second hardening path is a Cloudflare Tunnel, not a VPN.
#2380 recorded that swap in a comment on 2026-09-01. #2431 merged a day later carrying the pre-decision VPN/Tailscale copy, so the AC was never met. The rationale is the issue's own: a VPN reaches the same posture but breaks every inbound integration — Telegram, WhatsApp, VoIP, public agent links, x402, inbound A2A and webhook triggers all call us, and only Slack survives on Socket Mode.
The copy states the prerequisite (the domain has to be on Cloudflare), says outright that the tunnel needs the name and is therefore the second step rather than a different one, and names the half Trinity cannot perform:
TUNNEL_TOKENreaches.envand the tunnel starts under a compose profile, from the host. It carries no button on purpose — Trinity runs in a container with no host privileges, so no button here could finish the job. VPN remains a documented deployment mode indocs/DEPLOYMENT.md; it is removed from this card only.2. The card face collapses to one action.
Title, badge, one sentence, and
Add a domain— the only step collectable in-app, and the completion condition that retires the card. Posture detail, both paths and the stacking sentence move behind a native<details>: keyboard-accessible, no JS, no state, and not a primitive the catalog covers.3. At most one onboarding card renders, ever.
Four first-run surfaces landed on the Dashboard from four separate issues, none aware of the others: the hardening guide (#2380), the front desk (ent#319), the activation checklist (ent#238) and the finish-setup card (ent#437, which folds in #2381's sign-in-email ask). On a fresh marketplace install every predicate can be true at once — roughly 520px of chrome and four dismiss buttons above the product. ent#437 already collapsed what would have been a fifth card into an existing one; this caps what renders at one.
The gate is one CSS rule on a wrapper —
.onboarding-stack > * ~ * { display: none }— rather than av-ifchain. Every card is alreadyv-if'd, so "the first element child" means "the highest-priority card that currently wants to speak". A Vue-level chain would have to lift four visibility predicates intoDashboard.vue(they live in three Pinia stores plus component-locallocalStoragerefs) and would break "dismiss the top card, the next appears", because the hardening card's in-sessiondismissedref is not shared. DOM order is priority order.Spacing defect settled underneath. Every card owned
mt-3and nothing owned the gap below, so the last visible card's border sat flush against the pane — 0px in Timeline, worst in Grid where a white card meets a white full-bleed surface. Each card now ownsmt-3 mb-3; the wrapper carries no margin of its own, so it collapses to a zero-height div when all four are silent.Verification
Automated: 84 files / 1835 tests pass,
check:tokensclean.Driven in a real browser against a live stack with the four visibility predicates forced true:
.onboarding-stackmeasures 0px high).Add a domain, dismiss); the disclosure is closed on load, its summary takes focus and toggles on Enter.cloudflared, thetunnelcompose profile,TUNNEL_TOKENand the host-side step, and zero occurrences of Tailscale, VPN or WireGuard.action-primary-600in light and-500in dark.Note on overlap with #2516
While verifying, the hardening card would not render at all: both it and
AdminEmailNudgereadauthStore.userRole, which the auth store has never defined (the getter isrole). #2516 landed the same fix ondevabout an hour before this rebase, with a stronger repo-wideauthRoleGetterContract.spec.js, and replacedAdminEmailNudge.vuewithFinishSetupCard.vue. My own fix commit was dropped as superseded; this branch is rebased onto that work and the stack now wrapsFinishSetupCardas the fourth card.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3FfTmxVyfmLNWtAXxMSQ1