Placeholder text

This commit is contained in:
Ian Gulliver
2026-10-15 21:56:59 -07:00
parent 2ce10a6c65
commit 4540a63901
10 changed files with 14 additions and 24 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ const leadSource: ChatSource = {
streamTopic: "lead.stream",
empty: "",
canSend: () => true,
placeholder: (s) => (s === "running" ? "Message your lead; it reads this after its next tool call, or when its turn ends" : "Message your lead. Paste or drop images to attach them."),
placeholder: "Message your lead. Paste or drop images to attach them.",
send: async ({ text, images, model, firstModel, sessionId }) => {
await post("/api/me/lead/messages", { body: { text, images, model: sessionId ? model : firstModel } });
},
+3 -4
View File
@@ -23,7 +23,7 @@ export type ChatSource = {
streamTopic: Topic;
empty: string;
canSend: (sessionState: string) => boolean;
placeholder: (sessionState: string) => string;
placeholder: string;
send: (m: { key: string; sessionId: string | undefined; text: string; images: string[] | undefined; model: string | undefined; firstModel: string }) => Promise<void>;
};
@@ -92,8 +92,7 @@ const taskSource: ChatSource = {
streamTopic: "stream",
empty: "No task selected. Ask your lead, or pick one with ⌘K.",
canSend: () => true,
placeholder: (s) =>
s === "running" ? "Message the agent; it reads this after its next tool call, or when its turn ends" : "Message the agent. Paste or drop images to attach them.",
placeholder: "Message the agent. Paste or drop images to attach them.",
send: async ({ key, sessionId, text, images, model, firstModel }) => {
if (sessionId) {
await post("/api/sessions/{sessionId}/messages", { path: { sessionId }, body: { text, images, model } });
@@ -724,7 +723,7 @@ function composeForm(
vendor: string | undefined,
showPending: (text: string, imgs: PendingImage[]) => () => void,
): HTMLElement {
const text = h("textarea", { placeholder: src.placeholder(sessionState), rows: 3 });
const text = h("textarea", { placeholder: src.placeholder, rows: 3 });
const clearDraft = keepDraft(text, `message:${key}`);
const send = h("button", { type: "submit", disabled: !src.canSend(sessionState) }, "Send");
const interrupt = h("button", { type: "button", class: "danger", disabled: sessionState !== "running" }, "Interrupt");