Skip to main content

🔴 Release v2.486.0

⭐⭐⭐ Complex • 55 commits • 483 files changed
Hosted legal policies, advanced leaderboard controls, and challenge branding—letting admins host compliance pages on their own domain, fine-tune leaderboards with user exclusions and date windows, and customize answer colors to match their brand. Security hardening throughout. Major upgrade to Next.js 16.3.1 and E2E test infrastructure.

What’s New

  • Hosted Legal Policies – Admins host Terms, Privacy, and custom policies on a Nudj-managed domain; users access without login
  • Legal Policy Editor – Rich-text editor with live preview and HTML sanitization for safe content hosting
  • Challenge Answer Colors – Customize the color of answer choice areas to match community branding
  • Leaderboard User Exclusions – Exclude specific users from appearing on leaderboards
  • Time-Bound Leaderboard Exclusions – Set start and end dates for exclusion windows (seasonal events, competitive events, etc.)
  • Manual Leaderboard Reward Distribution – Toggle whether rewards auto-distribute or require manual admin approval
  • Social Handle Normalization – Improved parsing and validation of social media usernames across platforms
  • MultiPlusCard Configuration – Move payment gateway settings to centralized third-party config UI
  • Security and access-control hardening.

Admin Highlights

  • Hosted Legal Policies – Host your own Terms of Service, Privacy Policy, and custom legal pages on Nudj’s domain without third-party redirects; legal pages accessible to non-logged-in users
  • Rich Legal Editor – Full HTML sanitization and live preview when editing hosted legal content
  • Challenge Answer Branding – Customize answer choice colors in theme settings to match your brand’s visual identity
  • Leaderboard User Exclusions – Remove specific users from leaderboard rankings (e.g., internal testers, disqualified participants)
  • Exclusion Date Ranges – Set start/end dates on exclusions for temporary removal (seasonal resets, competitive-event fairness)
  • Manual Leaderboard Reward Distribution – Choose whether leaderboard rewards auto-distribute or wait for admin approval before awarding
  • MultiPlusCard Configuration – Manage payment integration settings in the centralized third-party config panel
  • Improved Chat Defaults – Admin chat now defaults to Claude Opus 5 for better reasoning
  • CSV Export Safety – Formula injection prevention in challenge statistics CSV exports
  • Confirm Dialog Persistence – Save failures no longer dismiss the dialog, letting admins retry immediately

User Highlights

  • Access Legal Pages Without Login – View Terms of Service and Privacy Policy without signing in
  • Branded Answer Choices – Question answer colors match your community’s theme for a polished look
  • Fair Leaderboard Competition – Admins can now exclude users during specific windows to ensure fair play
  • Social Profile Linking – Improved handling of social media handles when linking Instagram and TikTok profiles

Detailed Changes

User Exclusions & Date Ranges (NJ-1989, NJ-1990)

Leaderboard configs now support precise user exclusion control:
  • Exclude Users – Admins add a list of user IDs to exclude from leaderboard rankings
  • Time Windows – Each exclusion can have optional start/end dates (e.g., exclude from Jan 1–15 only)
  • Active Resolution – System compares current date/time to determine which exclusions apply
  • Audit Trail – Exclusion history viewable in leaderboard config editor
Use cases:
  • Exclude internal testing accounts permanently
  • Temporary fairness windows during competitive events
  • Seasonal resets that expire exclusions
  • Disqualified participant removal with explicit end date
Impact: More granular control over leaderboard integrity without database mutations.

Manual Reward Distribution Toggle (NJ-1954)

Admins can now choose whether leaderboard rewards auto-distribute or require approval:
  • Toggle Setting – New “Manual Distribution” checkbox in leaderboard config
  • Default Behavior – When enabled, rewards wait for admin approval before crediting
  • Distribution Interface – Admin can bulk-approve/reject pending rewards in leaderboard dashboard
Use case: High-stakes competitions where admins must verify leaderboard integrity before final reward payout.Impact: Flexibility for diverse reward strategies—auto-credit for casual leaderboards, approval-gated for official competitions.

Challenge Answer Color Customization (NJ-1995)

Theme settings now include a dedicated color picker for answer choice areas:
  • Color Editor – New “Answer Area Color” picker in Branding settings
  • Live Preview – Storybook fixtures show all question types with the selected color
  • Applied Across – Color applies to multiple-choice, rate-your-experience, select-from-list, and other choice-based questions
  • CSS Variable System – Uses CSS custom properties for easy theme switching
Visual coverage:
  • Multiple-choice options
  • Single-select buttons
  • Rating stars and scales
  • Date/time selectors
  • Prediction choices
Impact: Full brand consistency—answers now match your primary brand color instead of default gray.

MultiPlusCard Settings Relocation (NJ-1982)

MultiPlusCard login configuration moved from feature flags to the centralized third-party config panel:
  • Third-Party Tab – New “Third-Party Platform Config” section in Admin settings
  • MultiPlusCard Controls – Enable/disable MultiPlusCard login for the organisation
  • Environment Selection – Choose sandbox or production environment
  • Unified Interface – All payment/login integrations in one place (alongside OAuth, SSO, etc.)
