Skip to content

Add the work-context sidebar to the desktop session workspace - #763

Merged
alexeyzimarev merged 30 commits into
mainfrom
alexeyzimarev/ai-2198-desktop-shell-work-context-sidebar
Sep 4, 2026
Merged

alexeyzimarev merged 30 commits into
mainfrom
alexeyzimarev/ai-2198-desktop-shell-work-context-sidebar

Conversation

@alexeyzimarev

Copy link
Copy Markdown
Member

AI-2198 — no GitHub issue exists for this slice, so the closing keyword is omitted.

What & why

The session workspace gains a 400px right column showing the session's work item, its declared parts and blockers, its pull requests, who is attached, and the session's facts. It reads the three work-item routes the server already exposes over HTTP; what the server serves only in-process to its dashboard (state, overview, per-part completion, links with URL and state, contributors) renders as a SOON pill until a read endpoint exists. The daemon puts session_id and branch on the status wire so the pane can key its reads on the session the server knows.

Where to look

WorkContextViewModel leases each read on the session id and merges results per section, so a switch drops the old session's result and a section blip dims the pane instead of blanking it. ServerWorkContextSource holds its HTTP client by lease so overlapping reads never see it disposed. The tracker key is split off the server's "KEY — title" label composition, a convention rather than a contract; a change there shows the whole label as the title.

Verification

TMPDIR=/private/tmp dotnet test --solution Capacitor.slnx on the branch head:

Suite Passed Failed Note
Capacitor.App.Tests.Unit 1368 0
Capacitor.Cli.Core.Tests.Unit 2966 1 Pump_exception_losing_to_writer_connection_lost_is_reported_once, timing budget; class alone 33/33
Capacitor.Cli.Daemon.Tests.Unit 2953 3 Installed_codex_schema_matches_the_vendored_pin (local Codex newer than the pin); two timing budgets, classes alone 5/5 and 47/47
Capacitor.Cli.Tests.Unit 3923 1 memory_store_initialization_failure_does_not_suppress_session_start_capture, timing budget; class alone 59/59
Capacitor.Cli.Tests.Integration 240 0

dotnet publish src/Capacitor.Cli/Capacitor.Cli.csproj -c Release 2>&1 | grep -E 'IL[23][01][0-9]{2}' prints nothing.

🤖 Generated with Claude Code

alexeyzimarev and others added 25 commits September 3, 2026 19:56
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

AI-2198

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T07:51:15.160461Z 30936a7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add work-context sidebar to desktop session workspaces

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Adds a fixed sidebar for work items, blockers, pull requests, people, and session facts.
• Reads authenticated server endpoints with session-safe polling and stale-section retention.
• Extends daemon status with session and branch metadata, backed by comprehensive tests.
Diagram

