fix: react doctor fixes#245
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Disabled knowledge base sources:
WalkthroughRefactors UI and web code by extracting variant/config/context logic into dedicated modules, renaming message/avatar props, updating barrels and consumers, adding tests, and adding a husky pre-commit react-doctor staged scan. ChangesUnified Component and Web App Refactoring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
React Doctor found 15 issues in 5 files.
Top Findings
Generated by React Doctor. Questions? Contact founders@million.dev. |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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.
Inline comments:
In @.husky/pre-commit:
- Around line 29-34: The pre-commit hook is swallowing react_doctor failures
because the else branch deletes "$react_doctor_output" and only prints messages
without returning a non-zero status; update the failing path in the block that
calls react_doctor_scan_staged_files and uses "$react_doctor_output" so that
after printing the three error lines it exits with a non-zero code (e.g., exit
1) to fail the hook and prevent lint-staged from passing when react-doctor
reports regressions.
In `@packages/ui/src/components/alert-variants.ts`:
- Line 4: The base alert geometry string in alert-variants.ts is using raw
Tailwind utilities (gap-0.5, rounded-lg, px-2.5, py-2) instead of design tokens;
update the alert base class entry to replace those raw utilities with the
corresponding token-backed classes defined in packages/ui/src/tokens.css (per
DESIGN.md) so spacing, radius and padding are expressed via tokens; ensure you
replace gap-0.5, rounded-lg, px-2.5 and py-2 with their token equivalents, keep
the rest of the compound selector intact, and run the UI build to verify no
visual/regression changes.
In `@packages/ui/src/components/button-group-variants.ts`:
- Line 4: The CSS utility string in button-group-variants.ts uses raw values
(e.g., has-[>[data-slot=button-group]]:gap-2 and the rounded-r-md / rounded-b-md
usages in the select-trigger selectors); replace those raw spacing and radius
utilities with the corresponding token-backed classes defined in
packages/ui/src/tokens.css (use the design system token names from DESIGN.md),
update the selectors that reference gap-2 and rounded-*-md to the token class
names, and ensure any other hard-coded spacing/radius in that file is similarly
mapped to token classes so all UI values come from tokens.css.
In `@packages/ui/src/components/button-variants.ts`:
- Line 4: The button variant string in button-variants.ts uses raw utility
values (e.g., rounded-md, px-2.5, h-9, h-11, gap-2); replace those ad-hoc
utilities with the corresponding token-backed classes defined in
packages/ui/src/tokens.css per DESIGN.md (use the design tokens for radius,
spacing, and sizing instead of literal utilities), updating the base
variant/constant that contains the long class string so all occurrences
(including the group/inline-flex variant and the sizes referenced on lines
22–28) reference token classes rather than raw values.
In `@packages/ui/src/components/progress.tsx`:
- Line 7: The ProgressIndicator component is hardcoding the bg-accent background
class which conflicts with the tone-based class passed from Progress; update
ProgressIndicator to remove the hardcoded "bg-accent" and instead rely on the
tone/className passed in (or merge classes so the passed tone background wins).
Locate the ProgressIndicator JSX (referenced by the ProgressIndicator component
and the parent Progress component) and remove the fixed background utility,
ensuring className composition uses the incoming tone/className prop (or a
utility like classNames/twMerge) so only the correct tone background is applied.
In `@web/src/systems/knowledge/components/knowledge-detail-panel.tsx`:
- Around line 220-233: The memoryIdentity built from just
`${memory.scope}:${memory.filename}` is not collision-resistant and can cause
dialog state to leak between different memories; update the construction of
memoryIdentity (used in the KnowledgeDialogState, dialogState, setDialogState,
isCurrentDialogState, confirmDeleteOpen, and editOpen logic) to include a unique
identifier for the memory (e.g., memory.id or a stable hash of the memory object
like `${memory.scope}:${memory.filename}:${memory.id}` or a short hash of
JSON.stringify(memory)) so comparisons only match the exact memory instance and
dialog open/edit/delete state cannot cross-apply to other records.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 051cb6a5-dad8-4ff2-8dd0-450b40f9add2
⛔ Files ignored due to path filters (8)
.agents/skills/react-doctor/SKILL.mdis excluded by!**/*.md,!.agents/**.github/workflows/react-doctor.ymlis excluded by!**/*.ymlbun.lockis excluded by!**/*.lock,!**/*.lockpackage.jsonis excluded by!**/*.jsonpackages/site/content/runtime/core/configuration/config-toml.mdxis excluded by!**/*.mdxpackages/site/package.jsonis excluded by!**/*.jsonreact-doctor.config.jsonis excluded by!**/*.jsonweb/package.jsonis excluded by!**/*.json
📒 Files selected for processing (55)
.husky/pre-commitpackages/ui/src/components/__tests__/sonner.test.tsxpackages/ui/src/components/alert-variants.tspackages/ui/src/components/alert.tsxpackages/ui/src/components/button-group-variants.tspackages/ui/src/components/button-group.tsxpackages/ui/src/components/button-variants.tspackages/ui/src/components/button.tsxpackages/ui/src/components/custom/__tests__/chat-message-bubble.test.tsxpackages/ui/src/components/custom/__tests__/data-surface.test.tsxpackages/ui/src/components/custom/__tests__/description-card.test.tsxpackages/ui/src/components/custom/chat-message-bubble.tsxpackages/ui/src/components/custom/data-surface-state.tspackages/ui/src/components/custom/data-surface.tsxpackages/ui/src/components/custom/description-card.tsxpackages/ui/src/components/custom/index.tspackages/ui/src/components/custom/markdown-config.tsxpackages/ui/src/components/custom/markdown.tsxpackages/ui/src/components/custom/pill-group-variants.tspackages/ui/src/components/custom/pill-group.tsxpackages/ui/src/components/custom/pill-types.tspackages/ui/src/components/custom/pill-variants.tspackages/ui/src/components/custom/pill.tsxpackages/ui/src/components/custom/stories/chat-message-bubble.stories.tsxpackages/ui/src/components/progress-variants.tspackages/ui/src/components/progress.tsxpackages/ui/src/components/sonner-toast.tspackages/ui/src/components/sonner.tsxpackages/ui/src/components/stories/sonner.stories.tsxpackages/ui/src/components/toggle-group.tsxpackages/ui/src/components/toggle-variants.tspackages/ui/src/components/toggle.tsxpackages/ui/src/index.tsweb/src/components/design-system-showcase.tsxweb/src/integrations/tanstack-query/root-context.tsweb/src/integrations/tanstack-query/root-provider.tsxweb/src/main.tsxweb/src/systems/knowledge/components/knowledge-detail-panel.tsxweb/src/systems/network/components/directs/direct-room.tsxweb/src/systems/network/components/directs/directs-list.tsxweb/src/systems/network/components/directs/new-direct-dialog.tsxweb/src/systems/network/components/shell/channel-rail.tsxweb/src/systems/network/components/timeline/__tests__/message-avatar.test.tsxweb/src/systems/network/components/timeline/message-avatar.tsxweb/src/systems/network/components/timeline/message-row.tsxweb/src/systems/network/contexts/network-list-filters-context-value.tsweb/src/systems/network/contexts/network-list-filters-context.tsxweb/src/systems/network/hooks/use-network-list-filters-context.tsweb/src/systems/session/contexts/session-create-context-value.tsweb/src/systems/session/contexts/session-create-context.tsxweb/src/systems/session/hooks/use-session-create.tsweb/src/systems/session/hooks/use-session-transcript-thread-messages.tsweb/src/systems/session/lib/session-transcript-thread-context-value.tsweb/src/systems/session/lib/session-transcript-thread-context.tsxweb/src/systems/tasks/components/tasks-inbox-view.tsx
💤 Files with no reviewable changes (1)
- packages/ui/src/components/sonner.tsx
Summary by CodeRabbit
New Features
Improvements
Changes