Impact: Simpler payment gateway management—fewer tabs to navigate, clearer configuration UI.

Answer Choice Styling

All question types now respect the custom answer color from theme config:
  • Multiple-Choice – Button backgrounds use brand color
  • Rate-Your-Experience – Star colors match answer theme
  • Select-From-List – Option highlight color synchronized
  • Predictions – Choice backgrounds branded
  • Other Choices – Date, range, and image-selection controls all updated
Testing: Comprehensive Storybook stories validate contrast ratios and rendering across light/dark modes.

Reward Drawer Visual Fix (NJ-2091)

Fixed background bleed issue in parallax reward drawer:
  • Overflow Prevention – Container no longer bleeds beyond viewport during scroll
  • Parallax Smooth – Animation stays within bounds
Impact: Polished reward reveal experience—no layout jank on mobile.

Social Handle Normalization (NJ-1729)

Enhanced username parsing for Instagram, TikTok, and other social platforms:
  • Format Flexibility – Accept handles with or without @ prefix
  • URL Parsing – Extract username from profile URLs (e.g., instagram.com/username)
  • Validation – Character limits and allowed symbols per platform
  • Profile URL Builder – Automatically construct correct social profile URLs
Supported platforms:
  • Instagram (@username or URL)
  • TikTok (@username or URL)
  • Twitter/X (@handle)
  • YouTube (channel or custom URL)
  • Twitch (channel name)
Impact: Fewer errors when users link social accounts; better success rates on social actions.

Security Hardening: Org Membership Enforcement (NJ-2025)

