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.
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
|
|
/**
|
|
* Whether any section actually rendered.
|
|
*
|
|
* Every section decides for itself that it has nothing to say and returns
|
|
* null, so the panel cannot know in advance whether it is empty — and an empty
|
|
* panel is a bordered card holding nothing but its settings icon, which reads
|
|
* as a fault. Re-deriving each section's emptiness at the panel level would
|
|
* mean duplicating every data source it reads, so sections report instead.
|
|
*/
|
|
export const PresenceContext = React.createContext<((id: string, present: boolean) => void) | null>(null);
|
|
|
|
/** Call from a section with whether it rendered anything this pass. */
|
|
export const useReportWorkStatusPresence = (id: string, present: boolean): void => {
|
|
const report = React.useContext(PresenceContext);
|
|
React.useEffect(() => {
|
|
report?.(id, present);
|
|
// Leaving the set on unmount, so a section that stops rendering entirely
|
|
// does not keep the panel alive.
|
|
return () => report?.(id, false);
|
|
}, [id, present, report]);
|
|
};
|