chore: upgrade apsara rc.4 → rc.7, fix breaking changes, auto-expand sidebar groups#70
chore: upgrade apsara rc.4 → rc.7, fix breaking changes, auto-expand sidebar groups#70rsbh wants to merge 8 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR upgrades ChangesApsara upgrade and component refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Uses NodeType constants from tree-utils. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All were pure 'use client' + re-export. Apsara rc.6+ already marks its exports as client components. Only callout.tsx kept (has logic). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/chronicle/src/themes/default/Layout.tsx`:
- Line 261: The Sidebar.Group currently uses defaultOpen={hasActiveChild} which
only sets initial state and won't update on client-side route changes; replace
the uncontrolled prop with a controlled API by using open={hasActiveChild} on
Sidebar.Group and add an onOpenChange handler (e.g.,
onOpenChange={setLocalOpenState}) to sync user toggles with your component state
while keeping hasActiveChild drive expansion on navigation; update any local
state logic to respect hasActiveChild so route-driven expands override or
initialize the controlled open state as intended.
🪄 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: 6355dad9-5bd5-4774-9d18-0f3ff777953e
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
packages/chronicle/package.jsonpackages/chronicle/src/components/api/playground-dialog.tsxpackages/chronicle/src/components/common/breadcrumb.tsxpackages/chronicle/src/components/common/button.tsxpackages/chronicle/src/components/common/code-block.tsxpackages/chronicle/src/components/common/dialog.tsxpackages/chronicle/src/components/common/index.tspackages/chronicle/src/components/common/input-field.tsxpackages/chronicle/src/components/common/sidebar.tsxpackages/chronicle/src/components/common/switch.tsxpackages/chronicle/src/components/common/table.tsxpackages/chronicle/src/components/common/tabs.tsxpackages/chronicle/src/components/mdx/link.tsxpackages/chronicle/src/themes/default/ContentDirButtons.tsxpackages/chronicle/src/themes/default/Layout.tsxpackages/chronicle/src/themes/default/VersionSwitcher.tsxpackages/chronicle/src/themes/paper/VersionSwitcher.tsx
💤 Files with no reviewable changes (10)
- packages/chronicle/src/components/common/code-block.tsx
- packages/chronicle/src/components/common/table.tsx
- packages/chronicle/src/components/common/breadcrumb.tsx
- packages/chronicle/src/components/common/switch.tsx
- packages/chronicle/src/components/common/button.tsx
- packages/chronicle/src/components/common/dialog.tsx
- packages/chronicle/src/components/common/input-field.tsx
- packages/chronicle/src/components/common/sidebar.tsx
- packages/chronicle/src/components/common/tabs.tsx
- packages/chronicle/src/components/common/index.ts
| label={item.name?.toString() ?? ''} | ||
| leadingIcon={icon ?? undefined} | ||
| collapsible={depth === 1} | ||
| defaultOpen={hasActiveChild} |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In @raystack/apsaraSidebar.Group, doesdefaultOpen update behavior on prop change after mount, or is it only initial state? If only initial, what is the recommended controlled API (open/onOpenChange) for route-driven expansion?
💡 Result:
defaultOpen on @raystack/apsara Sidebar.Group is intended as an uncontrolled “initial state” prop; it should not be relied on to react to prop changes after mount. For route-driven expansion, use the controlled API: set the relevant expanded/open state via the open prop and update it in response to changes via onOpenChange. In the Sidebar docs, open is described as “Controls the expanded/collapsed state”, onOpenChange as “Callback when expanded/collapsed state changes”, and defaultOpen as “Default expanded/collapsed state” (i.e., only the initial/uncontrolled value) [1].
Citations:
Use controlled open prop for route-driven folder expansion.
Sidebar.Group treats defaultOpen as initial-only state and does not react to prop changes after mount. Since hasActiveChild is computed per route, the folder will not auto-expand on client-side navigation. Switch to the controlled API: set open={hasActiveChild} and use onOpenChange to handle state updates.
🤖 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 `@packages/chronicle/src/themes/default/Layout.tsx` at line 261, The
Sidebar.Group currently uses defaultOpen={hasActiveChild} which only sets
initial state and won't update on client-side route changes; replace the
uncontrolled prop with a controlled API by using open={hasActiveChild} on
Sidebar.Group and add an onOpenChange handler (e.g.,
onOpenChange={setLocalOpenState}) to sync user toggles with your component state
while keeping hasActiveChild drive expansion on navigation; update any local
state logic to respect hasActiveChild so route-driven expands override or
initialize the controlled open state as intended.
Summary
Upgrade @raystack/apsara from 1.0.0-rc.4 to 1.0.0-rc.7 with breaking change fixes.
Upgrades
Breaking change fixes
InputField→Input(renamed in rc.6)gapprops → numeric (gap={3}instead ofgap="small")Linkusesexternalprop +render={<RouterLink />}for client navigationNew feature
Test plan