Skip to content

feat(app): hidden CRT mode, unlocked by the secret code in preferences - #3704

Merged
jordan-simonovski merged 5 commits into
mainfrom
jordansimonovski/crt-mode-easter-egg
Nov 18, 2026
Merged

jordan-simonovski merged 5 commits into
mainfrom
jordansimonovski/crt-mode-easter-egg

Conversation

@jordan-simonovski

Copy link
Copy Markdown
Contributor

Summary

Adds a hidden CRT mode as an easter egg. Typing the Konami code with the Preferences modal open reveals a "CRT mode" switch, and turning it on makes the whole app look like an old CRT monitor.

  • Off by default, and the switch is not shown until the code is typed, so nothing changes for anyone who does not go looking.
  • While CRT mode is on the switch stays in Preferences, so it can always be turned off without the code.
  • The preference is stored with the other local user preferences. No API or schema change, and existing stored preferences are read as before.
  • The flicker, rolling band and unlock scene do not play under prefers-reduced-motion.
  • The effect is an overlay that never takes pointer events, so the app stays fully usable underneath.

Screenshots or video

Not attached: I could not upload images from the CLI. The unlock scene is an animation, so a short video is the better fit here.

Before After

How to reproduce

Starting point: yarn app:dev:local, then "Connect to Demo Server".

On main:

  1. Open the user menu and click "User preferences".
  2. Type the Konami code: Up, Up, Down, Down, Left, Right, Left, Right, B, A.
  3. Nothing happens.

On this branch:

  1. Open the user menu and click "User preferences".
  2. Type the Konami code. A short boot scene plays at the bottom of the modal, then a "CRT mode" switch appears.
  3. Turn the switch on. Scanlines, curved corners and a text glow cover the app.
  4. Close and reopen "User preferences". The switch is still there. Turn it off and the effect goes away.

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Click the element with data-testid user-menu-trigger, then user-preferences-menu-item.
  2. Confirm there is no element with data-testid crt-mode-switch.
  3. Press these keys in order: ArrowUp, ArrowUp, ArrowDown, ArrowDown, ArrowLeft, ArrowRight, ArrowLeft, ArrowRight, b, a.
  4. Wait 5 seconds, then click the element with data-testid crt-mode-switch.
  5. Verify an element with data-testid crt-overlay is present on the page.
  6. Click crt-mode-switch again and verify crt-overlay is gone.

@jordan-simonovski
jordan-simonovski requested a review from a team as a code owner November 18, 2026 03:22
@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a6d7ba6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 18, 2026 4:24am UTC
hyperdx-storybook Ready Ready Preview Nov 18, 2026 4:24am UTC

Request Review

@github-actions github-actions Bot added the review/tier-3 Standard — full human review required label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 478 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 8
  • Production lines changed: 478 (+ 133 in test files, excluded from tier calculation)
  • Branch: jordansimonovski/crt-mode-easter-egg
  • Author: jordan-simonovski

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 106 in total (1.13%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 476 passed • 1 skipped • 1030s

Status Count
✅ Passed 476
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

label="CRT mode"
description="Make the screen look like an old CRT monitor"
>
<Switch

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.

🟡 P2 — The CRT mode switch has no accessible name

SettingContainer renders "CRT mode" as plain text in a sibling div that is not linked to the Switch, so a screen reader announces only "switch, off". Give the switch a name: pass aria-label="CRT mode", or use the Switch's own label prop.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 P0/P1 · 🟡 1 P2 · 🔵 1 P3

None could be anchored to changed lines; they are listed below. 1 P3 folded at the bottom.

Findings outside the changed lines

  • 🟡 P2 packages/app/src/components/CrtUnlockReveal.module.scss:332 — The modal shrinks and the switch moves when the unlock scene unmounts, mid power-on → The scene and content share one grid cell. During the scene, the row is as tall as the scene: about 110px for three 0.85rem×1.6 lines, the bar and the padding, compared with about 40px for the setting. setPlaying(false) runs at about 3.45s, just as the power-on animation starts at 3.4s. The modal then loses about 70px of height and the switch jumps while it is powering on. Pin the cell to the content's height instead, for example by making the scene position: absolute; inset: 0 inside a position: relative root, so removing the scene does not change layout.
🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/UserPreferencesModal.tsx:71 — The Konami keydown listener stays on window for the whole session, even while Preferences is closed → AppNav keeps UserPreferencesModal mounted (packages/app/src/components/AppNav/AppNav.tsx:604), so useKonamiCode buffers every keystroke on every page. The opened check only happens inside the callback, which is a contract hidden from the hook. Add an enabled argument to useKonamiCode and skip addEventListener when it is false. Then call useKonamiCode(onUnlock, opened) so the listener only exists while the modal is open.

Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. This is an off-by-default cosmetic easter egg: the new crtMode preference is an optional field on the existing UserPreferences store (migration-safe, round-trips correctly), the overlay is pointer-events: none so the app stays usable underneath, animations are gated behind prefers-reduced-motion, and the switch is rendered unconditionally so it still appears even if the unlock animation never completes. No P0/P1 issues.

🟡 P2 -- recommended

  • packages/app/src/components/CrtUnlockReveal.tsx:1 -- The boot-scene completion path (onAnimationEnd collapse detection driving setPlaying(false)) and its prefers-reduced-motion branch have no test coverage, despite being the only logic that unmounts the scene.
    • Fix: Add a test that renders CrtUnlockReveal, fires the collapse animationend on the scene element, and asserts the scene (crt-unlock-scene) unmounts while the child switch remains.
🔵 P3 nitpicks (4)
  • packages/app/src/components/CrtUnlockReveal.tsx:30 -- e.animationName.includes('collapse') couples scene teardown to the CSS-module keyframe name still containing the literal collapse; if the build hashes keyframe names without preserving it, the scene never unmounts and leaves hidden nodes behind (switch still works).
    • Fix: Derive the matched keyframe name from the imported styles object instead of a hard-coded substring, or assert the coupling with a test.
  • packages/app/src/components/CrtUnlockReveal.module.scss:113 -- Under prefers-reduced-motion, .scene/.flash are set to display: none, so their animations never fire animationend and setPlaying(false) is never called, leaving the hidden scene/flash nodes mounted until the modal closes.
    • Fix: Flip playing to false immediately when reduced motion is active (e.g. via a matchMedia check) so the scene subtree unmounts.
  • packages/app/src/hooks/useKonamiCode.ts:30 -- The window keydown listener is active for the entire app lifetime while the modal is mounted, and the buffer comparison uses comma-joined .join(), so a literal , keypress shifts the buffer alignment; neither is exploitable but both are avoidable fragility.
    • Fix: Compare the buffer with an index-wise equality over the key array rather than a comma-joined string, and document that the listener is intentionally global.
  • .changeset/user-preferences-addition.md:5 -- The changeset body "feat: small addition to user preferences" does not describe the actual change (hidden CRT mode) and will produce an uninformative changelog entry.
    • Fix: Rewrite the changeset body to describe the CRT-mode feature concretely.

Reviewers (8): correctness, testing, maintainability, project-standards, agent-native, kieran-typescript, julik-frontend-races, adversarial.

Testing gaps:

  • CrtUnlockReveal scene-completion and prefers-reduced-motion paths are untested.
  • The _app.tsx conditional mount of CrtOverlay based on crtMode is exercised only indirectly.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@jordan-simonovski jordan-simonovski changed the title feat(app): hidden CRT mode, unlocked by the Konami code in preferences feat(app): hidden CRT mode, unlocked by the secret code in preferences Nov 18, 2026
pointer-events: none;
background: #fff;
opacity: 0;
animation: flash 0.6s ease-out;

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.

🟡 P2 — The position: fixed flash is probably clipped to the modal instead of covering the viewport

.flash renders inside the Mantine Modal content. Mantine's Transition normally keeps its in styles applied after the modal has opened, and the default modal transition sets a transform (likely translateY(0)). Any non-none transform makes the modal content the containing block for fixed-position children, and that content has overflow-y: auto, so inset: 0 would size the flash to the modal and clip it there. I couldn't confirm this for Mantine v9 because node_modules isn't installed here, so check it in a browser. If it holds, render the flash with Mantine Portal (or createPortal to document.body) so it covers the screen as intended.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Name the switch for screen readers, keep it visible after CRT mode is
turned off, and render the unlock flash outside the modal so it covers
the viewport. Adds tests for turning the mode off and for the overlay's
class on <html>.
@jordan-simonovski
jordan-simonovski merged commit 1556317 into main Nov 18, 2026
29 checks passed
@jordan-simonovski
jordan-simonovski deleted the jordansimonovski/crt-mode-easter-egg branch November 18, 2026 05:25

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — a6d7ba60 Deployed Nov 18, 2026 by vercel[bot]
Preview – hyperdx-storybook — a6d7ba60 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants