> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Release v2.486.0

> Released August 18, 2026

## 🔴 Release v2.486.0

⭐⭐⭐ Complex • 55 commits • 483 files changed

<Note>
  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.
</Note>

## 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

<AccordionGroup>
  <Accordion title="Admin – Legal Policy Hosting & Configuration" icon="shield-check">
    ### Hosted Legal Policies (NJ-1860)

    Admins can now host legal policies (Terms, Privacy, etc.) on a Nudj-managed domain without external redirects:

    * **Admin Editor** – Legal Settings tab gains a UI for creating/editing hosted policies with rich-text editing
    * **HTML Sanitization** – Uploaded policy content is sanitized to prevent XSS and malicious scripts
    * **User Access** – Legal pages render on a public-facing route accessible without login
    * **Fallback Support** – Policies can fall back to external URLs if no hosted version is configured

    **How it works**:

    1. Org admin opens Legal Settings in Control Room
    2. Selects "Host on Nudj" for Terms, Privacy, or custom policies
    3. Enters HTML/rich-text content with live preview
    4. Content sanitized and stored in platform config
    5. Users see hosted pages at `yourapp.nudj.app/legal/terms` without authentication

    **Impact**: Reduce third-party domain redirects, improve trust with white-labeled legal compliance, maintain brand consistency.
  </Accordion>

  <Accordion title="Admin – Leaderboard Management Enhancements" icon="chart-bar">
    ### 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.
  </Accordion>

  <Accordion title="Admin – Branding & Customization" icon="palette">
    ### 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.
  </Accordion>

  <Accordion title="Admin – Third-Party Integration Configuration" icon="plug">
    ### 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.
  </Accordion>

  <Accordion title="User App – Legal Policies & Access" icon="file-lines">
    ### Public Legal Pages (NJ-1860)

    Security and access-control hardening.

    * **Route Structure** – `/legal/[policy]` (e.g., `/legal/terms`, `/legal/privacy`)
    * **No Login Required** – Accessible to anonymous users
    * **Fallback Support** – Missing pages can redirect to external URLs
    * **E2E Coverage** – Full test suite for page rendering, routing, and error states

    **User flow**:

    * Footer link to Terms/Privacy
    * No sign-in required
    * Page renders with proper layout and styling
    * External fallback if no hosted version configured

    **Impact**: Transparent legal compliance; users never blocked from reviewing terms before signup.
  </Accordion>

  <Accordion title="User App – Branding & Visuals" icon="sparkles">
    ### 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.
  </Accordion>

  <Accordion title="User App – Social Handle Improvements" icon="share-nodes">
    ### 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.
  </Accordion>

  <Accordion title="Compliance & Security" icon="lock">
    ### 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.

    ### Auth Link Platform Token Gating (NJ-2010)

    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.
  </Accordion>

  <Accordion title="Admin – Data Export & Error Handling" icon="download">
    ### 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.
  </Accordion>

  <Accordion title="API & Platform Services" icon="server">
    ### 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`

    ### Legal Policy Content Storage

    Platform config schema extended for legal policy hosting:

    * `LegalPlatformConfigDtoModel` – Stores Terms, Privacy, and custom policy content
    * `LegalPolicySourceEnum` – `EXTERNAL_URL` or `HOSTED_ON_NUDJ`
    * `LegalPolicyTypeEnum` – `TERMS`, `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.
  </Accordion>

  <Accordion title="Database Migrations" icon="database">
    ### 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.
  </Accordion>

  <Accordion title="E2E Test Infrastructure" icon="microscope">
    ### 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.
  </Accordion>

  <Accordion title="Infrastructure & DevOps" icon="cog">
    ### 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
  </Accordion>

  <Accordion title="Observability & Error Handling" icon="binoculars">
    ### 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)
  </Accordion>
</AccordionGroup>

## Apps Updated

<CardGroup cols={3}>
  <Card title="User App" icon="mobile">
    ✓ Updated - Legal pages, answer branding, social handles, reward drawer, security
  </Card>

  <Card title="API" icon="server">
    ✓ Updated - Legal config, leaderboards, third-party settings, GDPR erasure
  </Card>

  <Card title="Admin" icon="gear">
    ✓ Updated - Legal editor, leaderboard controls, answer colors, org membership enforcement
  </Card>

  <Card title="MCP Server" icon="robot">
    ✓ Updated - Integration config, environment support
  </Card>

  <Card title="Games" icon="gamepad">
    — No changes
  </Card>

  <Card title="Packages" icon="package">
    ✓ Updated - Models, API client, design system, database
  </Card>
</CardGroup>

## Contributors

<CardGroup cols={4}>
  <Card>
    <img src="https://github.com/dch@wenudj.com.png" alt="dch@wenudj.com" style={{borderRadius: '50%', width: 48}} />

    **[dch@wenudj.com](mailto:dch@wenudj.com)**

    19 commits • +4,752/-1,814 lines
  </Card>

  <Card>
    <img src="https://github.com/erek_d@me.com.png" alt="erek_d@me.com" style={{borderRadius: '50%', width: 48}} />

    **[erek\_d@me.com](mailto:erek_d@me.com)**

    18 commits • +12,894/-3,798 lines
  </Card>

  <Card>
    <img src="https://github.com/solicshop@gmail.com.png" alt="solicshop@gmail.com" style={{borderRadius: '50%', width: 48}} />

    **[solicshop@gmail.com](mailto:solicshop@gmail.com)**

    6 commits • +4,748/-161 lines
  </Card>

  <Card>
    <img src="https://github.com/jamescockayne.png" alt="jamescockayne" style={{borderRadius: '50%', width: 48}} />

    **jamescockayne**

    4 commits • +2,651/-136 lines
  </Card>

  <Card>
    <img src="https://github.com/zuhayrk00@gmail.com.png" alt="zuhayrk00@gmail.com" style={{borderRadius: '50%', width: 48}} />

    **[zuhayrk00@gmail.com](mailto:zuhayrk00@gmail.com)**

    4 commits • +3,052/-542 lines
  </Card>

  <Card>
    <img src="https://github.com/hienhang@hotmail.co.uk.png" alt="hienhang@hotmail.co.uk" style={{borderRadius: '50%', width: 48}} />

    **[hienhang@hotmail.co.uk](mailto:hienhang@hotmail.co.uk)**

    2 commits • +1,047/-233 lines
  </Card>

  <Card>
    <img src="https://github.com/tomcarroll09@duck.com.png" alt="tomcarroll09@duck.com" style={{borderRadius: '50%', width: 48}} />

    **[tomcarroll09@duck.com](mailto:tomcarroll09@duck.com)**

    1 commit • +557/-0 lines
  </Card>
</CardGroup>

## Release Stats

| Metric        | Value       |
| ------------- | ----------- |
| Total Commits | 55          |
| Lines Added   | +33,920     |
| Lines Removed | -6,520      |
| Files Changed | 483         |
| Size          | 🔴 Massive  |
| Complexity    | ⭐⭐⭐ Complex |

***

*v2.486.0 deployed on August 18, 2026*