Every admin API route now validates organisation membership:
  • Route Coverage – All /api/admin/* endpoints check organisationId cookie against user’s orgs
  • Test Suite – 679-line comprehensive test coverage for auth boundary violations
  • Scope Validation – Prevents cross-tenant data access even with valid tokens
Routes hardened:
  • Organisation settings endpoints
  • Cache clear operations
  • Chat context retrieval
  • File uploads
  • Preview deployment access
  • MCP tool availability checks
  • Widget preview rendering
Impact: Multi-tenant security hardened; no cross-org token exploitation possible.

GDPR Data Erasure (NJ-2016)

When admins initiate user data erasure, contactEmail field is now properly cleared:
  • Contact Email Cleanup – Email addresses removed alongside other PII on erasure
  • Backfill Migration – Historical erased users’ contact emails cleaned up
  • Service Layer – Dedicated email scrubbing utility for consistent erasure
Impact: Full GDPR compliance for contact information erasure.

Anonymous Reward Purchase Blocking (NJ-2054)

Users cannot purchase rewards while logged out:
  • Session Check – Purchase button disabled for anonymous users
  • Validation – Reward purchase API rejects unauthenticated requests
  • UX – Clear prompt to sign in before purchasing
Impact: Prevents accidental reward purchases from guest browsers; protects revenue integrity.

Blob Deletion Org Scoping (NJ-2023)

Image/file uploads now scoped to uploading organisation:
  • Org Validation – Blob deletion checks org ownership before removal
  • Security and access-control hardening.
Impact: Multi-tenant asset security; prevents accidental or malicious cross-org deletion.Request-auth-link flow now requires valid platform token:
  • Token Check – Endpoint validates platform token before issuing auth link
  • Prevents Brute Force – Limits auth link generation without valid credentials
Impact: Stronger rate-limiting on auth flows; prevents account enumeration attacks.

OAuth State Validation (NJ-2007)

Improved handling of malformed OAuth state parameters:
  • Graceful Degradation – Invalid state hints don’t cause login failure
  • Fallback Flow – Routes to standard OAuth flow if state parsing fails
Impact: Better resilience for OAuth flows from edge cases.

CSV Export Formula Injection Prevention (NJ-2019)

Challenge statistics CSV exports now escape formula characters:
  • Escaping – Leading =, +, @ characters prefixed with single quote
  • Prevents Malicious Cells – Excel/Sheets won’t execute embedded formulas
Impact: Safe data exports; no accidental macro execution in spreadsheets.

Confirm Dialog Persistence (NJ-2006)

Save-failure dialogs now stay open:
  • Retry UX – Users can immediately correct and resubmit without reopening dialog
  • Error Visibility – Error message remains visible during retry
Impact: Faster error recovery for admins; fewer navigation steps after validation failures.

Third-Party Config API Extensions

Admin and Integration APIs updated with new endpoints:
  • GET /third-party-config – Fetch all third-party platform settings
  • PATCH /third-party-config – Update MultiPlusCard, OAuth, SSO, legal policy configs
  • New DTOs: ThirdPartyPlatformConfigDtoModel, MultiPlusCardPlatformConfigDtoModel
Platform config schema extended for legal policy hosting:
  • LegalPlatformConfigDtoModel – Stores Terms, Privacy, and custom policy content
  • LegalPolicySourceEnumEXTERNAL_URL or HOSTED_ON_NUDJ
  • LegalPolicyTypeEnumTERMS, PRIVACY, CUSTOM
  • Content sanitized via sanitizeLegalPolicyContent() utility

Leaderboard Query Model Extensions

  • LeaderboardExclusionDtoModel – User ID + optional date range
  • LeaderboardConfigDtoModel.exclusions – Array of exclusion windows
  • LeaderboardConfigDtoModel.isManuallyDistributed – Boolean flag
  • resolveActiveExcludedUserIds() – Computes active exclusions by current date

Search & Pattern Functions

  • normalizeSocialHandle() – Utility for parsing social usernames
  • buildSocialProfileUrl() – Constructs canonical profile URLs per platform
Full test coverage – 243-line integration test suite for exclusion resolution logic.

Leaderboard Schema Migrations

  • 20260812154937_backfill_leaderboard_exclude_users.ts – Adds exclusion list to leaderboard configs
  • 20260812160000_reshape_leaderboard_exclude_users_to_windows.ts – Extends schema with date ranges
  • 20260812123456_backfill_leaderboard_is_manually_distributed.ts – Adds distribution toggle with default=false

GDPR Erasure Migration

  • 20260812120000_backfill_erased_user_contact_email.ts – Clears contact emails for previously erased users (87-line migration with test coverage)

All migrations include full test suites with rollback validation.

Test Foundation Reliability (NJ-1475, 3 commits)

Three-part improvement to test infrastructure:
  1. E2E Test Foundation – Fixed race conditions and timing issues in base test setup
  2. Admin Visible Controls – E2E tests now interact with rendered challenge controls instead of DOM manipulation
  3. E2E Results Reporting – Test runner now reports truthful outcomes without false negatives

Browser Automation Improvements

  • Removed polling fakes from visibility checks (isVisible({timeout}))
  • E2E tests now properly await DOM readiness before asserting rendered state
  • Shopify harness test reports upload correctly on green test runs
Impact: Flaky test suite eliminated; reliable CI signal for feature validation.

Next.js 16.3.1 Upgrade (NJ-2044)

All applications upgraded to Next.js 16.3.1 (from 16.3):
  • Performance – Latest rendering optimizations
  • Security – Latest framework patches
  • Compatibility – Apps and MCP server fully validated post-upgrade

CI/CD Improvements

  • Shopify harness reports now upload on green runs (NJ-2058)
  • A11y budget ratchet auto-populated from harvested data (NJ-2056)
  • Code review load-balanced across multiple reviewers (NJ-2066)
  • PR coverage specs integrated into smoke lane (NJ-2059)
  • Preview smoke lane now excludes package-only changes (NJ-2081)
  • Cancelled lint-and-test runs no longer report as failures (NJ-2060)
  • Linear-sync workflow retired; “Not Ready” label auto-applied to PRs (NJ-2085)

Chat Defaults

  • Admin chat now defaults to Claude Opus 5 (medium reasoning) for better inference

Documentation & Brand

  • Nudj corporate brand guidelines added to docs (fonts, colors, tone, logo usage)
  • Brand template pack created (deck templates, LinkedIn cards, email signatures, OG images)
  • Nudj brand skill added for on-brand design work

Error Logging Improvements

  • Stop logging tRPC request bodies on error (NJ-2017) – Prevents PII/secrets in logs
  • Nested extra fields scrubbed before error capture (NJ-2018) – Improved error context isolation
  • Excluded auth_accounts from parquet export (NJ-2020) – Prevents sensitive auth data in analytics

Documentation Security

  • Dev MongoDB URIs redacted from committed docs (NJ-2014)
  • Generated release notes auto-redact security details (NJ-2037)
  • High-risk code paths flagged in PR review (updated High-Risk Areas registry)

Apps Updated

User App

✓ Updated - Legal pages, answer branding, social handles, reward drawer, security

API

✓ Updated - Legal config, leaderboards, third-party settings, GDPR erasure

Admin

✓ Updated - Legal editor, leaderboard controls, answer colors, org membership enforcement

MCP Server

✓ Updated - Integration config, environment support

Games

— No changes

Packages

✓ Updated - Models, API client, design system, database

Contributors

dch@wenudj.comdch@wenudj.com19 commits • +4,752/-1,814 lines
erek_d@me.comerek_d@me.com18 commits • +12,894/-3,798 lines
solicshop@gmail.comsolicshop@gmail.com6 commits • +4,748/-161 lines
jamescockaynejamescockayne4 commits • +2,651/-136 lines
zuhayrk00@gmail.comzuhayrk00@gmail.com4 commits • +3,052/-542 lines
hienhang@hotmail.co.ukhienhang@hotmail.co.uk2 commits • +1,047/-233 lines
tomcarroll09@duck.comtomcarroll09@duck.com1 commit • +557/-0 lines

Release Stats


v2.486.0 deployed on August 18, 2026