[docs] fix mintlify parse error in de/dashboard.mdx#229
Conversation
The German translation in #228 added inner „..." quotation marks inside `<Tab title="…">` attributes, which broke MDX parsing — the inner straight `"` ended the attribute value and the trailing `"` produced `Unexpected character "`. Drop the inner quotes to match how every other locale renders the tab labels and unblock the docs CI job on main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughA malformed JSX attribute quoting issue in German dashboard tab titles was fixed by removing inner quotation marks, and a changelog entry was added to document the fix. No logic or structural changes were made. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Line 6: The changelog entry "Fix `mintlify validate` failing on
`docs/de/dashboard.mdx` after `#228` added German „...\" quotation marks inside
two `<Tab title=\"…\">` attributes — the inner straight `\"` ended the JSX
attribute value, then the leftover `\"` produced an `Unexpected character \"`
parse error. Drop the inner quotes (matching how every other locale renders the
tab labels) so the docs CI job passes again." is missing the PR number; append
the PR number in parentheses at the end of that single-line entry (e.g., add "
(#<PR_NUMBER>)") so the entry follows the required format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f764b5c-fa5d-4c8d-9801-cdec7bb5bc32
📒 Files selected for processing (2)
CHANGELOG.mddocs/de/dashboard.mdx
| ## Unreleased | ||
|
|
||
| ### Fixes | ||
| - Fix `mintlify validate` failing on `docs/de/dashboard.mdx` after #228 added German „..." quotation marks inside two `<Tab title="…">` attributes — the inner straight `"` ended the JSX attribute value, then the leftover `"` produced an `Unexpected character "` parse error. Drop the inner quotes (matching how every other locale renders the tab labels) so the docs CI job passes again. |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Append PR number to the changelog entry.
The entry is missing the PR number. As per coding guidelines, each changelog entry should end with the PR number in parentheses.
📝 Proposed fix to add PR number
-- Fix `mintlify validate` failing on `docs/de/dashboard.mdx` after `#228` added German „..." quotation marks inside two `<Tab title="…">` attributes — the inner straight `"` ended the JSX attribute value, then the leftover `"` produced an `Unexpected character "` parse error. Drop the inner quotes (matching how every other locale renders the tab labels) so the docs CI job passes again.
+- Fix `mintlify validate` failing on `docs/de/dashboard.mdx` after `#228` added German „..." quotation marks inside two `<Tab title="…">` attributes — the inner straight `"` ended the JSX attribute value, then the leftover `"` produced an `Unexpected character "` parse error. Drop the inner quotes (matching how every other locale renders the tab labels) so the docs CI job passes again (`#229`).As per coding guidelines: Each changelog entry should be a single line: short description followed by PR number (e.g., - Add foo support (#123)).
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Fix `mintlify validate` failing on `docs/de/dashboard.mdx` after #228 added German „..." quotation marks inside two `<Tab title="…">` attributes — the inner straight `"` ended the JSX attribute value, then the leftover `"` produced an `Unexpected character "` parse error. Drop the inner quotes (matching how every other locale renders the tab labels) so the docs CI job passes again. | |
| - Fix `mintlify validate` failing on `docs/de/dashboard.mdx` after `#228` added German „..." quotation marks inside two `<Tab title="…">` attributes — the inner straight `"` ended the JSX attribute value, then the leftover `"` produced an `Unexpected character "` parse error. Drop the inner quotes (matching how every other locale renders the tab labels) so the docs CI job passes again (`#229`). |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` at line 6, The changelog entry "Fix `mintlify validate` failing
on `docs/de/dashboard.mdx` after `#228` added German „...\" quotation marks inside
two `<Tab title=\"…\">` attributes — the inner straight `\"` ended the JSX
attribute value, then the leftover `\"` produced an `Unexpected character \"`
parse error. Drop the inner quotes (matching how every other locale renders the
tab labels) so the docs CI job passes again." is missing the PR number; append
the PR number in parentheses at the end of that single-line entry (e.g., add "
(#<PR_NUMBER>)") so the entry follows the required format.
* [hooks] decouple hook chain from clsx/tailwind
The hook handler (`src/hooks/handler.ts`) was transitively pulling in
`lib/utils.ts` via:
handler.ts
-> resolve-permission-mode.ts
-> lib/codex-sessions.ts
-> lib/log-entries.ts
-> lib/utils.ts (imports clsx + tailwind-merge)
`lib/utils.ts` is the dashboard's shadcn `cn()` helper — it has no business
on the runtime path of a CLI hook. The only thing the hook chain actually
needed from it was `formatDate`, an `Intl.DateTimeFormat` wrapper with no
third-party deps.
When a Claude Code session opened a clone of this repo whose
`$CLAUDE_PROJECT_DIR` resolved into an ancestor that shadowed bun's global
install cache (e.g. `/home/nivedit/prs/failproofai-231/`, with `node_modules`
missing locally but `/home/nivedit/node_modules` present and clsx-less),
every hook event crashed with:
ResolveMessage: Cannot find package 'clsx' from .../lib/utils.ts
Move `formatDate` into a dedicated `lib/format-date.ts` and update the four
server-side and three dashboard callers. `lib/utils.ts` now only exports
`cn` so the hook handler no longer transitively requires `clsx`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* [changelog] condense unreleased entries to one-liners
Per CodeRabbit feedback on #231: each CHANGELOG entry should be a single
line ending in its PR number. Tag mintlify-de and block-read-outside-cwd
fixes with their actual merged PRs (#229, #230) instead of #231.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps package.json from 0.0.9 to 0.0.9-beta.2 and rolls the ## Unreleased changelog section into ## 0.0.9 — 2026-04-28. Adds since v0.0.9-beta.1: Features: - Show OpenAI Codex projects on the /projects page alongside Claude Code projects, with CLI badges per row and per session; /project/[name] is Codex-aware and the session viewer renders the CLI badge beside the Session Log header (#232) Fixes: - mintlify validate parse error in docs/de/dashboard.mdx (#229) - block-read-outside-cwd false-deny on globs and -v host:/path (#230) - decouple hook chain from clsx/tailwind via lib/format-date.ts (#231) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Promotes the version from 0.0.9-beta.3 to 0.0.9 stable. The ## 0.0.9 — 2026-04-28 changelog section is already up to date with the contents below; no CHANGELOG churn required. 0.0.9 contents: Features: - OpenAI Codex hook integration via `failproofai policies --install --cli codex` (or --cli claude codex for both); supports all six Codex hook events, PermissionRequest wired through policy-evaluator, per-CLI telemetry tagging, interactive arrow-key CLI selector when both agents detected (#220, #222, #223) - Activity dashboard CLI filter alongside event-type, policy, and session-id filters; Codex sessions in the activity feed are now clickable, with the existing log viewer rendering Codex transcripts via lib/codex-sessions.ts (#226) - Surface Slack community link in CLI banner and Reach Us menu (#225) - Show OpenAI Codex projects on the /projects page alongside Claude Code projects, with CLI badges per row and per session; /project/[name] is Codex-aware and the session viewer renders the CLI badge beside the Session Log header (#232) Fixes: - Trailing blank line after enabled-policies summary in install output (#224) - Resolve hook bin via $CLAUDE_PROJECT_DIR (was relative path) (#219) - Mintlify validation of Arabic built-in-policies docs - Mintlify parse error in docs/de/dashboard.mdx (#229) - block-read-outside-cwd false-deny on globs and -v host:/path (#230) - Decouple hook chain from clsx/tailwind via lib/format-date.ts (#231) Docs: - Bump built-in policy count from 32 to 39 in README and translations (#207) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* [docs] sanitize JSX attribute quotes in auto-translated MDX The German translator periodically emits `<Tab title="Tab „Richtlinien"">` where it intends `„…"` typographic quotes but uses ASCII `"` for the closing — the inner straight `"` terminates the JSX attribute and the real attribute close becomes a stray `"` before `>`, which trips `mintlify validate` with `Unexpected character "`. PR #229 fixed this once by hand on `docs/de/dashboard.mdx`. The next auto-translation run regenerated the same broken markup, so the same parse error landed on `main` again after #246. Make it stick: - `scripts/translate-docs/mdx-translator.ts` adds `sanitizeJsxAttributes`, which strips stray trailing ASCII `"` after a JSX attribute close and drops unmatched typographic opening quotes (`„`, `"`, `«`, `‹`, `「`, `『`) inside the same value. Matched pairs (e.g. `「ポリシー」`) are preserved. Wired into `translateMdxPage` ahead of `rewriteInternalLinks`. - `scripts/translate-docs/translator.ts` extends rule #2 of the system prompt to forbid ASCII `"` inside JSX attribute values entirely, so the LLM is less likely to produce the pattern in the first place. - `__tests__/scripts/translate-docs/mdx-translator.test.ts` covers the exact `de/dashboard.mdx` failure plus self-close, multi-attribute, matched typographic pairs, empty-value, and multiple-on-one-line cases. - `docs/de/dashboard.mdx` drops the inner German quotes from the two `<Tab title>` attributes (mirrors #229) so CI on `main` goes green immediately rather than waiting for the next translation cycle. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * [docs] address CodeRabbit review on sanitizeJsxAttributes Two findings on PR #247: 1. mdx-translator.ts:50 — `cleaned.split(open).join("")` removed *every* occurrence of an opener when `opens > closes`, so a value containing one matched typographic pair plus one stray opener (e.g. `„Foo“ und „Bar`) lost the matched pair too. Fix: drop only the surplus = opens - closes openers, scanning from the right with `lastIndexOf` so the leftmost matched pair is preserved. 2. mdx-translator.test.ts — add a regression test for that mixed case (one matched „…“ pair + one dangling „) so the bug above can't recur. Also drop the English curly “…” pair from the openings list. U+201C is both the German closer and the English-curly opener, so processing the English pair after the German pair would strip the very German closer we just preserved. The remaining pairs (German, French ×2, Japanese ×2) all have unambiguous openers. 1177 unit tests pass (was 1176 — the new mixed-case test is the +1). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
<Tab title="…">attributes indocs/de/dashboard.mdxso MDX parsing succeeds.title="Tab „Richtlinien""andtitle="Tab „Aktivität"". The inner straight"closes the JSX attribute, leaving a stray"before>that mintlify reports asUnexpected character "(parse error atde/dashboard.mdx:65:32). Every other locale leaves the tab label without inner quotes, so this matches them.docsjob onmain(run 25084614625).Test plan
mint validate) passes on this branch🤖 Generated with Claude Code
Summary by CodeRabbit