graph TD
  daemon["Daemon Runtime"] --> status["Status IPC"] --> workspace["Workspace VM"] --> context["Context VM"] --> view["Sidebar View"]
  context --> source["Server Source"] --> reader["Core Reader"] --> api["Server APIs"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Add a complete server endpoint first
  • ➕ Would provide lifecycle, overview, completion, issue, and contributor data immediately
  • ➕ Would remove label parsing and several SOON placeholders
  • ➖ Requires a coordinated cross-repository release
  • ➖ Blocks the usable sidebar on server work and older-server compatibility
2. Proxy reads through the daemon
  • ➕ Keeps desktop networking behind the existing daemon boundary
  • ➕ Could centralize authentication and polling
  • ➖ Requires a new capability-gated IPC frame family
  • ➖ Adds protocol complexity for read-only HTTP data already available to the app
3. Keep contracts app-local
  • ➕ Reduces the initial Core surface
  • ➕ Keeps desktop-specific DTOs close to their only current consumer
  • ➖ Duplicates contracts when CLI or daemon consumers need work-context reads
  • ➖ Weakens NativeAOT contract registration and reusable reader testing

Recommendation: Keep the PR's approach: expose additive daemon identity fields, place reusable HTTP contracts and classification in Core, and let the app own polling and presentation. It delivers the available value without cross-repository coupling, while SOON placeholders and tolerant DTOs preserve a clear upgrade path when a richer server endpoint arrives.

Files changed (41) +6913 / -47

Enhancement (20) +1208 / -32
App.axamlAdd the dim purple sidebar resource +1/-0

Add the dim purple sidebar resource

• Adds the purple background brush used by SOON pills in the work-context view.

src/Capacitor.App/App.axaml

App.axaml.csCompose and own work-context server services +27/-25

Compose and own work-context server services

• Builds one app-scoped work-context source, passes it and sign-in notifications into workspaces, and groups it with the launch client under memoized asynchronous cleanup.

src/Capacitor.App/App.axaml.cs

IWorkContextSource.csDefine the app work-context read seam +8/-0

Define the app work-context read seam

• Introduces the session-keyed abstraction consumed by the sidebar view model.

src/Capacitor.App/Services/IWorkContextSource.cs

ServerWorkContextSource.csAdd the authenticated leased work-context source +148/-0

Add the authenticated leased work-context source

• Creates and reuses an authenticated HTTP client while protecting overlapping reads with borrower leases. Signed-out clients are retired safely, and source disposal cancels and drains active operations.

src/Capacitor.App/Services/ServerWorkContextSource.cs

WorkContextItems.csAdd sidebar item view models +39/-0

Add sidebar item view models

• Defines declared-part projections and policy-checked pull-request link commands, including safe handling of opener failures.

src/Capacitor.App/ViewModels/WorkContextItems.cs

WorkContextViewModel.Projections.csProject and merge work-context sections +167/-0

Project and merge work-context sections

• Maps assignments, topology, summary links, requester details, blockers, and cycle information into bindable collections. Failed sections retain previous data while authoritative empty results clear it.

src/Capacitor.App/ViewModels/WorkContextViewModel.Projections.cs

WorkContextViewModel.csAdd session-leased sidebar state and polling +272/-0

Add session-leased sidebar state and polling

• Implements sidebar phases, session facts, immediate and 30-second reads, manual refresh, sign-in refresh, stale-state handling, and race-safe session switching. Teardown cancels and awaits every outstanding lease.

src/Capacitor.App/ViewModels/WorkContextViewModel.cs

WorkspaceViewModel.csAttach work context to each workspace +11/-3

Attach work context to each workspace

• Builds the work-context model from the workspace's shared presence stream and tears it down between chat and terminal cleanup.

src/Capacitor.App/ViewModels/WorkspaceViewModel.cs

MainWindow.axamlProtect the workspace's minimum width +1/-1

Protect the workspace's minimum width

• Pins the minimum window width to 1200px so the fixed rail and sidebar cannot collapse the central workspace.

src/Capacitor.App/Views/MainWindow.axaml

WorkContextView.axamlRender the work-context sidebar +254/-0

Render the work-context sidebar

• Adds the complete scrollable sidebar UI for work-item details, parts, blockers, pull requests, requester information, session facts, loading states, actions, and SOON placeholders.

src/Capacitor.App/Views/WorkContextView.axaml

WorkContextView.axaml.csInitialize sidebar view behavior +14/-0

Initialize sidebar view behavior

• Adds the Avalonia control code-behind and enables window dragging from the sidebar header.

src/Capacitor.App/Views/WorkContextView.axaml.cs

WorkspaceView.axamlAdd the fixed sidebar workspace column +6/-1

Add the fixed sidebar workspace column

• Wraps the existing workspace in a two-column grid and hosts the work-context view in a fixed 400px right column.

src/Capacitor.App/Views/WorkspaceView.axaml

StatusIpc.csExtend agent status with session metadata +8/-1

Extend agent status with session metadata

• Adds trailing nullable session ID and branch fields to the additive local status wire contract.

src/Capacitor.Cli.Core/LocalIpc/StatusIpc.cs

IWorkContextChannel.csDefine work-context HTTP outcomes and routes +15/-0

Define work-context HTTP outcomes and routes

• Introduces a typed outcome model and testable channel interface for assignments, topology, and session-summary reads.

src/Capacitor.Cli.Core/WorkItems/IWorkContextChannel.cs

WorkContextClient.csImplement the work-context HTTP channel +56/-0

Implement the work-context HTTP channel

• Calls the three existing server routes with canonicalized, escaped identifiers and source-generated JSON metadata. Transport and parsing failures become typed outcomes while caller cancellation propagates.

src/Capacitor.Cli.Core/WorkItems/WorkContextClient.cs

WorkContextDtos.csModel server work-context responses +84/-0

Model server work-context responses

• Adds explicit JSON DTOs for assignments, topology, repositories, pull requests, session summaries, and shared work-item errors.

src/Capacitor.Cli.Core/WorkItems/WorkContextDtos.cs

WorkContextIds.csContain identifiers used in HTTP routes +13/-0

Contain identifiers used in HTTP routes

• Canonicalizes session IDs, rejects empty or dot-segment identifiers, and validates work-item IDs before URL escaping.

src/Capacitor.Cli.Core/WorkItems/WorkContextIds.cs

WorkContextLabel.csSplit conventional work-item labels +17/-0

Split conventional work-item labels

• Extracts keys from the server's conventional “KEY — title” labels and safely falls back to display-only text.

src/Capacitor.Cli.Core/WorkItems/WorkContextLabel.cs

WorkContextReader.csCompose work-context routes into one result +64/-0

Compose work-context routes into one result

• Runs assignments and summary reads concurrently, conditionally loads primary-item topology, and classifies authentication, plan, session, malformed-response, and partial-section outcomes.

src/Capacitor.Cli.Core/WorkItems/WorkContextReader.cs

AgentOrchestrator.LocalIpc.csPublish session ID and branch in status snapshots +3/-1

Publish session ID and branch in status snapshots

• Populates status metadata from transcript discovery or ACP handshake state and normalizes blank checkout branches to null.

src/Capacitor.Cli.Daemon/Services/AgentOrchestrator.LocalIpc.cs

Tests (16) +1505 / -15
FakeWorkContextSource.csAdd a controllable work-context test source +38/-0

Add a controllable work-context test source

• Provides queued and gated responses, requested-session tracking, and in-flight counts for deterministic polling and race tests.

test/Capacitor.App.Tests.Unit/FakeWorkContextSource.cs

MainWindowSmokeTests.csCover sidebar-aware main-window sizing +15/-3

Cover sidebar-aware main-window sizing

• Updates workspace factories with the new source dependency and verifies the main window's 1200px minimum width.

test/Capacitor.App.Tests.Unit/MainWindowSmokeTests.cs

MainWindowViewModelTests.csSupply work context in window tests +1/-1

Supply work context in window tests

• Updates the test workspace factory for the new work-context source dependency.

test/Capacitor.App.Tests.Unit/MainWindowViewModelTests.cs

ServerClientsTests.csVerify coordinated server-client cleanup +78/-0

Verify coordinated server-client cleanup

• Tests cleanup ordering, fault isolation, exactly-once disposal under concurrent calls, and sign-in signal behavior before and after teardown.

test/Capacitor.App.Tests.Unit/ServerClientsTests.cs

ServerWorkContextSourceTests.csVerify leased HTTP-client ownership +173/-0

Verify leased HTTP-client ownership

• Covers signed-out construction, auth rejection, client retirement, overlapping borrowers, source disposal, no-auth servers, and caller cancellation.

test/Capacitor.App.Tests.Unit/ServerWorkContextSourceTests.cs

WorkContextViewModelTests.csExercise sidebar state, races, and projections +638/-0

Exercise sidebar state, races, and projections

• Comprehensively tests session facts, phases, polling, refresh and sign-in behavior, lease switching, teardown, stale-section retention, topology projections, links, requesters, and expansion controls.

test/Capacitor.App.Tests.Unit/WorkContextViewModelTests.cs

WorkspaceFixtures.csExtend agent status test fixtures +4/-2

Extend agent status test fixtures

• Allows shared workspace fixtures to supply session ID and branch values.

test/Capacitor.App.Tests.Unit/WorkspaceFixtures.cs

WorkspaceNavigationTests.csSupply work context in navigation tests +1/-1

Supply work context in navigation tests

• Updates navigated workspace construction for the required source dependency.

test/Capacitor.App.Tests.Unit/WorkspaceNavigationTests.cs

WorkspaceViewModelTests.csVerify workspace work-context integration +27/-1

Verify workspace work-context integration

• Updates construction helpers and confirms the sidebar consumes shared presence and stops receiving updates after workspace teardown.

test/Capacitor.App.Tests.Unit/WorkspaceViewModelTests.cs

WorkspaceViewSmokeTests.csSmoke-test sidebar controls and layout +29/-2

Smoke-test sidebar controls and layout

• Verifies all named sidebar controls resolve and confirms the sidebar remains 400px wide while the terminal receives the remaining width.

test/Capacitor.App.Tests.Unit/WorkspaceViewSmokeTests.cs

StatusIpcJsonTests.csPin session metadata wire compatibility +37/-5

Pin session metadata wire compatibility

• Updates exact JSON contracts and verifies session ID and branch ordering, null emission, populated serialization, and compatibility with older payloads.

test/Capacitor.Cli.Core.Tests.Unit/LocalIpc/StatusIpcJsonTests.cs

WorkContextClientTests.csTest work-context HTTP routing and containment +144/-0

Test work-context HTTP routing and containment

• Covers all routes, session canonicalization, path escaping, dot-segment refusal, typed errors, malformed JSON, transport failures, and cancellation propagation.

test/Capacitor.Cli.Core.Tests.Unit/WorkItems/WorkContextClientTests.cs

WorkContextDtoTests.csPin work-context server DTO shapes +80/-0

Pin work-context server DTO shapes

• Deserializes representative server payloads, verifies null-list normalization and extra-field tolerance, and confirms source-generated metadata for every root type.

test/Capacitor.Cli.Core.Tests.Unit/WorkItems/WorkContextDtoTests.cs

WorkContextLabelTests.csTest conventional work-item label parsing +33/-0

Test conventional work-item label parsing

• Covers keyed labels, display-only labels, bare keys, and malformed separators.

test/Capacitor.Cli.Core.Tests.Unit/WorkItems/WorkContextLabelTests.cs

WorkContextReaderTests.csTest composed work-context classification +168/-0

Test composed work-context classification

• Verifies primary selection, concurrent reads, authentication and plan gates, unknown sessions, malformed bodies, and section-level topology or summary degradation.

test/Capacitor.Cli.Core.Tests.Unit/WorkItems/WorkContextReaderTests.cs

AgentStatusSnapshotTests.csVerify daemon session metadata snapshots +39/-0

Verify daemon session metadata snapshots

• Tests PTY discovery and ACP handshake precedence for session IDs plus blank and populated branch normalization.

test/Capacitor.Cli.Daemon.Tests.Unit/Services/AgentStatusSnapshotTests.cs

Documentation (3) +4139 / -0
CHANGES.mdDocument the desktop work-context sidebar +31/-0

Document the desktop work-context sidebar

• Records the sidebar's data sources, session leasing behavior, label-format dependency, partial-data policy, and coordinated server-client cleanup.

docs/CHANGES.md

2026-09-03-ai2198-work-context-sidebar.mdAdd the sidebar implementation plan +3530/-0

Add the sidebar implementation plan

• Provides a task-by-task implementation and verification plan covering IPC, Core HTTP contracts, app composition, reactive state, UI layout, cleanup, and tests.

docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md

2026-09-03-ai2198-work-context-sidebar-design.mdSpecify the work-context sidebar design +578/-0

Specify the work-context sidebar design

• Defines the sidebar's scope, architecture, data mapping, failure states, polling model, visual treatment, test strategy, and known follow-ups.

docs/superpowers/specs/2026-09-03-ai2198-work-context-sidebar-design.md

Other (2) +61 / -0
ServerClients.csCentralize server-client lifecycle ownership +57/-0

Centralize server-client lifecycle ownership

• Owns the launch client, work-context source, and sign-in signal as one asynchronously disposable set. Cleanup is ordered, fault-isolated, and memoized across concurrent teardown paths.

src/Capacitor.App/Services/ServerClients.cs

Models.csRegister work-context JSON roots +4/-0

Register work-context JSON roots

• Registers assignment lists, topology, summary, and error DTOs with the source-generated JSON context for NativeAOT-safe deserialization.

src/Capacitor.Cli.Core/Models.cs

@qodo-code-review

qodo-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Commit subjects omit GitHub issues ✗ Dismissed 📘 Rule violation ⚙ Maintainability
Description
The PR's commit subjects do not end with the required (#<digits>) reference, and the
implementation plan explicitly instructs authors to omit it. This violates the mandatory
commit-subject format for every commit in the PR.
Code

docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20]

