Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds two related display fixes for the mothership chat UI: it visually distinguishes subagent-emitted text by rendering it in a styled card (instead of a plain paragraph), and introduces first-class support for Key changes:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SSE content event received] --> B{activeSubagent set?}
B -- Yes --> C[ensureTextBlock with subagent=true\nCreates subagent_text block]
B -- No --> D[ensureTextBlock with subagent=false\nCreates text block]
C --> E[Append chunk to block content and flush]
D --> E
F[Raw SSE content string] --> G[parseSpecialTags]
G --> H{Tag detected?}
H -- thinking --> I[Segment type = thinking\nRaw body stored as content]
H -- options or credential or usage_upgrade --> J[Segment: JSON-parsed data]
H -- none --> K[Segment type = text]
I --> L[SpecialTags: thinking case\nStyled italic bordered div]
J --> M[SpecialTags: options / credential / upgrade display]
K --> N[Plain text render]
C --> O[AgentGroup text item\nStyled italic bordered div]
|
| /** TODO: FIX THINKING BLOCK RENDERING*/ | ||
| case 'thinking': | ||
| return ( | ||
| <div className='rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic'> | ||
| {segment.content.trim()} | ||
| </div> | ||
| ) |
There was a problem hiding this comment.
TODO comment signals incomplete implementation
The /** TODO: FIX THINKING BLOCK RENDERING*/ comment was introduced alongside the actual rendering code, signalling that the current output is a known placeholder rather than the intended design. Shipping a TODO in production code alongside the feature itself makes it easy to lose track of the intended follow-up work. Consider either completing the rendering before merging, or tracking the remaining work in an issue and removing the comment from the source.
| return ( | ||
| <div className='rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic'> | ||
| {segment.content.trim()} | ||
| </div> | ||
| ) |
There was a problem hiding this comment.
Missing whitespace-pre-wrap on thinking block
The thinking content rendered here follows the same pattern as the agent-group.tsx text div. If the thinking text contains newlines (very common for reasoning traces), they will be collapsed without whitespace-pre-wrap. The same concern applies here as in agent-group.tsx.
Additionally, the identical class string 'rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic' is duplicated verbatim in both files. Consider extracting it into a shared Tailwind class or small presentational component to avoid drift.
| return ( | |
| <div className='rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic'> | |
| {segment.content.trim()} | |
| </div> | |
| ) | |
| <div className='whitespace-pre-wrap rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic'> | |
| {segment.content.trim()} | |
| </div> |
| <div | ||
| key={`text-${idx}`} | ||
| className='whitespace-pre-wrap pl-[24px] font-base text-[13px] text-[var(--text-secondary)]' | ||
| className='ml-[24px] rounded-lg border border-[var(--divider)] bg-[var(--surface-4)] px-3 py-2 text-[13px] text-[var(--text-tertiary)] italic' | ||
| > | ||
| {item.content.trim()} | ||
| </p> | ||
| </div> |
There was a problem hiding this comment.
Missing whitespace-pre-wrap causes newlines to collapse
The original <p> element had the Tailwind class whitespace-pre-wrap, which preserves both whitespace sequences and newlines in the rendered output. The replacement <div> drops this class entirely, so any multi-line subagent text (e.g. step-by-step explanations or prose with explicit line breaks) will now be collapsed into a single run of text with no visible line breaks.
Add whitespace-pre-wrap back to the new <div>'s className to restore the previous behavior.
Summary
Brief description of what this PR does and why.
Fixes #(issue)
Type of Change
Testing
How has this been tested? What should reviewers focus on?
Checklist
Screenshots/Videos