Skip to content

Push custom values (signup date, subscription, stages) to Lobbyside#3867

Merged
TropicolX merged 1 commit into
mainfrom
tropicolx/lobbyside-push-custom-values
Jun 4, 2026
Merged

Push custom values (signup date, subscription, stages) to Lobbyside#3867
TropicolX merged 1 commit into
mainfrom
tropicolx/lobbyside-push-custom-values

Conversation

@TropicolX

@TropicolX TropicolX commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Surfaces host-pushed custom columns on the Lobbyside live-visitor table for CodeCrafters, validating the new custom-values feature end-to-end in prod. The widget already encrypts any non-reserved setVisitor key into a custom column on the dashboard; this wires three derived fields through LobbysideWidgetComponent.syncVisitorData:

  • signed_up_dateuser.createdAt as an ISO calendar date (YYYY-MM-DD).
  • subscription_type — derived label with precedence lifetime → individual → team → vip → free.
  • stages_completed — sum of completedStageSlugs across the user's course participations.

stages_completed needs course-participations on the current-user payload (it wasn't in the include), so it's added to syncCurrentUser's includedResources (one flat collection, no nested expansion). The derivation is extracted into a pure, unit-tested lobbysideCustomFields helper, and the three fields are tracked in the did-update deps so a late-hydrating subscription/participation re-syncs the visitor stash.

Test plan

  • bun run lint is green (eslint / tsc / glint / prettier / template-lint all pass locally).
  • Run the unit suite in-browser: http://localhost:4200/tests?filter=lobbyside-widget — covers signup-date formatting, stage-slug summing, and subscription_type precedence/fallback.
  • Existing integration tests for the widget mount still pass (null-safe getters with the staff stub).
  • Live check: log in on prod, open the CodeCrafters Lobbyside dashboard live table, confirm signed_up_date, subscription_type, and stages_completed appear as columns + in the detail drawer, and that values render decrypted/correct.

Made with Cursor


Note

Low Risk
Third-party widget enrichment and a small addition to the current-user include list; no auth or payment logic changes.

Overview
Lobbyside live-visitor sync now sends three extra custom columns through setVisitor: signed_up_date (ISO date from createdAt), subscription_type (precedence lifetime → individual → team → vip → free), and stages_completed (total count of completed stage slugs across participations).

The values are computed in a new pure lobbysideCustomFields helper (with unit tests) and merged in syncVisitorData. The template did-update deps include each custom field so late-hydrating user/subscription/participation data triggers a re-sync. syncCurrentUser now includes course-participations in the current-user payload so stage counts are available when the widget runs.

Reviewed by Cursor Bugbot for commit 1b3a193. Bugbot is set up for automated code reviews on this repo. Configure here.

Surface host-pushed custom columns on the Lobbyside live-visitor table by
passing three derived fields through `setVisitor`:

- signed_up_date  — user.createdAt (ISO calendar date)
- subscription_type — lifetime > individual > team > vip > free
- stages_completed — summed completedStageSlugs across course participations

stages_completed needs course-participations on the current-user payload, so
add it to the syncCurrentUser include. Derivation is extracted to a pure,
unit-tested helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 640 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-array-push 39.17MB 640 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/chunk.*.js 640 bytes 3.44MB 0.02%

Files in assets/chunk.*.js:

  • ./services/authenticator.ts → Total Size: 6.91kB

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Test Results

  1 files  ±0    1 suites  ±0   8m 17s ⏱️ + 2m 6s
716 tests +5  653 ✅ +5  63 💤 ±0  0 ❌ ±0 
731 runs  +5  668 ✅ +5  63 💤 ±0  0 ❌ ±0 

Results for commit 1b3a193. ± Comparison against base commit a2898d7.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/lobbyside-widget/index.ts 93.75% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@TropicolX
TropicolX requested a review from rohitpaulk June 4, 2026 16:26
@TropicolX
TropicolX merged commit a5ab2f5 into main Jun 4, 2026
8 of 9 checks passed
@TropicolX
TropicolX deleted the tropicolx/lobbyside-push-custom-values branch June 4, 2026 18:37
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.

2 participants