wip: context-meter + model-label UI and provider/inference tweaks
Checkpoint of in-flight work so the orchestrator branch can rebase onto a clean main: ContextBar → ContextMeter, model-label helper, model/agent picker + provider-snapshot/registry changes, inference payload + message-columns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,12 @@ export interface UseWorkspacePanesResult {
|
||||
closeTabsToRight: (paneIdx: number, pivotChatId: string) => void;
|
||||
closeAllTabs: (paneIdx: number) => void;
|
||||
showLandingPage: (paneIdx: number) => void;
|
||||
// Session-history view: which pane (by id) should render its landing in the
|
||||
// history list instead of the new-chat hero. Shared so the mobile header
|
||||
// button and the desktop pane-header menu drive the same controlled view.
|
||||
historyPaneId: string | null;
|
||||
openSessionHistory: (paneIdx: number) => void;
|
||||
closeSessionHistory: () => void;
|
||||
// v1.10.3: returns the new pane's id (or null if the operation was a no-op:
|
||||
// max panes reached). Callers can use the
|
||||
// id to update mobile URL state so the URL-sync effect doesn't fight the
|
||||
@@ -222,6 +228,7 @@ export function useWorkspacePanes(sessionId: string): UseWorkspacePanesResult {
|
||||
const [closedPaneStack, setClosedPaneStack] = useState<ClosedPaneEntry[]>([]);
|
||||
const draggingIdxRef = useRef<number | null>(null);
|
||||
const [dragOverIdx, setDragOverIdx] = useState<number | null>(null);
|
||||
const [historyPaneId, setHistoryPaneId] = useState<string | null>(null);
|
||||
// v1.12.1: skip PATCH while hydrating from the server. Without this, the
|
||||
// initial [emptyPane()] would be saved over the server's real state before
|
||||
// the GET resolves.
|
||||
@@ -696,6 +703,17 @@ export function useWorkspacePanes(sessionId: string): UseWorkspacePanesResult {
|
||||
});
|
||||
}, [sessionId]);
|
||||
|
||||
// Reveal the session-history list. Mirrors the desktop "Show history" action:
|
||||
// convert the pane to its landing (showLandingPage) and flag it so the landing
|
||||
// opens on the history list rather than the new-chat hero.
|
||||
const openSessionHistory = useCallback((paneIdx: number) => {
|
||||
const id = panes[paneIdx]?.id ?? null;
|
||||
showLandingPage(paneIdx);
|
||||
setHistoryPaneId(id);
|
||||
}, [panes, showLandingPage]);
|
||||
|
||||
const closeSessionHistory = useCallback(() => setHistoryPaneId(null), []);
|
||||
|
||||
const addSplitPane = useCallback((kind: 'chat' | 'terminal' | 'coder'): string | null => {
|
||||
// Generate the id outside the updater so we can return it deterministically.
|
||||
// setPanes's updater can be invoked twice in strict mode; using a fixed id
|
||||
@@ -991,6 +1009,9 @@ export function useWorkspacePanes(sessionId: string): UseWorkspacePanesResult {
|
||||
closeTabsToRight,
|
||||
closeAllTabs,
|
||||
showLandingPage,
|
||||
historyPaneId,
|
||||
openSessionHistory,
|
||||
closeSessionHistory,
|
||||
addSplitPane,
|
||||
createCoderTab,
|
||||
toggleSettingsPane,
|
||||
|
||||
Reference in New Issue
Block a user