+- Commit subjects: one imperative clause, at most 80 characters, no issue reference (AI-2198 has no GitHub issue; do not invent one). Commit bodies end with `Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>`.
Relevance

●● Moderate

Rules favor references, but repository guidance permits omission when no GitHub issue exists; no
close commit-subject precedent found.

PR-#659
PR-#513

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2897961 requires every commit subject to end with a GitHub issue reference. The
changed plan explicitly directs that commit subjects contain no issue reference, and the supplied PR
commit subjects follow that instruction.

Rule 2897961: Enforce single-clause imperative commit subject with GitHub issue reference and 80-char limit
docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR commit subjects omit the mandatory trailing GitHub issue reference in `(#<digits>)` form.

## Issue Context
The implementation plan explicitly requires no issue reference, contrary to PR Compliance ID 2897961. Associate the work with an appropriate GitHub issue and update each commit subject while retaining a single imperative clause and the 80-character limit.

## Fix Focus Areas
- docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. PR reference line lacks GitHub 📘 Rule violation § Compliance
Description
The PR description's reference line includes AI-2198 but deliberately omits the required GitHub
closing keyword and issue reference. Both references must appear together on one line.
Code

docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20]

+- Commit subjects: one imperative clause, at most 80 characters, no issue reference (AI-2198 has no GitHub issue; do not invent one). Commit bodies end with `Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>`.
Relevance

