Skip to content

docs: add in-app "Jobs" section to docs-pane#367

Merged
selfcontained merged 1 commit into
mainfrom
agt_eadd65b2756c/job-doc-ter-407dc99f
Apr 19, 2026
Merged

docs: add in-app "Jobs" section to docs-pane#367
selfcontained merged 1 commit into
mainfrom
agt_eadd65b2756c/job-doc-ter-407dc99f

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds a new Jobs section to the in-app docs pane (docs-pane.tsx), between Repo Tools and Worktrees. Covers creating a job (all form fields), on-demand "Run now" runs, run lifecycle (job_log / job_complete / job_failed / job_needs_input and the seven run statuses), and history/status.
  • Advances the docs-audit state file: last_audited_sha → pre-PR HEAD, next_focusMedia & Sharing section, backlog picks up Jobs follow-ups (lifecycle handoff files, JobNotifyConfig, configurable timeouts) plus a new drift pattern about job state living in multiple places.

What this audit did (and did not) cover

  • In scope: one new section, wired into the DocsSection union and SECTIONS array, validated in a Playwright-driven dev stack.
  • Deferred to next runs: the .dispatch/job-state/<job>.md handoff-file convention, Slack JobNotifyConfig, and per-job timeoutMs / needsInputTimeoutMs — all logged in backlog.

Test plan

  • pnpm run format:write — clean
  • pnpm -C apps/web run check — typecheck passes
  • Dev stack + Playwright: loaded /docs/jobs, confirmed the new section renders with all four subsections (Creating a job, On-demand runs, Run lifecycle, History and status) and appears in the docs sidebar nav
  • CI (automated)

🤖 Generated with Claude Code

Seeds a new Jobs section between Repo Tools and Worktrees covering:
creating a job (all form fields), on-demand "Run now" runs, the
run lifecycle (job_log / job_complete / job_failed / job_needs_input
and the seven run statuses), and history/status.

