Repository navigation
feat: update ai chat ui component - #576
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:
📝 WalkthroughWalkthroughAdds an optional summaryLabel prop and collapse/expand behavior to ActivityBox, threads summaryLabel generation from AnalysisResult and FlatAgentRenderer, adjusts text wrapping, introduces several Kepler legend/memoization changes, minor Vega UI addition, and a TypeScript type-assertion tweak in table interop. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Renderer as FlatAgentRenderer
participant Analyzer as AnalysisResult
participant Activity as ActivityBox
participant DOM as DOM/ResizeObserver
User->>Renderer: view activity list / interact
Renderer->>Analyzer: build segments (derive summaryLabel if applicable)
Analyzer->>Activity: render ActivityBox with optional `summaryLabel`
User->>Activity: click chevron (toggle expandedForLabel)
Activity->>DOM: mount full UI (measure/observe scroll)
DOM-->>Activity: resize/scroll events trigger effects
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ai-core/src/components/AnalysisResult.tsx (1)
198-211:⚠️ Potential issue | 🟠 Major | ⚡ Quick winTreat
approval-respondedas completed in the pending-state check.At Line 201,
anyPendingdoes not considerapproval-respondedas terminal, so approved calls can stay marked as “running” and never get the collapse summary even after completion.Proposed fix
return ( s !== 'output-available' && + s !== 'approval-responded' && s !== 'output-error' && s !== 'output-denied' );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai-core/src/components/AnalysisResult.tsx` around lines 198 - 211, The pending-state check for seg.parts (the anyPending computation) treats 'approval-responded' as non-terminal causing approved parts to remain "pending"; update the predicate in the anyPending arrow function (used on seg.parts.some) to also treat s === 'approval-responded' as a completed/terminal state (i.e., include it alongside 'output-available', 'output-error', and 'output-denied') so allToolsDone/summaryLabel logic toggles correctly when analysisResult.isCompleted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/ai-core/src/components/AnalysisResult.tsx`:
- Around line 198-211: The pending-state check for seg.parts (the anyPending
computation) treats 'approval-responded' as non-terminal causing approved parts
to remain "pending"; update the predicate in the anyPending arrow function (used
on seg.parts.some) to also treat s === 'approval-responded' as a
completed/terminal state (i.e., include it alongside 'output-available',
'output-error', and 'output-denied') so allToolsDone/summaryLabel logic toggles
correctly when analysisResult.isCompleted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fa25b755-037c-4b0c-b1da-4ab8897b6703
📒 Files selected for processing (3)
packages/ai-core/src/components/ActivityBox.tsxpackages/ai-core/src/components/AnalysisResult.tsxpackages/ai-core/src/components/FlatAgentRenderer.tsx
…omponents to improve word breaking
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 `@packages/ai-core/src/components/ActivityBox.tsx`:
- Around line 83-91: The effects that attach observers/listeners (the
ResizeObserver/MutationObserver and the scroll listener in useEffect hooks
referencing measure, updateScrollFlags, visible, and scrollRef) must also depend
on isRunning because showBox can change when isRunning toggles even if visible
stays the same; update the dependency arrays for these useEffect hooks (the one
with [measure, updateScrollFlags, visible] and the one with [updateScrollFlags,
visible]) to include isRunning so the effects re-run and attach
observers/listeners when transitioning to the full box view.
🪄 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: 8f95cfaa-e37c-4377-a3a5-9d83f3a8d560
📒 Files selected for processing (3)
packages/ai-core/src/components/ActivityBox.tsxpackages/ai-core/src/components/FlatAgentRenderer.tsxpackages/kepler/src/components/KeplerMapContainer.tsx
|
Could the kepler / vega changes be a separate PR? |
a40f406 to
e559c4d
Compare
…roved scroll handling
1462c12 to
dafe0a1
Compare
Uh oh!
There was an error while loading. Please reload this page.