Describe the bug
Two related layout problems with the brain icon (🧠) in the agent chat status line:
-
Collapses when not thinking. The TextBlock uses IsVisible="{Binding StatusLine.IsThinking}". In Avalonia, IsVisible=false removes the element from the layout pass entirely — the status line and adjacent content shift when thinking starts/stops.
-
FontSize pulse shifts adjacent content. The CSS-style pulse animation in AgentChatStatusLineStyles.axaml animates FontSize from 12 to 16. Because the TextBlock participates in layout with its natural size, growing the font pushes the model/provider text to the right on every pulse tick.
Expected behaviour
- The brain icon always occupies a fixed, reserved slot in the status line. It is invisible when not thinking, but the space it occupies never changes.
- The icon itself changes size during the pulse (giving the visual "heartbeat" effect), but this size change must not affect the layout of any other element.
Affected files
Phantom.Workspaces.Agent.Gui/Controls/AgentChatEditorControl.axaml — brain TextBlock declaration (line 40–43); replace IsVisible binding with Opacity (or IsHitTestVisible + Opacity) so the space is always reserved
Phantom.Workspaces.Gui.Styles/Styles/AgentChatStatusLineStyles.axaml — pulse animation on FontSize; use a RenderTransform scale instead of FontSize so the size change is purely visual and does not affect layout
Suggested fix
In AgentChatEditorControl.axaml: swap IsVisible for an opacity binding so the element is always laid out:
<TextBlock Classes="agent-chat-status-line-brain"
FontFamily="Segoe UI Emoji"
Text="🧠"
Opacity="{Binding StatusLine.IsThinking, Converter={StaticResource BoolToOpacityConverter}}" />
In AgentChatStatusLineStyles.axaml: change the pulse to animate ScaleTransform (applied via RenderTransformOrigin="0.5,0.5") rather than FontSize, so the glyph scales around its centre without touching the layout box:
<Style Selector="TextBlock.agent-chat-status-line-brain">
<Setter Property="FontSize" Value="{DynamicResource AgentChat.StatusLine.FontSize}" />
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
<Setter Property="RenderTransform">
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter>
<Style.Animations>
<Animation IterationCount="INFINITE" Duration="0:0:1"
PlaybackDirection="Alternate" Easing="SineEaseInOut">
<KeyFrame Cue="0%">
<Setter Property="ScaleTransform.ScaleX" Value="1" />
<Setter Property="ScaleTransform.ScaleY" Value="1" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="ScaleTransform.ScaleX" Value="1.35" />
<Setter Property="ScaleTransform.ScaleY" Value="1.35" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
The fixed layout slot means the status line height and the positions of all other items stay stable regardless of whether the agent is thinking.
Describe the bug
Two related layout problems with the brain icon (🧠) in the agent chat status line:
Collapses when not thinking. The
TextBlockusesIsVisible="{Binding StatusLine.IsThinking}". In Avalonia,IsVisible=falseremoves the element from the layout pass entirely — the status line and adjacent content shift when thinking starts/stops.FontSize pulse shifts adjacent content. The CSS-style pulse animation in
AgentChatStatusLineStyles.axamlanimatesFontSizefrom 12 to 16. Because theTextBlockparticipates in layout with its natural size, growing the font pushes the model/provider text to the right on every pulse tick.Expected behaviour
Affected files
Phantom.Workspaces.Agent.Gui/Controls/AgentChatEditorControl.axaml— brainTextBlockdeclaration (line 40–43); replaceIsVisiblebinding withOpacity(orIsHitTestVisible + Opacity) so the space is always reservedPhantom.Workspaces.Gui.Styles/Styles/AgentChatStatusLineStyles.axaml— pulse animation onFontSize; use aRenderTransformscale instead ofFontSizeso the size change is purely visual and does not affect layoutSuggested fix
In
AgentChatEditorControl.axaml: swapIsVisiblefor an opacity binding so the element is always laid out:In
AgentChatStatusLineStyles.axaml: change the pulse to animateScaleTransform(applied viaRenderTransformOrigin="0.5,0.5") rather thanFontSize, so the glyph scales around its centre without touching the layout box:The fixed layout slot means the status line height and the positions of all other items stay stable regardless of whether the agent is thinking.