feat(chat): work-status panel, and MCP auth and settings fixes (#2776)

Adds a work-status panel beside the transcript. Context fill, model and
cost, todos, running subagents and the permission requests blocking
them, branch and working-tree state, MCP servers, pinned messages and
context sources were scattered across the header, the composer and the
context panel — a blocked subagent was reported nowhere at all. The
panel reads them from live channels rather than persisted history, and
becomes an overlay where the chat is too narrow to seat a column.

It is on by default, including for existing installs. Because it now
carries these readouts, the desktop header and composer drop the ones it
duplicates: todo and changed-files chips, usage and MCP tabs. VS Code
and mobile keep theirs — neither hosts the panel.

Fixes MCP authorization, which was broken from the panel, invalidated by
a directory switch through a redirect URI that encoded the working
directory, and left the desktop app in the background because browsers
will not follow a custom-protocol link without a user gesture. The
settings page no longer asks the user to understand the MCP spec before
adding a server: one field takes the command or the link, with the kind
inferred and a visible override, and client-registration fields appear
only when a server actually asks for its own credentials.

Also: skills load from the panel instead of only when the composer's
slash autocomplete opens; the header button names the current instance
rather than falling through to the word "Instance" for relay hosts.

Three new optional UI settings keys, all migrated. No change to stored
MCP server configuration.
This commit is contained in:
Bohdan Triapitsyn
2026-08-09 19:30:25 +03:00
parent 493a618efc
commit f4743ea060
69 changed files with 5777 additions and 894 deletions
@@ -18,6 +18,7 @@ import { useDirectoryStore } from '@/stores/useDirectoryStore';
import { useSessionUIStore } from '@/sync/session-ui-store';
import { useSelectionStore } from '@/sync/selection-store';
import * as sessionActions from '@/sync/session-actions';
import { buildLinkedIssue } from '@/lib/linkedIssues';
import { useConfigStore } from '@/stores/useConfigStore';
import { useUIStore } from '@/stores/useUIStore';
import { useGitHubAuthStore } from '@/stores/useGitHubAuthStore';
@@ -395,7 +396,7 @@ export function GitHubIssuePickerDialog({
const sessionTitle = `#${issue.number} ${issue.title}`.trim();
const { sessionId } = await (async () => {
const { sessionId, sessionDirectory } = await (async () => {
if (createInWorktree) {
const preferred = `issue-${issue.number}-${generateBranchSlug()}`;
const created = await createWorktreeSessionForNewBranch(
@@ -449,6 +450,23 @@ export function GitHubIssuePickerDialog({
const instructionsText = await renderMagicPrompt('github.issue.review.instructions');
const contextText = buildIssueContextText({ repo: issueRes.repo, issue, comments });
// Record the thread this session was created for, so it stays visible as
// a context source once the opening message has scrolled away. A
// snapshot, never re-fetched; a failed write must not fail the flow.
void sessionActions.setLinkedIssue(
sessionId,
sessionDirectory,
buildLinkedIssue({
url: issue.url,
number: issue.number,
title: issue.title,
kind: 'issue',
author: issue.author,
linkedAt: Date.now(),
}),
true,
).catch(() => undefined);
void useSessionUIStore.getState().sendMessage(
visiblePromptText,
providerID,
@@ -31,6 +31,7 @@ import { useUIStore } from '@/stores/useUIStore';
import { useSessionUIStore } from '@/sync/session-ui-store';
import { useSelectionStore } from '@/sync/selection-store';
import * as sessionActions from '@/sync/session-actions';
import { buildLinkedIssue } from '@/lib/linkedIssues';
import { useConfigStore } from '@/stores/useConfigStore';
import { validateWorktreeCreate, createWorktree } from '@/lib/worktrees/worktreeManager';
import { withWorktreeUpstreamDefaults } from '@/lib/worktrees/worktreeCreate';
@@ -536,6 +537,22 @@ export function NewWorktreeDialog({
{ sessionId: args.sessionId },
);
// Record the thread this worktree session was created for, so it stays
// visible as a context source after the opening message scrolls away.
void sessionActions.setLinkedIssue(
args.sessionId,
args.directory,
buildLinkedIssue({
url: issueRes.issue.url,
number: issueRes.issue.number,
title: issueRes.issue.title,
kind: 'issue',
author: issueRes.issue.author,
linkedAt: Date.now(),
}),
true,
).catch(() => undefined);
toast.success(t('session.newWorktree.toast.sessionFromIssue'));
return;
}
@@ -576,6 +593,20 @@ export function NewWorktreeDialog({
{ sessionId: args.sessionId },
);
void sessionActions.setLinkedIssue(
args.sessionId,
args.directory,
buildLinkedIssue({
url: prContext.pr.url,
number: prContext.pr.number,
title: prContext.pr.title,
kind: 'pull',
author: prContext.pr.author,
linkedAt: Date.now(),
}),
true,
).catch(() => undefined);
toast.success(t('session.newWorktree.toast.sessionFromPr'));
}
}, [