Also updates the docs-audit state file: last_audited_sha advances to
the pre-PR HEAD, next_focus moves to the Media & Sharing section, and
backlog picks up Jobs lifecycle-handoff / notify-config / timeouts
follow-ups plus a new drift pattern about job state living in multiple
places.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 02c2e80 into main Apr 19, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_eadd65b2756c/job-doc-ter-407dc99f branch April 19, 2026 22:23
niiyeboah added a commit that referenced this pull request Jul 8, 2026
- Only mark messages read when the sidebar is actually open on the
  Messages tab; gating on the persisted tab alone silently cleared unread
  state for a closed sidebar. (#365)
- Surface unread messages on the collapsed sidebar toggle (combined with
  the unseen-media count) so unread is discoverable while collapsed. (#366)
- Add an explanatory tooltip to the "not delivered" label in both the
  sidebar panel and the History timeline. (#367)
- Give the populated message list min-h-0 flex-1 so it scrolls within the
  sidebar instead of overflowing past the bottom edge. (#368)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
selfcontained pushed a commit that referenced this pull request Jul 10, 2026
- Only mark messages read when the sidebar is actually open on the
  Messages tab; gating on the persisted tab alone silently cleared unread
  state for a closed sidebar. (#365)
- Surface unread messages on the collapsed sidebar toggle (combined with
  the unseen-media count) so unread is discoverable while collapsed. (#366)
- Add an explanatory tooltip to the "not delivered" label in both the
  sidebar panel and the History timeline. (#367)
- Give the populated message list min-h-0 flex-1 so it scrolls within the
  sidebar instead of overflowing past the bottom edge. (#368)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
selfcontained added a commit that referenced this pull request Jul 10, 2026
… History (#736)

* Add design spec for agent messages feature

Persist agent-to-agent messages, surface them in a per-agent sidebar
Messages tab, and add a Messages tab to the History detail view.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add implementation plan for agent messages feature

Task-by-task TDD plan: agent_messages table + MessageStore, persist/
broadcast on send, REST endpoints, useAgentMessages hook + SSE, sidebar
Messages tab, History detail Messages tab, and E2E coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(messages): add agent_messages table and MessageStore

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(messages): persist and broadcast messages on send

* feat(messages): add read + mark-read REST endpoints

Add GET /api/v1/agents/:id/messages and POST /api/v1/agents/:id/messages/read,
backed by MessageStore. Mark-read publishes a message.read UI event. Also add
the message.created and message.read variants to the backend UiEvent union so
sender/mark-read publishes type-check against the broker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(messages): add useAgentMessages hook and SSE wiring

* feat(messages): add MessagesPanel with conversation threads

* fix(messages): add loading state to MessagesPanel

Expose isLoading from useAgentMessages hook and render a spinner while
loading, preventing misleading empty state flash on initial mount.
Modeled on BrainTabContent's loading pattern for consistency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(messages): add Messages tab to the agent sidebar

* feat(messages): surface messages in History detail view

Add a messages query to GET /api/v1/history/agents/:id and a Messages
tab to the History detail view, backed by a new MessageTimeline
component.

* test(messages): e2e coverage for sidebar + history messages

Add seedAgentMessageViaDB helper and agent-messages.spec.ts covering the
sidebar Messages tab (unread badge appears then clears on open) and the
History detail Messages tab. Also fix a markRead useCallback dependency
(depended on the unstable mutation object, causing a request storm and a
flickering unread badge).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(messages): clarify History is not live-invalidated

Final review found the data-flow diagram implied the History detail tab
refetches on message.created; it does not. History is retrospective and
matches its sibling tabs (refetch on remount/focus/staleTime).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style(messages): apply prettier formatting

CI `pnpm run format` (prettier --check) flagged these files; the local
pre-commit hook was unavailable so formatting wasn't applied on commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(messages): address persona review findings

- Bound MessageStore.listForAgent to the most recent 500 (mirrors the
  history-detail LIMIT 500); the sidebar refetches this eagerly, so it
  must not be unbounded. (security #360, architecture #362)
- Only publish message.created when the row actually persisted; the insert
  failure path stays swallow-and-log so delivery is never blocked, but the
  UI no longer gets an event with no backing row. (security #361)
- Serve unreadCount from GET /agents/:id/messages via countUnreadForAgent
  (uses the partial unread index) and drive the sidebar badge from it, so
  the count stays accurate despite the list cap. (architecture #363)
- Drop the unused agentManager dep from the messages routes. (architecture #364)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(messages): address frontend UX review findings

- Only mark messages read when the sidebar is actually open on the
  Messages tab; gating on the persisted tab alone silently cleared unread
  state for a closed sidebar. (#365)
- Surface unread messages on the collapsed sidebar toggle (combined with
  the unseen-media count) so unread is discoverable while collapsed. (#366)
- Add an explanatory tooltip to the "not delivered" label in both the
  sidebar panel and the History timeline. (#367)
- Give the populated message list min-h-0 flex-1 so it scrolls within the
  sidebar instead of overflowing past the bottom edge. (#368)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(messages): review feedback — split hooks, unify bubble UX, improve icons

Split useAgentMessages into three focused hooks (messages list, unread
count, mark-read mutation). Unify MessageTimeline and MessageBubble into
a single exported component used in both sidebar and history. Add
collapsible agent-grouped threads with framer-motion animation and
persisted collapse state. Add generic Bot fallback icon for unknown agent
types. Replace non-reactive queryClient.getQueryData with reactive
useQuery+select for agent type enrichment. Delete unused plan doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(messages): address persona review round 1 findings

Fix history query to return newest 500 messages (subquery pattern),
resolve recipientRepoRoot from target agent's cwd, add tab overflow
scrolling for sidebar and history tabs, improve copy button touch target.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(sidebar): drop Brain tab, revert to label tabs

Brain data is accessible from the global area; per-agent sidebar tab
was redundant. Reverts icon experiment and restores text labels for the
remaining 4 tabs (Pins, Media, Reviews, Messages).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(db): renumber agent-messages migration to 0030

Resolves duplicate prefix conflict with 0029_reviews.sql from main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: remove brain-sidebar E2E tests

Brain tab was removed from the sidebar in this PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(e2e): increase split-pane reload timeout to reduce flakiness

The jotai atom reads localStorage asynchronously after hydration;
5s was sometimes too short in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Brad Harris <bmharris@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant