refactor(gui): split ClaudeCode and ApiKeys for react-doctor#470
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR decomposes API key and Claude Code pages into reusable panels and sections, adds shared endpoint, sidecar, state, and JSON-response helpers, improves API failure handling and state preservation, expands localization, and adds focused UI, unit, and timing tests. ChangesAPI key management
Claude Code configuration
Shared helpers and test stability
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Rebase onto upstream/dev and re-apply the react-doctor module split against current stacked pages, including API key load/create/delete failure UI state.
64068cc to
d0d03be
Compare
|
Rebased onto Fixed
Skipped (already in #466 / not in this PR diff): CodeRabbit notes on Commit: |
atomicWriteFile runs icacls on win32; two transitions under CI load exceeded bun's 5s default.
Keep keys, endpoints, and Claude setting on non-OK /api/keys responses so a create/delete follow-up refresh cannot wipe the visible list.
Fix: preserve last-good API keys on refresh failure
Verification
Commit: |
…#470 review notes Gate raw-byte pacing in the progress-stream test so Windows CI scheduler jitter cannot invent a false inactivity stall. Also surface ClaudeCode server errors, localize the alias Other bucket, label compact windows above 1M correctly, and restore navigator.language in API-keys tests.
Allow the M unit for compact-window labels, keep off-ladder values from colliding with 1M, and collapse empty Auto sidecar overrides to inherit so they match management API persistence.
Empty Auto was collapsing to Inherit before a model could be entered.
Keep Auto in memory with an enabled model input, and only persist
{ backend: null, model } when the trimmed model is non-empty.
Harden JSON helpers and sidecar serialize/trimming, localize compact million labels via Intl, and add fetch/save regression coverage.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
gui/src/intl-formatters.ts (1)
30-30:⚠️ Potential issue | 🟡 MinorKeep display markers in the i18n layer.
The hardcoded em dash and
~bypass the selected locale when rendered byCodexAccountPool.tsxandLogs.tsx. Provide localized fallback/approximation text or a locale-aware wrapper instead of embedding these user-visible markers in the formatter. This also leaves the earlierformatEstimatedUsdValuelocalization finding unresolved.As per path instructions, files under
gui/**must route user-visible strings through i18n locale files rather than hardcoded text.Also applies to: 36-43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gui/src/intl-formatters.ts` at line 30, The date formatter and formatEstimatedUsdValue still hardcode user-visible fallback and approximation markers, bypassing localization in CodexAccountPool.tsx and Logs.tsx. Update these formatter APIs to use the selected locale’s i18n messages for invalid-date fallback and estimated-value text, and route the localized values through the existing callers instead of embedding em dash or tilde characters. Preserve the current formatting behavior for valid, non-estimated values.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@gui/src/intl-formatters.ts`:
- Line 30: The date formatter and formatEstimatedUsdValue still hardcode
user-visible fallback and approximation markers, bypassing localization in
CodexAccountPool.tsx and Logs.tsx. Update these formatter APIs to use the
selected locale’s i18n messages for invalid-date fallback and estimated-value
text, and route the localized values through the existing callers instead of
embedding em dash or tilde characters. Preserve the current formatting behavior
for valid, non-estimated values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d1792cc2-7e05-409d-bd7e-a6aad33e741c
📒 Files selected for processing (10)
gui/src/fetch-json.tsgui/src/intl-formatters.tsgui/src/pages/ClaudeCode.tsxgui/src/pages/claude-code-sidecar.tsgui/src/pages/claude-code-types.tsgui/tests/claude-code-sidecar-draft.test.tsxgui/tests/claude-code-sidecar.test.tsgui/tests/claude-code-types.test.tsgui/tests/claudecode-fetch-errors.test.tsxgui/tests/fetch-json.test.ts
Summary
Stack
Test plan
bun x tsc -bingui/Summary by CodeRabbit
New Features
Bug Fixes