-
-
Notifications
You must be signed in to change notification settings - Fork 254
Use non sticky followup suggestions list in ai chat panel (#11417) #11418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughA UI block was added to always render a centered container for follow-up suggestion buttons in AppAiChatPanel. The prior conditional rendering was removed. Each suggestion remains a clickable BitButton calling SendPromptMessage(suggestion). When the list is empty, the container shows no buttons. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant P as AppAiChatPanel
participant UI as BitStack + BitButton(s)
participant H as SendPromptMessage
rect rgba(200,230,255,0.25)
note over P,UI: New: Suggestions container always rendered
P->>UI: Render container (centered)
UI->>UI: For each suggestion, render BitButton
end
U->>UI: Click suggestion button
UI->>H: SendPromptMessage(suggestion)
H-->>U: Message sent (follow-up initiated)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes sticky positioning from the follow-up suggestions list in the AI chat panel by relocating the suggestions component from a fixed bottom position to the main conversation flow.
- Moved the follow-up suggestions list from outside the scrollable conversation area to inside the conversation flow
- Removed the conditional rendering that only showed suggestions when they existed
- Changed suggestions from a sticky bottom position to a non-sticky inline position
...te/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor (1)
66-80: Guard against null and avoid rendering an empty container; also make buttons non-clickable while loading and stabilize diffing with @key
foreach (var suggestion in followUpSuggestions)will throw iffollowUpSuggestionsis null. Rendering the container unconditionally also leaves empty space. Wrap with a null/empty check; dropFitHeight/FillContentto prevent blank vertical space; add@keyand disable clicks duringisLoading.- <BitStack Alignment="BitAlignment.Center" FitHeight FillContent Class="default-prompt-container"> - - @foreach (var suggestion in followUpSuggestions) - { - <BitButton FixedColor - Variant="BitVariant.Outline" - Class="default-prompt-button" - Color="BitColor.SecondaryBackground" - OnClick="() => SendPromptMessage(suggestion)"> - @suggestion - </BitButton> - } - - </BitStack> + @if (followUpSuggestions?.Any() == true) + { + <BitStack Alignment="BitAlignment.Center" Class="default-prompt-container"> + @foreach (var suggestion in followUpSuggestions) + { + <BitButton @key="suggestion" + FixedColor + Variant="BitVariant.Outline" + Class="default-prompt-button" + Color="BitColor.SecondaryBackground" + IsEnabled=@(!isLoading) + OnClick="() => SendPromptMessage(suggestion)"> + @suggestion + </BitButton> + } + </BitStack> + }Note: ensure
System.Linqis in scope for.Any(). If not, add@using System.Linqat the top or switch to a pattern that doesn’t require LINQ.
🧹 Nitpick comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor (1)
70-76: Filter out blank/duplicate suggestionsIf
followUpSuggestionscan include whitespace-only or repeated items, filter before rendering to reduce noise.- @foreach (var suggestion in followUpSuggestions) + @foreach (var suggestion in followUpSuggestions.Where(s => string.IsNullOrWhiteSpace(s) is false).Distinct()) {Requires
@using System.Linq.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build and test
🔇 Additional comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor (1)
66-80: Confirm interaction with default prompts block to avoid duplicationWhen
chatMessages.Count == 1the default prompts (Lines 88–115) render. IffollowUpSuggestionsis also populated at that moment, users may see two prompt rows. Verify intended behavior; otherwise, gate the default block behind anelseof the suggestions check.
closes #11417
Summary by CodeRabbit