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:
@@ -578,6 +578,33 @@ interface UIStore {
|
||||
contextEditorTreeWidth: number;
|
||||
notesPanelHeight: number;
|
||||
todoPanelHeight: number;
|
||||
/** Expanded collapsible sections of the in-chat work-status panel, by id. */
|
||||
workStatusExpandedSections: Record<string, boolean>;
|
||||
/** Scroll offset of that panel, so it survives being unmounted. */
|
||||
workStatusScrollTop: number;
|
||||
/** Whether the in-chat work-status panel may render at all. */
|
||||
workStatusPanelEnabled: boolean;
|
||||
/**
|
||||
* Whether it is actually on screen right now — the switch can be on while
|
||||
* layout still refuses it (narrow chat, open context panel). Transient, never
|
||||
* persisted: it describes the current frame, not a preference. The header
|
||||
* reads it to stop repeating what the panel already shows.
|
||||
*/
|
||||
workStatusPanelVisible: boolean;
|
||||
/** Layout can host the panel inline. Transient, like the one above. */
|
||||
workStatusPanelFits: boolean;
|
||||
/**
|
||||
* Shown over the chat because it does not fit beside it. Transient and never
|
||||
* persisted: it is a response to the current window, not a preference, and
|
||||
* the panel returns to its place as soon as there is room.
|
||||
*/
|
||||
workStatusOverlayOpen: boolean;
|
||||
/**
|
||||
* Sections the user switched off. Hidden rather than visible ones are
|
||||
* stored, so a section added later appears without touching saved settings.
|
||||
* Persisted to server settings, not just this browser.
|
||||
*/
|
||||
workStatusHiddenSections: string[];
|
||||
isSessionSwitcherOpen: boolean;
|
||||
isSessionDropdownOpen: boolean;
|
||||
activeMainTab: MainTab;
|
||||
@@ -739,6 +766,14 @@ interface UIStore {
|
||||
toggleContextPanelExpanded: (directory: string) => void;
|
||||
setContextPanelWidth: (directory: string, mode: ContextPanelMode, width: number) => void;
|
||||
setNotesPanelHeight: (height: number) => void;
|
||||
setWorkStatusSectionExpanded: (sectionId: string, expanded: boolean) => void;
|
||||
setWorkStatusScrollTop: (scrollTop: number) => void;
|
||||
setWorkStatusPanelEnabled: (enabled: boolean) => void;
|
||||
setWorkStatusPanelVisible: (visible: boolean) => void;
|
||||
setWorkStatusPanelFits: (fits: boolean) => void;
|
||||
setWorkStatusOverlayOpen: (open: boolean) => void;
|
||||
setWorkStatusSectionVisible: (sectionId: string, visible: boolean) => void;
|
||||
setWorkStatusHiddenSections: (sectionIds: string[]) => void;
|
||||
setTodoPanelHeight: (height: number) => void;
|
||||
setSessionSwitcherOpen: (open: boolean) => void;
|
||||
setSessionDropdownOpen: (open: boolean) => void;
|
||||
@@ -904,6 +939,13 @@ export const useUIStore = create<UIStore>()(
|
||||
contextEditorTreeVisible: true,
|
||||
contextEditorTreeWidth: 240,
|
||||
notesPanelHeight: 112,
|
||||
workStatusExpandedSections: {},
|
||||
workStatusScrollTop: 0,
|
||||
workStatusPanelEnabled: true,
|
||||
workStatusPanelVisible: false,
|
||||
workStatusPanelFits: false,
|
||||
workStatusOverlayOpen: false,
|
||||
workStatusHiddenSections: [],
|
||||
todoPanelHeight: 259,
|
||||
isSessionSwitcherOpen: false,
|
||||
isSessionDropdownOpen: false,
|
||||
@@ -1438,6 +1480,63 @@ export const useUIStore = create<UIStore>()(
|
||||
set({ notesPanelHeight: height });
|
||||
},
|
||||
|
||||
setWorkStatusSectionExpanded: (sectionId, expanded) => {
|
||||
set((state) => (
|
||||
state.workStatusExpandedSections[sectionId] === expanded
|
||||
? state
|
||||
: {
|
||||
workStatusExpandedSections: {
|
||||
...state.workStatusExpandedSections,
|
||||
[sectionId]: expanded,
|
||||
},
|
||||
}
|
||||
));
|
||||
},
|
||||
|
||||
setWorkStatusScrollTop: (scrollTop) => {
|
||||
set({ workStatusScrollTop: Math.max(0, scrollTop) });
|
||||
},
|
||||
|
||||
setWorkStatusPanelEnabled: (enabled) => {
|
||||
set({ workStatusPanelEnabled: enabled });
|
||||
},
|
||||
|
||||
setWorkStatusPanelVisible: (visible) => {
|
||||
set((state) => (state.workStatusPanelVisible === visible ? state : { workStatusPanelVisible: visible }));
|
||||
},
|
||||
|
||||
setWorkStatusPanelFits: (fits) => {
|
||||
set((state) => {
|
||||
if (state.workStatusPanelFits === fits) return state;
|
||||
// Room again: the panel goes back to its place, so an overlay left
|
||||
// open would duplicate it.
|
||||
return fits
|
||||
? { workStatusPanelFits: true, workStatusOverlayOpen: false }
|
||||
: { workStatusPanelFits: false };
|
||||
});
|
||||
},
|
||||
|
||||
setWorkStatusOverlayOpen: (open) => {
|
||||
set((state) => (state.workStatusOverlayOpen === open ? state : { workStatusOverlayOpen: open }));
|
||||
},
|
||||
|
||||
setWorkStatusSectionVisible: (sectionId, visible) => {
|
||||
set((state) => {
|
||||
const hidden = state.workStatusHiddenSections;
|
||||
const isHidden = hidden.includes(sectionId);
|
||||
if (visible === !isHidden) return state;
|
||||
return {
|
||||
workStatusHiddenSections: visible
|
||||
? hidden.filter((entry) => entry !== sectionId)
|
||||
: [...hidden, sectionId],
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
setWorkStatusHiddenSections: (sectionIds) => {
|
||||
set({ workStatusHiddenSections: [...new Set(sectionIds)] });
|
||||
},
|
||||
|
||||
setTodoPanelHeight: (height) => {
|
||||
set({ todoPanelHeight: height });
|
||||
},
|
||||
@@ -2314,6 +2413,18 @@ export const useUIStore = create<UIStore>()(
|
||||
|
||||
// v8 -> v9: initialize notes/todo panel height fields
|
||||
if (version < 9) {
|
||||
if (!state.workStatusExpandedSections || typeof state.workStatusExpandedSections !== 'object') {
|
||||
state.workStatusExpandedSections = {};
|
||||
}
|
||||
if (typeof state.workStatusScrollTop !== 'number' || !Number.isFinite(state.workStatusScrollTop)) {
|
||||
state.workStatusScrollTop = 0;
|
||||
}
|
||||
if (typeof state.workStatusPanelEnabled !== 'boolean') {
|
||||
state.workStatusPanelEnabled = true;
|
||||
}
|
||||
if (!Array.isArray(state.workStatusHiddenSections)) {
|
||||
state.workStatusHiddenSections = [];
|
||||
}
|
||||
if (typeof state.notesPanelHeight !== 'number' || !Number.isFinite(state.notesPanelHeight)) {
|
||||
state.notesPanelHeight = 112;
|
||||
}
|
||||
@@ -2413,6 +2524,10 @@ export const useUIStore = create<UIStore>()(
|
||||
contextEditorTreeVisible: state.contextEditorTreeVisible,
|
||||
contextEditorTreeWidth: state.contextEditorTreeWidth,
|
||||
notesPanelHeight: state.notesPanelHeight,
|
||||
workStatusExpandedSections: state.workStatusExpandedSections,
|
||||
workStatusScrollTop: state.workStatusScrollTop,
|
||||
workStatusPanelEnabled: state.workStatusPanelEnabled,
|
||||
workStatusHiddenSections: state.workStatusHiddenSections,
|
||||
todoPanelHeight: state.todoPanelHeight,
|
||||
isSessionSwitcherOpen: state.isSessionSwitcherOpen,
|
||||
activeMainTab: state.activeMainTab,
|
||||
|
||||
Reference in New Issue
Block a user