[codex] Fix user API environment toggle paths#145
Conversation
Deploying qf-api-docs with
|
| Latest commit: |
5fb2e95
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a74ce2a5.qf-api-docs.pages.dev |
| Branch Preview URL: | https://codex-fix-user-api-env-toggl.qf-api-docs.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 268abdce57
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Fixes the user-related API docs environment toggle so it correctly recognizes and maps equivalent pages even when Docusaurus routes include a trailing slash, aligning runtime routing behavior with stored doc metadata paths.
Changes:
- Normalize user-related doc paths (strip trailing slashes) before environment detection and route mapping.
- Make “equivalent doc exists” checks tolerant to both trailing-slash and non-trailing-slash variants.
- Add regression tests covering trailing-slash route inputs and trailing-slash entries in docs metadata.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/user-related-env-paths.test.cjs | Adds regression coverage for trailing-slash route inputs and normalized available-path extraction. |
| src/components/UserRelatedApiEnvironmentNotice/paths.js | Normalizes paths prior to environment detection/mapping and makes available-path checks slash-variant tolerant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Root Cause
Docusaurus serves docs with trailing slashes while the docs metadata used by the switcher stores paths without them. The environment toggle compared those strings directly, so equivalent pages could be treated as missing.
Validation
node --test tests\user-related-env-paths.test.cjsyarn test