←
PPLX-100
Created: 2026-01-01
•
Updated: 2026-01-01
Relationships
Loading...
Attachments
Loading...
Comments (1)
agent
·
2026-01-01
## Fixed Issues
### Root Cause 1: parseThinkingContent.ts (Line 69)
The regex `answer.replace(/\s+/g, ' ')` was replacing ALL whitespace (including newlines) with single spaces, destroying markdown formatting.
**Fix**: Changed to preserve newlines by:
- Splitting by newlines, collapsing only multiple spaces within each line
- Rejoining with newlines preserved
- Collapsing 3+ consecutive newlines to 2
### Root Cause 2: AIAnswer.tsx (Lines 348-349)
ThinkingSection was being rendered with `expanded={isThinkingStreaming}`. When you pass `expanded` prop, ThinkingSection enters controlled mode. Once streaming stops, `isThinkingStreaming=false` means `expanded=false`, and users cannot manually toggle.
**Fix**: Removed the `expanded` prop entirely, allowing ThinkingSection to manage its own internal state. The component already auto-expands during streaming and auto-collapses when done, but now users can manually re-expand.
## Files Changed
- `src/src/utils/parseThinkingContent.ts`: Line 69-75 - Preserve newlines instead of collapsing all whitespace
- `src/src/components/organisms/AIAnswer/AIAnswer.tsx`: Lines 344-354 - Remove controlled mode, add explanatory comments
## Verification
- All 28 parseThinkingContent unit tests pass
- All 61 ThinkingSection tests pass
- Frontend rebuilt and deployed to production (bundle: index-Ce5G8VfY.js)
## Expected Behavior Now
1. Newlines preserved in both thinking and answer content
2. Markdown rendered correctly (RichTextRenderer parses by newlines)
3. ThinkingSection can be manually expanded after auto-collapse