Repository navigation
Add a friendly glass 404 page with a puzzle - #283
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
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-foundin the in-app browser and checked the final layout. Inspected light, dark, and phone screenshots; the puzzle stays collapsed beneath the panel.Generated with Codex