diff --git a/PolyPilot/Components/ChatMessageList.razor b/PolyPilot/Components/ChatMessageList.razor index 2b349d64..4f13765d 100644 --- a/PolyPilot/Components/ChatMessageList.razor +++ b/PolyPilot/Components/ChatMessageList.razor @@ -58,6 +58,28 @@ } } + @* Plan/intent — shown in expanded view when plan mode is active and there's intent text *@ + @if (!Compact && PlanMode && !string.IsNullOrEmpty(Intent)) + { +
+ + @if (!_planCollapsed || LineCount(Intent) <= 5) + { +
@((MarkupString)RenderMarkdown(Intent))
+ } + else + { +
@FirstLines(Intent, 3)
+ } +
+ } + @* Streaming content — only show while actively processing to avoid overlap with finalized History *@ @if (!string.IsNullOrEmpty(StreamingContent) && IsProcessing) { @@ -109,6 +131,10 @@ [Parameter] public string? UserAvatarUrl { get; set; } [Parameter] public ChatLayout Layout { get; set; } = ChatLayout.Default; [Parameter] public ChatStyle Style { get; set; } = ChatStyle.Normal; + [Parameter] public bool PlanMode { get; set; } + [Parameter] public string Intent { get; set; } = ""; + + private bool _planCollapsed; private string GetLayoutClass() => Layout switch { diff --git a/PolyPilot/Components/ChatMessageList.razor.css b/PolyPilot/Components/ChatMessageList.razor.css index b4d9db2b..9492b6c0 100644 --- a/PolyPilot/Components/ChatMessageList.razor.css +++ b/PolyPilot/Components/ChatMessageList.razor.css @@ -268,6 +268,47 @@ overflow: hidden; } +/* Plan block — shown when plan mode is active */ +::deep .plan-block { + flex-shrink: 0; + margin: 0.15rem 1rem; + border-left: 2px solid rgba(139, 92, 246, 0.4); + padding-left: 0.6rem; + background: rgba(139, 92, 246, 0.06); + border-radius: 0 6px 6px 0; + padding: 0.25rem 0.6rem; +} + +::deep .plan-header { + background: none; + border: none; + color: #a78bfa; + font-size: var(--type-body); + cursor: pointer; + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.25rem 0; + width: 100%; +} + +::deep .plan-title { + font-weight: 600; +} + +::deep .plan-content { + font-size: var(--type-body); + color: var(--text-secondary); + line-height: 1.6; + padding: 0.25rem 0; +} + +::deep .plan-content.preview { + max-height: 4.5em; + overflow: hidden; + white-space: pre-wrap; +} + ::deep .tool-card { flex-shrink: 0; margin: 0.25rem 1rem; @@ -769,6 +810,7 @@ max-width: 100%; } .chat-message-list.full.style-minimal ::deep .reasoning-block, +.chat-message-list.full.style-minimal ::deep .plan-block, .chat-message-list.full.style-minimal ::deep .action-box, .chat-message-list.full.style-minimal ::deep .task-complete-card, .chat-message-list.full.style-minimal ::deep .error-card { diff --git a/PolyPilot/Components/ExpandedSessionView.razor b/PolyPilot/Components/ExpandedSessionView.razor index 6ae5f5db..11e1b91b 100644 --- a/PolyPilot/Components/ExpandedSessionView.razor +++ b/PolyPilot/Components/ExpandedSessionView.razor @@ -105,7 +105,9 @@ Compact="false" UserAvatarUrl="@UserAvatarUrl" Layout="@Layout" - Style="@Style" /> + Style="@Style" + PlanMode="@PlanMode" + Intent="@Intent" /> @if (!string.IsNullOrEmpty(Error))