Skip to content

feat(site): show task log preview in paused and failed states#22063

Merged
EhabY merged 9 commits intomainfrom
show-logs-during-pause-error
Feb 19, 2026
Merged

feat(site): show task log preview in paused and failed states#22063
EhabY merged 9 commits intomainfrom
show-logs-during-pause-error

Conversation

@EhabY
Copy link
Contributor

@EhabY EhabY commented Feb 12, 2026

Shows a preview of the last 30 AI chat log messages when a task is paused or its build has failed, giving users context about what happened before the task stopped.

  • Add TaskLogPreview component with auto-scroll, [user]/[agent] group labels, and a left border on each log line
  • Show a snapshot timestamp tooltip in the log header when logs come from a point-in-time snapshot
  • Make InfoTooltip title prop optional
  • Extract useScrollAreaAutoScroll hook shared with BuildingWorkspace

Closes coder/internal#1268

@EhabY EhabY self-assigned this Feb 12, 2026
@EhabY EhabY force-pushed the show-logs-during-pause-error branch 2 times, most recently from 1910361 to 33913c0 Compare February 16, 2026 09:17
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@EhabY EhabY force-pushed the show-logs-during-pause-error branch 3 times, most recently from b5d251a to 2e54f1b Compare February 17, 2026 15:30
@EhabY EhabY force-pushed the show-logs-during-pause-error branch from 2e54f1b to 9c7c2f1 Compare February 17, 2026 15:37
@EhabY EhabY force-pushed the show-logs-during-pause-error branch from 9313d9a to 3551eff Compare February 17, 2026 16:16
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 17, 2026

Documentation Check

Documentation Enhancement Recommended

This PR adds a user-visible UI improvement that would benefit from documentation:

  • docs/ai-coder/tasks.md - Add a section describing task states and UI feedback
    • Document what users see when a task is paused (shows last 30 chat messages, resume button with log access)
    • Document what users see when a task build fails (shows last 30 chat messages, link to full build logs)
    • Mention the log preview shows [user]/[agent] labels and includes a snapshot timestamp when available
    • This helps users understand what to expect and how to troubleshoot when tasks are not running

Rationale: The log preview feature is fully implemented and is a significant UX improvement that users will see immediately when interacting with paused or failed tasks. Brief documentation would help users understand this feedback mechanism and know how to proceed.

Implementation Details: The PR successfully implements:

  • TaskLogPreview component with auto-scroll, user/agent labels, and snapshot timestamps
  • Log previews shown in both paused and failed build states
  • Last messages displayed with appropriate action buttons ("Resume to view full logs" for paused, "View full logs" for failed)
  • Empty state handling when no logs are available (added in latest commit cb464bc)

Status: Re-reviewed after commit cb464bc (2026-02-19) - latest commits refined empty snapshot handling and scroll behavior, but documentation still not added.


Automated review via Coder Tasks

Copy link
Contributor

@DanielleMaywood DanielleMaywood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, just one little comment about the use of useRef().current.

@EhabY EhabY force-pushed the show-logs-during-pause-error branch from 54643c4 to 628ae4b Compare February 17, 2026 16:51
@EhabY
Copy link
Contributor Author

EhabY commented Feb 17, 2026

See coder/internal#1271 (comment) for the doc content

@EhabY EhabY force-pushed the show-logs-during-pause-error branch from 628ae4b to f27765c Compare February 18, 2026 09:33
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor catch, but otherwise LGTM!

- Add `getTaskLogs` API method and `taskLogs` react-query query
- Add `TaskLogPreview` component rendering last N lines of AI chat logs
  in a ScrollArea with auto-scroll-to-bottom
- Show log preview below state message in paused and failed task states
- Extract `useScrollAreaAutoScroll` hook shared with BuildingWorkspace
- Update Storybook stories with mock task log data
… preview

Add a left border to log lines with [user] and [agent] labels on type
transitions. Add a snapshot timestamp tooltip to the log header. Make
InfoTooltip title optional.
@EhabY EhabY force-pushed the show-logs-during-pause-error branch from f27765c to cb464bc Compare February 19, 2026 12:59
@EhabY EhabY merged commit 3fcd8c6 into main Feb 19, 2026
28 checks passed
@EhabY EhabY deleted the show-logs-during-pause-error branch February 19, 2026 13:55
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks: UI log snapshot display when paused

3 participants