● Weak

Recent template guidance explicitly permits dropping nonexistent reference halves when explained;
this PR explains the GitHub issue is absent.

PR-#659

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2897991 requires one reference line containing a GitHub closing keyword plus issue
number and a Linear key. The PR description contains only AI-2198, while the changed plan confirms
that omitting a GitHub reference was intentional.

Rule 2897991: PR description must contain both GitHub and Linear issue references; PR title must not contain issue IDs
docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR description lacks a reference line containing both a GitHub closing reference and the Linear issue key.

## Issue Context
The description currently states that the GitHub closing keyword was omitted because no GitHub issue exists. Create or identify the corresponding GitHub issue, then add a line such as `Closes #123 AI-2198`; keep issue IDs out of the PR title.

## Fix Focus Areas
- docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md[20-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 56 rules
Review mode: 🧠 Deep: This is a bug-dense cross-cutting feature spanning UI, asynchronous session-scoped HTTP reads, IPC/status contracts, daemon/core work-item logic, and many independent code paths, making redundant review materially valuable.

Grey Divider

Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread docs/superpowers/plans/2026-09-03-ai2198-work-context-sidebar.md
alexeyzimarev and others added 5 commits September 4, 2026 11:56
…-desktop-shell-work-context-sidebar

# Conflicts:
#	docs/CHANGES.md
The CI lint refuses Linear-shaped ids in C# source, test data included.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@alexeyzimarev
alexeyzimarev merged commit 3c301be into main Sep 4, 2026
6 checks passed
@alexeyzimarev
alexeyzimarev deleted the alexeyzimarev/ai-2198-desktop-shell-work-context-sidebar branch September 4, 2026 12:01
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