Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
superwall-docs-staging | 9354e07 | Commit Preview URL Branch Preview URL |
Apr 29 2026, 01:18 AM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9354e07cdb
ℹ️ 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".
|
|
||
| function parseSearchQueryFromUrl(pathname: string, hash: string): string { | ||
| const rawPath = `${pathname}${hash ? `/${hash.replace(/^#/, "")}` : ""}`; | ||
| const withoutDocsPrefix = rawPath.replace(/^\/?docs\/?/, ""); |
There was a problem hiding this comment.
Strip docs prefix only when it is a full path segment
The prefix removal in parseSearchQueryFromUrl uses rawPath.replace(/^\/?docs\/?/, ""), which also matches URLs whose first segment merely starts with docs (for example, /docs-as-code or /docsify/...). In those cases the generated query is truncated (-as-code, ify ...), so the 404 page suggests unrelated docs and pre-fills the search dialog with the wrong text. This should only remove /docs when it is an entire segment (e.g., followed by / or end-of-string).
Useful? React with 👍 / 👎.
Summary
Improve the docs 404 page so readers can recover with parsed search suggestions, a prefilled search dialog, and clearer links to SDK, Dashboard, and Support docs. Remove the unused Slack 404 reporting endpoint and generated route entries. The related docs preview now follows router location changes so repeated 404 navigation shows suggestions for the current URL.
Checks
bunx oxfmt --check src/components/not-found.tsxbun testbun run build:cfNote
Medium Risk
Adds new client-side search fetching and cross-component event handling on the 404 path, which could impact UX/perf or break if routing/search APIs change. Removal of
/api/404-reportis low-risk unless external tooling still calls it.Overview
Upgrades the docs
NotFoundexperience to help users recover: it derives a search query from the missing URL, fetches top related-doc suggestions (static index in prod //api/searchin dev), and adds clearer navigation CTAs plus quick links to key sections.Introduces a small client-side event bridge (
PREFILL_DOCS_SEARCH_EVENT) so the 404 page can open the global search dialog with the query prefilled, and updatesCustomSearchDialogto listen for that event and open itself; also switchesscheduleIdle’s fallback timers toglobalThis.Removes the unused
/api/404-reportSlack webhook endpoint and its generated TanStack Router entries (routeTree.gen.ts).Reviewed by Cursor Bugbot for commit 0095abf. Bugbot is set up for automated code reviews on this repo. Configure here.