Skip to content

web: Add Tasks to the monitoring sidebar - #1681

Merged
cliffhall merged 2 commits into
v2/mainfrom
v2/1680-tasks-monitoring-sidebar
Jul 13, 2026
Merged

cliffhall merged 2 commits into
v2/mainfrom
v2/1680-tasks-monitoring-sidebar

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #1680

Makes Tasks a pinnable panel in the monitoring sidebar (#1616) alongside Logs / Protocol / Network / Console, so a live task list can be watched beside any screen.

Changes

  • InspectorView.tsx — added a TASKS_TAB constant; extended the MonitorTab union, the MONITOR_TABS membership set, and the isMonitorTab guard. Added a monitorScreens[TASKS_TAB] entry rendering <TasksScreen … embedded> with the shared monitorSearch injected into ui.search, built from a new shared tasksScreenProps object — and refactored the full-size Tasks screen to use the same object so the two instances can't drift (matching the Logs/Protocol/Network pattern).
  • TasksScreen — new embedded prop mirroring LoggingScreen: fills the column height (h: 100%) and drops the controls sidebar so the narrow column is list-only.
  • TaskListPanel — new embedded prop; swaps the raw viewport-calc ScrollArea.Autosize for EmbeddableScrollArea embedded={embedded}. EmbeddableScrollArea's full-size mah is the same calc the panel used before, so the standalone Tasks screen is byte-for-byte unchanged.

Notes

  • Capability-gated: Tasks only appears in the monitor group when the server advertises the tasks capability (already surfaced by availableTabs), so monitorAvailable picks it up once it's in MONITOR_TABS; the failed-connect subset needs no change (no tasks without a live session).
  • When the column is open, Tasks moves from the header into the column's panel switcher, exactly like the other monitor panels.

Verification

  • Embedded panel renders correctly (controls dropped, list scrolls via EmbeddableScrollArea); full-size Tasks screen unchanged; capability-gating confirmed.
  • npm run validate (format/lint/build/unit) + Storybook a11y gate + npm run coverage (≥90 per-file, 3957 tests) — all green locally.

🤖 Generated with Claude Code

Make Tasks a pinnable panel in the monitoring sidebar alongside
Logs / Protocol / Network / Console, so a live task list can be watched
beside any screen.

- InspectorView: add TASKS_TAB, extend the MonitorTab union / MONITOR_TABS
  / isMonitorTab, and add a monitorScreens[TASKS_TAB] entry built from a
  shared tasksScreenProps object (so the embedded and full-size instances
  can't drift), with the shared column search injected into its ui.search.
  The full-size Tasks screen now uses the same shared props.
- TasksScreen / TaskListPanel: add an embedded prop mirroring
  LoggingScreen/LogStreamPanel — when embedded the screen fills its column
  height and drops the controls sidebar, and TaskListPanel scrolls via
  EmbeddableScrollArea (whose full-size cap matches the old viewport calc,
  so the standalone screen is unchanged).

Tasks is capability-gated: it only appears in the monitor group when the
server advertises the tasks capability (via availableTabs), so no change
is needed to the failed-connect subset.

Closes #1680

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Jul 13, 2026
@cliffhall

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 3m 23s —— View job


Review: Tasks in the monitoring sidebar

  • Read changed files & diff
  • Review InspectorView.tsx changes
  • Review TasksScreen / TaskListPanel / EmbeddableScrollArea
  • Check tests & coverage
  • Post review feedback

Overall this is a clean, faithful extension of the Logs/Protocol/Network monitor-panel pattern. The MonitorTab union, MONITOR_TABS, and isMonitorTab are all updated consistently; the shared tasksScreenProps object nicely prevents the two TasksScreen instances from drifting; and the capability-gating claim checks out — availableTabs already gates Tasks on capabilities.tasks, and monitorAvailable (InspectorView.tsx:815) filters availableTabs through MONITOR_TABS, so no failed-connect change is needed. The EmbeddableScrollArea swap in TaskListPanel matches LogStreamPanel exactly, so the standalone screen stays byte-for-byte identical.

I found one substantive inconsistency with the sibling panels worth addressing, plus a couple of minor notes.


1. Embedded TaskListPanel still applies statusFilter — the siblings deliberately don't (TaskListPanel.tsx:56-69, 115)

The three sibling monitor panels each explicitly ignore their non-search filter when embedded, because the embedded column exposes only the shared search box (the filter controls live in the full-size sidebar, which the embedded view drops):

  • LogStreamPanel → ignoreLevels (LogStreamPanel.tsx:54)
  • NetworkStreamPanel → ignoreCategories (NetworkStreamPanel.tsx:67)
  • ProtocolListPanel → ignoreDirectionAndMethod (ProtocolListPanel.tsx:193)

TaskListPanel.matchesFilters has no such flag — it applies statusFilter unconditionally, and the embedded instance receives statusFilter straight from tasksUi (InspectorView.tsx:1093, only search is overridden). So if a user sets a status filter (e.g. working) on the full-size Tasks screen, then opens the monitor column, the embedded panel silently filters to that status with no visible control to see or clear it — exactly the situation the ignore* flags were introduced to prevent (#1616). This is the one place the PR's "matching the Logs/Protocol/Network pattern" claim doesn't quite hold.

Suggested fix — thread embedded into matchesFilters and skip statusFilter when embedded, mirroring the siblings:

function matchesFilters(
  task: Task,
  searchText: string,
  statusFilter: TaskStatus | undefined,
  // Embedded column exposes only the search box (its status filter lives in the
  // full-size sidebar), so it applies text only. See LogStreamPanel (#1616).
  ignoreStatus: boolean,
): boolean {
  if (!ignoreStatus && statusFilter && task.status !== statusFilter) return false;
  // ...text filter unchanged
}
// call site: matchesFilters(t, searchText, statusFilter, embedded)

Fix this →

If keeping the filter is intentional (arguable — inheriting it could be seen as a feature), it'd be worth a one-line comment noting the deliberate divergence from the siblings, since the PR description says it mirrors them.


Minor notes (non-blocking)

  • Default monitor tab unchanged — good. Tasks now leads MONITOR_TABS, but MONITOR_TAB_DEFAULT is still LOGS_TAB and effectiveMonitorTab honors the stored/default monitorTab whenever it's available (InspectorView.tsx:927-930), so a normal connect still lands on Logs. Tasks only becomes the fallback when the stored tab isn't available (e.g. a server with tasks but no logging) — sensible. Confirmed the existing default-tab assertion (InspectorView.test.tsx:1883) still holds.
  • Test coverage. The embedded TaskListPanel branch (embedded={true} → EmbeddableScrollArea) is exercised via the new TasksScreen embedded test, so the branch is covered. Consider adding a direct assertion that the Tasks radio appears and renders in the monitor column (like the Console/Network monitor-tab tests) — nice-to-have, not required. If you take the fix above, add a test for the ignored-status-filter behavior.
  • Clear button + ListToggle remain in the embedded panel header — consistent with LogStreamPanel keeping Clear/Export/Sort in embedded mode, so this is correct.

Nice work — the shared-props refactor and the EmbeddableScrollArea reuse make this a tidy change. Only #1 above is worth a decision before merge.
· v2/1680-tasks-monitoring-sidebar

Mirror the sibling monitor panels: the embedded column exposes only the
shared search box (its status filter lives in the full-size sidebar,
which the embedded view drops), so a stale status filter must not
silently hide tasks with no visible control to clear it. Thread an
`ignoreStatus` flag into TaskListPanel.matchesFilters, set from the
`embedded` prop — matching LogStreamPanel's `ignoreLevels`,
NetworkStreamPanel's `ignoreCategories`, and ProtocolListPanel's
`ignoreDirectionAndMethod` (#1616). Add tests for the ignored-status /
still-applied-search embedded behavior, plus a direct assertion that the
Tasks radio appears in the monitor column.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cliffhall

Copy link
Copy Markdown
Member Author

Thanks — good catch on #1. Addressed it:

#1 — embedded status filter → fixed to match the siblings. Threaded an ignoreStatus flag into TaskListPanel.matchesFilters (set from the embedded prop), so the embedded column applies text only and ignores statusFilter — mirroring LogStreamPanel's ignoreLevels, NetworkStreamPanel's ignoreCategories, and ProtocolListPanel's ignoreDirectionAndMethod (#1616). A stale status filter set on the full-size screen no longer silently hides tasks in the column, which has no control to clear it. I opted to fix rather than keep-and-comment, since keeping it reintroduces exactly the invisible-filter problem those flags exist to prevent.

Tests — added the two you suggested: the embedded panel ignores a set statusFilter (shows all) but still applies the search text, and a direct assertion that the Tasks radio appears in the monitor column (and leaves the header) when the server advertises the tasks capability.

Minor notes acknowledged (default monitor tab still Logs; Clear/ListToggle kept in the embedded header like LogStreamPanel). validate + a11y gate + coverage (3959 tests) green.

@claude review

@claude

claude Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 49s —— View job


Re-review: embedded status-filter fix

  • Read the new commit (embedded ignores status filter)
  • Verify TaskListPanel ignoreStatus threading matches siblings
  • Verify new tests
  • Post review

The fix in 3813b0d2 resolves my one substantive finding cleanly and faithfully mirrors the sibling panels. ✅ Ship it.

matchesFilters — matches the sibling shape exactly. ignoreStatus is now a required positional flag threaded from the embedded prop, and the guard reads if (!ignoreStatus && statusFilter && task.status !== statusFilter). This is byte-for-byte the same structure as:

  • LogStreamPanel → ignoreLevels (LogStreamPanel.tsx:54,56)
  • NetworkStreamPanel → ignoreCategories (NetworkStreamPanel.tsx:67,69)
  • ProtocolListPanel → ignoreDirectionAndMethod (ProtocolListPanel.tsx:193,196)

The useMemo dep array correctly adds embedded (TaskListPanel.tsx:96), so a live toggle between full-size and embedded recomputes the filter — no stale memo. The clarifying comment on the param is good and points back to #1616. Agree with the decision to fix rather than keep-and-comment: inheriting an invisible filter is exactly the trap the ignore* flags were introduced to close.

Tests — accurate against the fixtures. I checked both new TaskListPanel cases against sampleTasks (working, input_required, completed, failed):

  • ignores status filter when embedded — statusFilter="working" + embedded asserts Active (2) (working + input_required) and Completed (2) (completed + failed), i.e. the filter is dropped and all four show. Correct — without the fix this would be Active (1).
  • still applies search when embedded — statusFilter="working" + searchText="Connection" + embedded asserts Completed (1) and no Active. "Connection" matches only task-failed-1's statusMessage "Connection refused" (a completed-group status), so the status filter is ignored but the text filter still narrows. Correct, and it nicely proves the two filters are independent under embedded.

The InspectorView additions also land the direct assertion I suggested: Tasks leaves the header (InspectorView.test.tsx:1879) and appears as a column radio (:1891) when the server advertises tasks.

Nothing else outstanding — the minor notes from the first pass were all acknowledged and were non-blocking. Nice, tight follow-up.
· v2/1680-tasks-monitoring-sidebar

@cliffhall

Copy link
Copy Markdown
Member Author

Thanks for the thorough re-review! 🙏 The one substantive point is resolved and everything else was non-blocking, so closing the review loop here.

@cliffhall cliffhall linked an issue Jul 13, 2026 that may be closed by this pull request
@cliffhall
cliffhall merged commit 590359a into v2/main Jul 13, 2026
3 checks passed
@cliffhall
cliffhall deleted the v2/1680-tasks-monitoring-sidebar branch July 13, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: Add Tasks to the monitoring sidebar

1 participant