Skip to content

Add a friendly glass 404 page with a puzzle - #283

Merged
HamptonMakes merged 2 commits into
mainfrom
hampton-friendly-404
Oct 28, 2026
Merged

HamptonMakes merged 2 commits into
mainfrom
hampton-friendly-404

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Why

Missing CoPlan documents can leave visitors with a blank page. Other missing routes show a generic error outside the app's layout.

What

Show a frosted-glass 404 message inside the regular CoPlan layout, with the existing header for navigation. A small puzzle-piece icon opens an optional tile-rotation game below the message.

How

Render HTML 404s through the engine and offer an optional host exceptions app for unmatched routes. Preserve HTTP 404 status, non-HTML error handling, signed-in navigation, and the viewer's theme. Keep a static fallback and add a preview to the demo library.

Risk

The shared controller now renders HTML for missing records and denied access. The host integration affects unmatched HTML routes; other error statuses keep Rails' public handling.

Testing

Opened http://localhost:3134/_/not-found in the in-app browser and checked the final layout. Inspected light, dark, and phone screenshots; the puzzle stays collapsed beneath the panel.

Light theme

Dark theme

Phone with puzzle expanded

Generated with Codex

@HamptonMakes
HamptonMakes marked this pull request as ready for review October 28, 2026 13:12
@HamptonMakes
HamptonMakes merged commit 702d090 into main Oct 28, 2026
15 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T13:16:56.159193Z 206e554 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HamptonMakes
HamptonMakes deleted the hampton-friendly-404 branch October 28, 2026 13:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 206e554893

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

def call(env)
request = ActionDispatch::Request.new(env)
if request.path_info == "/404" && request.format == Mime[:html]
ErrorsController.action(:not_found).call(env)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the engine mount prefix in host-wide 404s

When a host mounts CoPlan below a prefix such as /coplan, an unmatched host URL like /missing reaches this exceptions app without the engine mount having populated SCRIPT_NAME. Directly dispatching ErrorsController therefore makes the layout's engine route helpers generate /, /_/search, and similar unprefixed URLs, so the advertised signed-in navigation leaves the engine or returns more 404s. Pass the configured mount prefix into this dispatch or route the error through the mounted engine.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

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.

1 participant