Skip to content

Conversation

@ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Sep 18, 2025

closes #11417

Summary by CodeRabbit

  • New Features
    • AI Chat Panel now shows follow-up suggestions as a row of centered, clickable buttons for quicker prompt entry.
    • Selecting a suggestion immediately sends it as a prompt.
    • The suggestions area is consistently displayed to maintain layout stability, even when no suggestions are available.

@ysmoradi ysmoradi requested a review from Copilot September 18, 2025 08:43
@coderabbitai
Copy link

coderabbitai bot commented Sep 18, 2025

Note

Other AI code review bot(s) detected

CodeRabbit 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.

Walkthrough

A 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

Cohort / File(s) Summary
Follow-up Suggestions UI
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/AppAiChatPanel.razor
Replaced conditional rendering of follow-up suggestions with an always-present BitStack container. Iterates suggestions to render BitButton items (FixedColor, Outline, SecondaryBackground) invoking SendPromptMessage(suggestion). Minor attribute formatting tweak. Empty list yields an empty container.

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)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A nibble of prompts in a tidy row,
Buttons like clover, ready to go.
Even when fields are quiet and bare,
A place is kept—some space to share.
I twitch my ears, click-hop with glee:
“Send!” says the bunny, swift and free. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues Check ❓ Inconclusive The diff shows the follow-up suggestions block moved and rendered unconditionally (removed the followUpSuggestions.Any() guard), which suggests an intent to change stickiness for issue [#11417], but the provided summary contains only render changes and does not show how followUpSuggestions is populated, cleared, or updated over time, so it is not possible to confirm from this information alone that the linked issue's objective is satisfied. Please include the related state-management code or a short repro/test showing before-and-after behavior for followUpSuggestions, or describe when and how suggestions are cleared/updated so reviewers can verify that the stickiness issue (#11417) is actually resolved.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Use non sticky followup suggestions list in ai chat panel (#11417)" succinctly describes the primary change—adjusting follow-up suggestion behavior in the AI chat panel—and references the related issue number, making it clear and relevant to reviewers.
Out of Scope Changes Check ✅ Passed The described changes are limited to AppAiChatPanel.razor (adjusting how follow-up suggestions render) with a minor formatting edit and no other files or unrelated features modified, so the changes appear to be in scope for the linked issue.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a 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

Copy link

@coderabbitai coderabbitai bot left a 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 if followUpSuggestions is null. Rendering the container unconditionally also leaves empty space. Wrap with a null/empty check; drop FitHeight/FillContent to prevent blank vertical space; add @key and disable clicks during isLoading.

-						<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.Linq is in scope for .Any(). If not, add @using System.Linq at 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 suggestions

If followUpSuggestions can 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b8c70c and 759261b.

📒 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 duplication

When chatMessages.Count == 1 the default prompts (Lines 88–115) render. If followUpSuggestions is also populated at that moment, users may see two prompt rows. Verify intended behavior; otherwise, gate the default block behind an else of the suggestions check.

@ysmoradi ysmoradi merged commit 0717b25 into bitfoundation:develop Sep 18, 2025
3 checks passed
@ysmoradi ysmoradi deleted the 11417 branch September 18, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI chat panel's followup suggestions may not be sticky in bit Boilerplate

1 participant