Skip to content

fix(onboarding): one first-run card at a time, and the tunnel #2380 asked for - #2531

Merged
vybe merged 1 commit into
devfrom
feature/2380-hardening-card-ux
Sep 4, 2026
Merged

vybe merged 1 commit into
devfrom
feature/2380-hardening-card-ux

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

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_TOKEN reaches .env and 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 in docs/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 a v-if chain. Every card is already v-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 into Dashboard.vue (they live in three Pinia stores plus component-local localStorage refs) and would break "dismiss the top card, the next appears", because the hardening card's in-session dismissed ref is not shared. DOM order is priority order.

Spacing defect settled underneath. 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, 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.

Verification

Automated: 84 files / 1835 tests pass, check:tokens clean.

Driven in a real 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 → nothing.
  • 12px gap under whichever card is showing, in all three modes; no phantom gap once all four are silent (.onboarding-stack measures 0px high).
  • Collapsed face carries exactly two buttons (Add a domain, dismiss); the disclosure is closed on load, its summary takes focus and toggles on Enter.
  • Rendered copy contains cloudflared, the tunnel compose profile, TUNNEL_TOKEN and the host-side step, and zero occurrences of Tailscale, VPN or WireGuard.
  • Summary link resolves to action-primary-600 in light and -500 in dark.

Note on overlap with #2516

While verifying, the hardening card would not render at all: both it and AdminEmailNudge read authStore.userRole, which the auth store has never defined (the getter is role). #2516 landed the same fix on dev about an hour before this rebase, with a stronger repo-wide authRoleGetterContract.spec.js, and replaced AdminEmailNudge.vue with FinishSetupCard.vue. My own fix commit was dropped as superseded; this branch is rebased onto that work and the stack now wraps FinishSetupCard as the fourth card.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G3FfTmxVyfmLNWtAXxMSQ1

@vybe

vybe commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The CodeQL block is a false positive — but it's the only thing red

Noticed 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:

js/incomplete-multi-character-sanitization
  src/frontend/tests/unit/hardeningGuide.spec.js:325
  src/frontend/tests/unit/hardeningGuide.spec.js:334

Both are GUIDE_SFC.replace(/<!--[\s\S]*?-->/g, '') — stripping HTML comments out of the guide's own SFC source so the prose assertions don't match commented-out copy.

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 toMatch assertion, so there is no sanitization boundary to be incomplete: a comment-stripper that misses a nested or malformed comment makes a test wrong, not a page injectable. Worth stating explicitly because "2 high severity" on a 7-file onboarding PR reads much worse than it is.

Two ways out, and the second is probably better than a dismissal:

  1. Dismiss both as used in tests — accurate, and it keeps the test reading naturally.
  2. Drop the regex entirely. Both call sites only need "is this string present in the rendered prose", and the comments you are excluding are your own — so asserting against the SFC's <template> block (or matching a comment-free extraction once, in a named helper) removes the flagged pattern instead of annotating it, and won't re-fire when someone copies the idiom into a third test.

Note the alerts are attached to the test file, not to HardeningGuide.vue, so neither the shipped component nor the #2380 copy change is implicated.

Separately: Closes #2380 being deliberately absent is the right call given the issue carries several ACs — just flagging that #2380 will therefore stay in its current status after this merges, so it needs a manual label move if AC #4 was the last one open.

…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
@obasilakis
obasilakis force-pushed the feature/2380-hardening-card-ux branch from 06f0eae to 8b69cb5 Compare September 4, 2026 13:59
@vybe

vybe commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Confirmed fixed on 8b69cb52 — and you took the better of the two options.

All four call sites now route through withoutComments(), no inline replace(/<!--…/g) left in the file, and the fixpoint loop is genuinely more correct than what it replaces (<!--<!-- --> no longer leaves a live <!-- behind). CodeQL is clear and the run is green so far — 10 pass, 10 pending, 0 fail.

One thing that is not yours and does not block this PR: src/frontend/tests/unit/portalAgentBubble.spec.js:27 still carries the original inline idiom. CodeQL won't flag it — it isn't new code in any open diff — but it is where the pattern gets copied from, which is exactly the case a per-alert dismissal wouldn't have covered. Worth pointing the same helper at it whenever that file is next touched; not worth a PR of its own.

Leaving the merge to you since you're actively pushing to it.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@vybe
vybe merged commit a5ac3cf into dev Sep 4, 2026
25 checks passed
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.

3 participants