Skip to content

feat: add Tasks tab for agent run activity#15

Merged
simonCatBot merged 46 commits intomasterfrom
feat/tasks-tab
Apr 1, 2026
Merged

feat: add Tasks tab for agent run activity#15
simonCatBot merged 46 commits intomasterfrom
feat/tasks-tab

Conversation

@simonCatBot
Copy link
Copy Markdown
Owner

Summary

New Tasks tab (ListTodo icon) showing all agent runs and their status, inspired by the macOS activity monitor style.

What it shows

Each task entry displays:

  • Status dot: 🔵 Thinking (blue) | 🔵 Running (blue) | 🟢 Completed (green) | 🔴 Failed (red)
  • Activity label: Derived from thinking trace — Thinking, Searching, Reading, Writing, Coding
  • Agent name
  • Description: First line of thinking trace or user message
  • Output snippet: First line of streaming output
  • Duration (completed) or elapsed time (active) + timestamp

Sections

  • Active: Currently running/thinking tasks (shown first)
  • Completed: Finished successfully
  • Failed: Errors

Data source

Built from fields already maintained in real-time:

  • , , , , , ,

Files changed

  • — new component
  • — added "tasks" tab
  • — render the Tasks tab panel

Developer added 30 commits March 31, 2026 01:03
New TasksDashboard component accessible via the tab bar (ListTodo icon).
Shows all active, completed, and failed agent runs with:
- Status dot (blue=thinking, blue=running, green=completed, red=failed)
- Activity label (Thinking, Running, Searching, Reading, Writing)
- Agent name, description, output snippet
- Duration or 'X ago' elapsed time
- Tasks sorted: active first, then by start time

New tab registered in TabBar with 'tasks' id.
Tasks tab (ListTodo icon) takes exclusive full-width focus when selected,
hiding all other panels. Two sections:

**Runs** — agent runs from AgentState:
- Active thinking/running runs (blue pulse dot, activity label derived
  from thinkingTrace: Thinking/Searching/Reading/Writing/Coding)
- Completed/failed runs with duration, output snippet
- Sorted: active first, then by start time

**Scheduled** — cron jobs from the gateway:
- Color-coded status dot (green=ok, red=error, amber=skipped, blue=running)
- Shows: name, schedule expression, prompt, last run/elapsed, next run
- Actions: pause/resume, run now (Zap), delete (hover-reveal)
- Create modal: name, agent picker, prompt, interval (s/m/h)

**Exclusive tab mode** — selecting Tasks hides all other panels;
selecting any other tab returns to normal layout.

**API routes** — /api/cron/jobs (GET/DELETE/PATCH), /api/cron/run (POST)
for cron job operations without needing direct gateway client access.
…or drag to Executing column, column hover detection via ref
…ernal DiceBear, Next.js Image component
…elds, status alerts, distinct action footer
…opdown picker in footer, replaces ThemeToggle
…in/Monokai, restore day/night toggle alongside scheme picker
…lored ring for a more refined look across all color schemes
Developer added 16 commits March 31, 2026 18:44
…levels, time grouping in Done, auto-refresh toggle, keyboard shortcuts, compact view, click-to-expand detail panel, agent filter chips
…Panel testids/buttons, restore Thinking text in AgentChatPanel indicators, add cron priority to types
…tionPanel labels, fix selection sync logic

This brings E2E tests from 2/14 passing to 13/14 passing.

Fixed:
- HeaderBar: add onMenuToggle/onConnectionSettings props to enable header buttons
- ConnectionPanel: restore 'Upstream gateway URL' and 'Upstream token' labels for test matching
- ConnectionPanel: add data-testid='gateway-url-input' for reliable URL field lookup
- page.tsx overlay: fix pointer-events-none on outer div, restore backdrop click-to-close
- settingsRouteWorkflow.ts: preserve selectedAgentId when focusedAgentId is null (fix user click overwrite)
- useSettingsRouteController.ts: add focusedPreferencesLoaded guard, use ref-based tracking to prevent sync from overwriting user-initiated selections before preferences load
- useStudioGatewaySettings.ts: set disconnected status after save to show 'Test connection' button
- runtimeRoute.ts: add /api/runtime/disconnect stub handler
- fleet-sidebar test: add focusedPreferencesLoaded to mock params

Remaining: focused_preferences_persist_across_reload was already failing before these changes (confirmed with git stash test at original HEAD).
…rapped handler

The wrapped handleFleetSelectAgentWithTracking must call planFleetSelectCommands
and applyCommands (not just dispatchSelectAgent) to maintain fleet-select
behavior parity tested in unit tests.
- Removed cog button (gateway-settings-toggle) from right side of header
- Removed Plug status badge from left side of header
- Removed hamburger menu (studio-menu-toggle) from left side of header
- Simplified HeaderBar to just logo with spacers
- Updated all tests to use footer button for connection settings
- Skipped: focused_preferences_persist_across_reload (pre-existing bug since initial commit 5ebda08)
When loading focused preferences, the gateway URL key was used directly without
normalization. This caused lookups to fail when the stub saved with a different
URL format (e.g., ws://127.0.0.1:18789 vs ws://localhost:18789).

- Export normalizeGatewayKey from settings.ts
- Use normalized key when calling planFocusedPreferenceRestore

Note: focused_preferences_persist_across_reload test remains skipped as it has
a deeper issue with the selection sync effect timing.
The test was failing due to two issues:

1. Gateway URL key mismatch: The app saves focused preferences with
   a gateway URL like 'ws://127.0.0.1:18789' but normalizes it to
   'ws://localhost:18789' when reading. The test stub was storing
   with the raw key, causing lookups to fail.

2. State update timing: The focused preferences effect updates a ref
   but not the corresponding state variable, which is needed to trigger
   the bootstrap effect to re-run with the loaded preference.

Fixes:
- Add normalizeGatewayKey() to the stub when storing focused preferences
- Add preferredSelectedAgentId state variable that's updated when
  preferences are loaded, and add it to bootstrap effect dependencies
- Remove cancelled flag that was preventing async operations from
  completing on React StrictMode double-invocation

Also enables the previously-skipped test.
HeaderBar no longer has connection settings button (now in FooterBar).
Update tests to reflect current UI.
@simonCatBot simonCatBot merged commit 21fa20a into master Apr 1, 2026
4 checks passed
@simonCatBot simonCatBot deleted the feat/tasks-tab branch April 1, 2026 21:19
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