Skip to content

Conversation

@softhack007
Copy link
Collaborator

@softhack007 softhack007 commented Nov 23, 2025

the page that exists where no page should exist

  • increases program size (flash) by 1KB
  • small fallback page (no easter egg) when building with -D WLEDMM_SAVE_FLASH, no size increase

Summary by CodeRabbit

  • New Features

    • Adds a compact 404 page with pixel-art and streamlined layout; server now serves either the compact or full 404 variant based on runtime conditions.
  • Style

    • Revamps the main 404 page: sets page language, refines typography and spacing, updates button styling, replaces the minimal notice with an engaging “Akemi’s Top 10 Mysteries” content section and disclaimer.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Walkthrough

Adds a compact 404 HTML asset, updates the main 404 page content and styling (including language attribute, typography, and a new "Akemi" mysteries list), registers the new asset in the UI generation list, and makes the server NotFound handler choose between mini and full 404 pages based on build-time macros.

Changes

Cohort / File(s) Summary
404 pages (content)
wled00/data/404.htm, wled00/data/404mini.htm
wled00/data/404.htm updated: adds lang="en", sets body font-size, adjusts list/button styles, replaces minimal 404 content with an intro paragraph, a large italic block, a header "Akemi's Top 10 Mysteries Worth Exploring:" and a left-aligned unordered list (11 items) with bolded titles and descriptions. wled00/data/404mini.htm added: compact standalone 404 HTML with embedded base64 PNG, inline CSS, heading/message and a "Back to controls" button.
UI asset registration
tools/cdata.js
Added PAGE_404_mini entry for 404mini.htm in the writeChunks data array, using gzip plus html-minify filter so the mini page is included in generated web UI assets.
Server routing/response
wled00/wled_server.cpp
NotFound handler now conditionally returns PAGE_404_mini when WLEDMM_SAVE_FLASH is defined or ARDUINO_ARCH_ESP32 is not defined; otherwise it returns PAGE_404. Response handling (headers/status) is unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    Note over Server: NotFound handler (build-time decision)
    Client->>Server: Request unknown path
    Server->>Server: Evaluate build-time flags\n(WLEDMM_SAVE_FLASH defined OR !ARDUINO_ARCH_ESP32)
    alt mini page condition true
        Server-->>Client: Respond with PAGE_404_mini (compact HTML)
    else
        Server-->>Client: Respond with PAGE_404 (full HTML with intro and mysteries list)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • Macro/conditional logic in wled00/wled_server.cpp.
    • Correctness of new PAGE_404_mini registration and filters in tools/cdata.js.
    • HTML validity, embedded image size and minification effects in wled00/data/404mini.htm, and content/formatting changes in wled00/data/404.htm.

Poem

🐇 I hopped through bytes and soft design,
Found pixel eyes and prose in line,
A tiny page to save the flash,
Or larger lists for curious cache,
Back to controls — a carrot sign.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title '404 mystery' directly corresponds to the main changes: adding custom 404 pages with thematic easter egg content and fallback variants.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 404_mystery

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efa7aa1 and 01cecb2.

📒 Files selected for processing (2)
  • wled00/data/404.htm (1 hunks)
  • wled00/data/404mini.htm (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
wled00/data/**/*.{htm,html,css,js}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

wled00/data/**/*.{htm,html,css,js}: Use tabs for indentation in web UI files (.htm/.html/.css/.js) under wled00/data
After editing web UI files, run npm run build to regenerate embedded headers
Manually validate web UI changes via local HTTP server and browser

Files:

  • wled00/data/404.htm
  • wled00/data/404mini.htm
wled00/data/**/*.{htm,html,js,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Check the browser console for JavaScript errors after web UI changes

Files:

  • wled00/data/404.htm
  • wled00/data/404mini.htm
🧠 Learnings (3)
📓 Common learnings
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 270
File: wled00/fcn_declare.h:403-406
Timestamp: 2025-10-22T21:59:24.331Z
Learning: In MoonModules/WLED-MM PR #270, the out-of-bounds null-terminator write in wled00/util.cpp (extractModeSlider) is deferred and tracked in Issue #272; do not address it within PR #270.
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/data/**/*.{htm,html,css,js} : Manually validate web UI changes via local HTTP server and browser

Applied to files:

  • wled00/data/404mini.htm
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/data/**/*.{htm,html,js,css} : Check the browser console for JavaScript errors after web UI changes

Applied to files:

  • wled00/data/404mini.htm
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: Builds (esp32_4MB_PSRAM_S)
  • GitHub Check: Builds (athom_music_esp32_4MB_M)
  • GitHub Check: Builds (adafruit_matrixportal_esp32s3_tinyUF2)
  • GitHub Check: Builds (esp32S3_16MB_PSRAM_M_HUB75)
  • GitHub Check: Builds (seeed_esp32c3_4MB_S)
  • GitHub Check: Builds (esp32S3_WROOM-2_M)
  • GitHub Check: Builds (esp32c3dev_4MB_M)
  • GitHub Check: Builds (esp32c3mini_dio_4MB_M)
  • GitHub Check: Builds (esp32c3dev_2MB_M)
  • GitHub Check: Builds (esp32S3_4MB_PSRAM_S)
  • GitHub Check: Builds (esp32S3_4MB_S)
  • GitHub Check: Builds (esp32S3_4MB_PSRAM_M)
  • GitHub Check: Builds (esp32S3_8MB_S)
  • GitHub Check: Builds (esp32S3_8MB_M)
  • GitHub Check: Builds (esp32_16MB_V4_M)
  • GitHub Check: Builds (esp32_4MB_V4_HUB75_forum)
  • GitHub Check: Builds (esp32_16MB_V4_S)
  • GitHub Check: Builds (esp32S3_16MB_PSRAM_M_HUB75)
  • GitHub Check: Builds (esp32S3_8MB_PSRAM_M)
🔇 Additional comments (3)
wled00/data/404.htm (1)

1-83: Reminder: Build and validate the web UI changes.

After modifying this file, ensure you:

  1. Run npm run build to regenerate embedded headers
  2. Manually validate via local HTTP server and browser
  3. Check the browser console for JavaScript errors

As per coding guidelines, these steps are required for all web UI file changes under wled00/data.

wled00/data/404mini.htm (2)

1-47: LGTM! Minimal 404 page implementation looks good.

The implementation is clean and appropriate for a minimal 404 page. The structure, styling, and content are straightforward.

Note: This file shares CSS and the base64 image with 404.htm. While this creates some duplication, it's acceptable for static HTML assets where both files need to be self-contained.


1-47: Reminder: Build and validate the web UI changes.

After adding this new file, ensure you:

  1. Run npm run build to regenerate embedded headers
  2. Manually validate via local HTTP server and browser
  3. Check the browser console for JavaScript errors

As per coding guidelines and retrieved learnings, these steps are required for all web UI file changes under wled00/data.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 202eb76 and 77f4455.

📒 Files selected for processing (1)
  • wled00/data/404.htm (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
wled00/data/**/*.{htm,html,css,js}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

wled00/data/**/*.{htm,html,css,js}: Use tabs for indentation in web UI files (.htm/.html/.css/.js) under wled00/data
After editing web UI files, run npm run build to regenerate embedded headers
Manually validate web UI changes via local HTTP server and browser

Files:

  • wled00/data/404.htm
wled00/data/**/*.{htm,html,js,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Check the browser console for JavaScript errors after web UI changes

Files:

  • wled00/data/404.htm
🧠 Learnings (4)
📓 Common learnings
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 270
File: wled00/fcn_declare.h:403-406
Timestamp: 2025-10-22T21:59:24.331Z
Learning: In MoonModules/WLED-MM PR #270, the out-of-bounds null-terminator write in wled00/util.cpp (extractModeSlider) is deferred and tracked in Issue #272; do not address it within PR #270.
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 289
File: wled00/data/404.htm:51-76
Timestamp: 2025-11-23T18:45:51.978Z
Learning: In wled00/data/404.htm, the heading "Top 10 Mysteries" intentionally lists 11 items—the count mismatch is a deliberate meta-joke and easter egg that fits the mystery theme of the 404 page.
📚 Learning: 2025-11-23T18:45:51.978Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 289
File: wled00/data/404.htm:51-76
Timestamp: 2025-11-23T18:45:51.978Z
Learning: In wled00/data/404.htm, the heading "Top 10 Mysteries" intentionally lists 11 items—the count mismatch is a deliberate meta-joke and easter egg that fits the mystery theme of the 404 page.

Applied to files:

  • wled00/data/404.htm
📚 Learning: 2025-10-22T21:59:24.331Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 270
File: wled00/fcn_declare.h:403-406
Timestamp: 2025-10-22T21:59:24.331Z
Learning: In MoonModules/WLED-MM PR #270, the out-of-bounds null-terminator write in wled00/util.cpp (extractModeSlider) is deferred and tracked in Issue #272; do not address it within PR #270.

Applied to files:

  • wled00/data/404.htm
📚 Learning: 2025-11-14T13:55:44.442Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-11-14T13:55:44.442Z
Learning: In MoonModules/WLED-MM, always flag Variable Length Arrays (VLA) during code reviews, especially when they could overflow available stack space (typically 2K-4K on ESP32/ESP8266). VLAs based on dynamic parameters like segment dimensions, particle counts, or pixel buffers should be highlighted and require justification from the author. Prefer fixed-size arrays, heap allocation, or bounded VLAs with explicit maximum size constraints.

Applied to files:

  • wled00/data/404.htm
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Builds (esp32S3_4MB_PSRAM_M)
  • GitHub Check: Builds (esp32_4MB_V4_S)
  • GitHub Check: Builds (esp32_4MB_V4_HUB75_forum)
  • GitHub Check: Builds (esp32c3dev_2MB_M)
  • GitHub Check: Builds (adafruit_matrixportal_esp32s3_tinyUF2)
  • GitHub Check: Builds (athom_music_esp32_4MB_M)
  • GitHub Check: Builds (esp32c3mini_dio_4MB_M)
  • GitHub Check: Builds (seeed_esp32c3_4MB_S)
  • GitHub Check: Builds (esp32s2_PSRAM_S)
  • GitHub Check: Builds (esp32S3_8MB_PSRAM_M)
  • GitHub Check: Builds (esp32S3_8MB_M)
  • GitHub Check: Builds (esp32S3_WROOM-2_M)
  • GitHub Check: Builds (esp32S3_16MB_PSRAM_M_HUB75)
  • GitHub Check: Builds (esp32S3_8MB_S)
  • GitHub Check: Builds (esp32S3_4MB_PSRAM_S)
  • GitHub Check: Builds (esp32S3_4MB_PSRAM_M)
  • GitHub Check: Builds (esp32_16MB_V4_S)
  • GitHub Check: Builds (esp32_16MB_V4_M)
  • GitHub Check: Builds (esp32_4MB_V4_S)
  • GitHub Check: Builds (esp32_4MB_V4_HUB75_forum)
🔇 Additional comments (3)
wled00/data/404.htm (3)

2-2: LGTM! Good accessibility improvement.

Adding the lang="en" attribute helps screen readers and improves the page's accessibility.


35-35: LGTM! Good CSS improvements.

Adding the sans-serif fallback (line 35) improves font rendering reliability, and simplifying 0px to 0 (line 39) follows CSS best practices.

Also applies to: 39-39


1-76: Remember to regenerate embedded headers after modifying web UI files.

After making changes to this HTML file, ensure you run npm run build to regenerate the embedded headers, and validate the changes via a local HTTP server and browser console.

As per coding guidelines for web UI files.

@softhack007 softhack007 merged commit 61ecefa into mdev Nov 23, 2025
57 checks passed
@softhack007 softhack007 deleted the 404_mystery branch November 23, 2025 20:40
@softhack007 softhack007 added this to the 14.7.1 milestone Dec 23, 2025
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