--- id: TASK-12 title: Unify savings chat tools and sources UI status: In Progress assignee: [] created_date: '2026-06-16 09:07' updated_date: '2026-06-16 09:09' labels: [] dependencies: [] priority: high ordinal: 12000 --- ## Description Replace duplicated Tools and Quellen panels in savings chat assistant messages with one combined evidence block when tool traces and generated sources describe the same data basis. ## Acceptance Criteria - [x] #1 Assistant messages with both toolTrace and matching sources render a single Nachweis & Arbeitsweg block - [x] #2 The combined block exposes citation source ids on the evidence rows so inline markers still point at the same evidence - [x] #3 Sources-only assistant messages can still render a Quellen block for genuinely external sources - [x] #4 Focused component tests, targeted lint, and build pass ## Implementation Plan 1. Add regression tests for assistant messages where toolTrace and sources describe the same evidence. 2. Replace the separate Tools + Quellen rendering path with a single Nachweis & Arbeitsweg evidence panel when toolTrace exists. 3. Keep the Quellen-only fallback for messages that have sources without tool traces. 4. Verify focused component tests, targeted lint, and production build. 5. Commit the UI refinement; keep task In Progress until user confirms manual behavior. ## Implementation Notes Unified generated tool traces and generated sources in AgentChat. Assistant messages with toolTrace now render one Nachweis & Arbeitsweg disclosure and attach source ids to the evidence rows, so inline citation markers still resolve to the same evidence. Sources-only messages still render the Quellen fallback for external/document sources. Verification passed: npx vitest src/components/chat/AgentChat.test.tsx --run (13 tests), targeted eslint, npm run build (existing Vite chunk-size warning only).