Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions PolyPilot/Components/ChatMessageList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
<div class="plan-block @(_planCollapsed && LineCount(Intent) > 5 ? "collapsed" : "")">
<button class="plan-header" @onclick="() => _planCollapsed = !_planCollapsed">
<span class="plan-title">📋 Plan</span>
@if (LineCount(Intent) > 5)
{
<span class="collapse-icon">@(_planCollapsed ? "▶" : "▼")</span>
}
</button>
@if (!_planCollapsed || LineCount(Intent) <= 5)
{
<div class="plan-content markdown-body">@((MarkupString)RenderMarkdown(Intent))</div>
}
else
{
<div class="plan-content preview">@FirstLines(Intent, 3)</div>
}
</div>
}

@* Streaming content — only show while actively processing to avoid overlap with finalized History *@
@if (!string.IsNullOrEmpty(StreamingContent) && IsProcessing)
{
Expand Down Expand Up @@ -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
{
Expand Down
42 changes: 42 additions & 0 deletions PolyPilot/Components/ChatMessageList.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion PolyPilot/Components/ExpandedSessionView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@
Compact="false"
UserAvatarUrl="@UserAvatarUrl"
Layout="@Layout"
Style="@Style" />
Style="@Style"
PlanMode="@PlanMode"
Intent="@Intent" />
</div>

@if (!string.IsNullOrEmpty(Error))
Expand Down