# Chat Current-Task Timeline Consistency

## Goal

Make the chat page's current-session progress panel show the same timeline
content as the active Task's detail page.

## Visibility

- Show the chat-side timeline only while the current session has an active
  Task.
- Hide the panel immediately when the Task is accepted, auto-accepted,
  abandoned, closed, or when the user switches sessions.
- Do not show the most recently completed Task after it is no longer active.

## Shared Data Model

The Task detail page remains the canonical timeline behavior.

Both surfaces must:

1. Load the full `BackendTask` payload from `/api/tasks/{task_id}`.
2. Combine the task's persisted process data with matching live process data.
3. Use one shared task-process filtering helper.
4. Build cards with `buildTaskTimelineCards()`.
5. Render cards with `TaskTimeline`.

This keeps card types, ordering, fallback milestones, result history,
acceptance history, tool status, and deduplication consistent.

## Chat Panel

`CurrentSessionProgressSidebar` becomes a responsive wrapper around
`TaskTimeline`.

- Desktop keeps the existing right sidebar.
- Smaller viewports keep the existing floating open button and drawer.
- The panel title remains "当前会话的运行进度".
- Timeline cards match the Task detail timeline.
- Chat does not render duplicate acceptance controls inside the sidebar,
  because acceptance controls already exist on chat result messages.

## Data Refresh

- Whenever the active Task changes, the chat page loads its full Task detail.
- Existing message, process, feedback, and WebSocket refresh paths reload both
  the active Task identity and its full detail.
- If the active-task endpoint returns `null`, the cached active Task detail is
  cleared immediately and the sidebar disappears.
- A task-detail load failure hides the sidebar rather than showing stale data.

## Testing

- Shared process filtering returns the same task-scoped runs, events, and
  artifacts for both surfaces.
- The chat-side timeline cards are produced by `buildTaskTimelineCards()`.
- No active Task produces no chat-side timeline.
- Switching to a closed/no-active Task clears the chat-side timeline.
- Frontend unit tests, typecheck, and production build pass.
