web: add chat model picker, agent badges and a preloaded brief
Show the current model under the chat title with an OpenCode-backed picker, put an agent mark on the right of every chat row, simplify the tool summary to 'N tools', and give the reasoning and tool controls one symmetric hover box. New chats preload an editable behavior brief, and the activity spinner remains the turn's single live progress indicator.
This commit is contained in:
+7
-3
@@ -135,6 +135,9 @@ export const CHAT_CREATE_PROMPT = "Where should this chat live?";
|
||||
export const CHAT_CREATE_MODEL_NOTE =
|
||||
"This server has no request for choosing a chat's model, so a new chat uses the server's default.";
|
||||
export const CHAT_CREATE_CONFIRM = "New chat";
|
||||
/** The behavior brief preloaded into a new web chat's session instructions. */
|
||||
export const DEFAULT_CHAT_INSTRUCTIONS =
|
||||
"Act as a careful coding agent. Read the repository's AGENTS.md and the relevant skills before acting. Inspect the current state, keep changes scoped to the request, run the relevant checks, and report exactly what changed and what was not verified. Ask only about real ambiguity, destructive actions or changes outside the request.";
|
||||
export const CHAT_CREATE_CANCEL = "Cancel";
|
||||
|
||||
/** The create footer's line: `Start in {directory}` with the value that is sent. */
|
||||
@@ -195,11 +198,11 @@ export function toolLabel(part) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A turn's one summary chip: `N tools called`, and `1 tool called` for a single
|
||||
* call — a count of one is never pluralised.
|
||||
* A turn's one summary chip: `N tools`, and `1 tool` for a single call — a
|
||||
* count of one is never pluralised.
|
||||
*/
|
||||
export function toolCallsLabel(count) {
|
||||
return count === 1 ? "1 tool called" : `${count} tools called`;
|
||||
return count === 1 ? "1 tool" : `${count} tools`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -986,6 +989,7 @@ export function newChatCreateState(operationId) {
|
||||
return {
|
||||
directory: HOME_DIRECTORY,
|
||||
backend: "opencode",
|
||||
instructions: DEFAULT_CHAT_INSTRUCTIONS,
|
||||
operationId: str(operationId),
|
||||
creating: false,
|
||||
error: "",
|
||||
|
||||
Reference in New Issue
Block a user