feat(webui): surface composer shortcut hints (#6567)
This commit is contained in:
1 parent
955b1edd99
commit
0c92d5bb03
14 files changed
+15
-34
No files matched your search
@@ -1216,7 +1216,7 @@ export function ThreadComposer({
|
|||||||
));
|
));
|
||||||
}, [activeTurnId, isStreaming, pendingQueueKey, setQueuedPrompt]);
|
}, [activeTurnId, isStreaming, pendingQueueKey, setQueuedPrompt]);
|
||||||
|
|
||||||
const resolvedPlaceholder = placeholder ?? t("thread.composer.placeholderThread");
|
const resolvedPlaceholder = placeholder ?? t("thread.composer.placeholder");
|
||||||
|
|
||||||
const maxAttachments = ingressLimits?.attachments.max_count
|
const maxAttachments = ingressLimits?.attachments.max_count
|
||||||
?? MAX_ATTACHMENTS_PER_MESSAGE;
|
?? MAX_ATTACHMENTS_PER_MESSAGE;
|
||||||
|
|||||||
@@ -1313,11 +1313,6 @@ export function ThreadShell({
|
|||||||
activeTurnId={turnActive && chatId ? client.getRunTurnId(chatId) ?? historyActiveTurnId : null}
|
activeTurnId={turnActive && chatId ? client.getRunTurnId(chatId) ?? historyActiveTurnId : null}
|
||||||
completedTurnIds={messagesReady && !recoveryNeedsDecision
|
completedTurnIds={messagesReady && !recoveryNeedsDecision
|
||||||
&& chatId && !client.hasUnsettledRun(chatId) ? queueCompletedTurnIds : undefined}
|
&& chatId && !client.hasUnsettledRun(chatId) ? queueCompletedTurnIds : undefined}
|
||||||
placeholder={
|
|
||||||
composerVariant === "hero"
|
|
||||||
? t("thread.composer.placeholderHero")
|
|
||||||
: t("thread.composer.placeholderThread")
|
|
||||||
}
|
|
||||||
modelLabel={modelBadgeLabel}
|
modelLabel={modelBadgeLabel}
|
||||||
modelDetail={modelBadge.model}
|
modelDetail={modelBadge.model}
|
||||||
modelPreset={activeModelPreset}
|
modelPreset={activeModelPreset}
|
||||||
@@ -1371,11 +1366,7 @@ export function ThreadShell({
|
|||||||
disabled={booting}
|
disabled={booting}
|
||||||
inputAriaLabel={composerInputAriaLabel}
|
inputAriaLabel={composerInputAriaLabel}
|
||||||
isStreaming={turnActive}
|
isStreaming={turnActive}
|
||||||
placeholder={
|
placeholder={booting ? t("thread.composer.placeholderOpening") : undefined}
|
||||||
booting
|
|
||||||
? t("thread.composer.placeholderOpening")
|
|
||||||
: t("thread.composer.placeholderHero")
|
|
||||||
}
|
|
||||||
modelLabel={modelBadgeLabel}
|
modelLabel={modelBadgeLabel}
|
||||||
modelDetail={modelBadge.model}
|
modelDetail={modelBadge.model}
|
||||||
modelPreset={activeModelPreset}
|
modelPreset={activeModelPreset}
|
||||||
|
|||||||
@@ -2090,8 +2090,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Type your message…",
|
"placeholder": "Type / for commands, @ for chats or apps, $ for skills",
|
||||||
"placeholderHero": "Describe what you’d like to do",
|
|
||||||
"placeholderOpening": "Opening a new topic…",
|
"placeholderOpening": "Opening a new topic…",
|
||||||
"inputAria": "Message input",
|
"inputAria": "Message input",
|
||||||
"goalStateStrip": "Goal: {{label}}",
|
"goalStateStrip": "Goal: {{label}}",
|
||||||
|
|||||||
@@ -1885,8 +1885,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Escribe tu mensaje…",
|
"placeholder": "Escribe / para ver comandos, @ para mencionar conversaciones o aplicaciones y $ para elegir habilidades",
|
||||||
"placeholderHero": "Describe lo que quieres hacer",
|
|
||||||
"placeholderOpening": "Abriendo un nuevo tema…",
|
"placeholderOpening": "Abriendo un nuevo tema…",
|
||||||
"inputAria": "Entrada de mensaje",
|
"inputAria": "Entrada de mensaje",
|
||||||
"goalStateStrip": "Objetivo: {{label}}",
|
"goalStateStrip": "Objetivo: {{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Saisissez votre message…",
|
"placeholder": "Tapez / pour voir les commandes, @ pour les conversations ou les applis, $ pour les compétences",
|
||||||
"placeholderHero": "Décrivez ce que vous souhaitez faire",
|
|
||||||
"placeholderOpening": "Ouverture d’un nouveau sujet…",
|
"placeholderOpening": "Ouverture d’un nouveau sujet…",
|
||||||
"inputAria": "Champ de message",
|
"inputAria": "Champ de message",
|
||||||
"goalStateStrip": "Objectif: {{label}}",
|
"goalStateStrip": "Objectif: {{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Ketik pesan Anda…",
|
"placeholder": "Ketik / untuk melihat perintah, @ untuk memilih percakapan atau aplikasi, $ untuk memilih keterampilan",
|
||||||
"placeholderHero": "Jelaskan apa yang ingin Anda lakukan",
|
|
||||||
"placeholderOpening": "Membuka topik baru…",
|
"placeholderOpening": "Membuka topik baru…",
|
||||||
"inputAria": "Input pesan",
|
"inputAria": "Input pesan",
|
||||||
"goalStateStrip": "Tujuan: {{label}}",
|
"goalStateStrip": "Tujuan: {{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "メッセージを入力…",
|
"placeholder": "/ でコマンド、@ で会話やアプリ、$ でスキルを選択",
|
||||||
"placeholderHero": "やりたいことを入力",
|
|
||||||
"placeholderOpening": "新しいトピックを開いています…",
|
"placeholderOpening": "新しいトピックを開いています…",
|
||||||
"inputAria": "メッセージ入力欄",
|
"inputAria": "メッセージ入力欄",
|
||||||
"goalStateStrip": "目標: {{label}}",
|
"goalStateStrip": "目標: {{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "메시지를 입력하세요…",
|
"placeholder": "/로 명령어 보기, @로 대화나 앱 선택, $로 스킬 선택",
|
||||||
"placeholderHero": "하고 싶은 일을 알려 주세요",
|
|
||||||
"placeholderOpening": "새 주제를 여는 중…",
|
"placeholderOpening": "새 주제를 여는 중…",
|
||||||
"inputAria": "메시지 입력",
|
"inputAria": "메시지 입력",
|
||||||
"goalStateStrip": "목표: {{label}}",
|
"goalStateStrip": "목표: {{label}}",
|
||||||
|
|||||||
@@ -1898,8 +1898,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Digite sua mensagem…",
|
"placeholder": "Digite / para ver comandos, @ para mencionar conversas ou aplicativos e $ para escolher habilidades",
|
||||||
"placeholderHero": "Descreva o que você quer fazer",
|
|
||||||
"placeholderOpening": "Abrindo um novo tópico…",
|
"placeholderOpening": "Abrindo um novo tópico…",
|
||||||
"inputAria": "Campo de mensagem",
|
"inputAria": "Campo de mensagem",
|
||||||
"goalStateStrip": "Objetivo: {{label}}",
|
"goalStateStrip": "Objetivo: {{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "Nhập tin nhắn…",
|
"placeholder": "Nhập / để xem lệnh, @ để chọn cuộc trò chuyện hoặc ứng dụng, $ để chọn kỹ năng",
|
||||||
"placeholderHero": "Mô tả điều bạn muốn làm",
|
|
||||||
"placeholderOpening": "Đang mở chủ đề mới…",
|
"placeholderOpening": "Đang mở chủ đề mới…",
|
||||||
"inputAria": "Ô nhập tin nhắn",
|
"inputAria": "Ô nhập tin nhắn",
|
||||||
"goalStateStrip": "Mục tiêu: {{label}}",
|
"goalStateStrip": "Mục tiêu: {{label}}",
|
||||||
|
|||||||
@@ -2090,8 +2090,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "输入消息…",
|
"placeholder": "输入 / 查看命令,@ 引用会话或应用,$ 选择技能",
|
||||||
"placeholderHero": "描述你想做的事",
|
|
||||||
"placeholderOpening": "正在打开新话题…",
|
"placeholderOpening": "正在打开新话题…",
|
||||||
"inputAria": "消息输入框",
|
"inputAria": "消息输入框",
|
||||||
"goalStateStrip": "目标:{{label}}",
|
"goalStateStrip": "目标:{{label}}",
|
||||||
|
|||||||
@@ -1884,8 +1884,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"placeholderThread": "輸入訊息…",
|
"placeholder": "輸入 / 查看命令,@ 引用對話或應用程式,$ 選擇技能",
|
||||||
"placeholderHero": "描述你想做的事",
|
|
||||||
"placeholderOpening": "正在開啟新話題…",
|
"placeholderOpening": "正在開啟新話題…",
|
||||||
"inputAria": "訊息輸入框",
|
"inputAria": "訊息輸入框",
|
||||||
"goalStateStrip": "目標:{{label}}",
|
"goalStateStrip": "目標:{{label}}",
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ describe("webui i18n", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
screen.getByPlaceholderText("Type your message…"),
|
screen.getByPlaceholderText("Type / for commands, @ for chats or apps, $ for skills"),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(document.documentElement.lang).toBe("en");
|
expect(document.documentElement.lang).toBe("en");
|
||||||
|
|
||||||
@@ -519,7 +519,7 @@ describe("webui i18n", () => {
|
|||||||
expect(document.documentElement.lang).toBe("zh-CN");
|
expect(document.documentElement.lang).toBe("zh-CN");
|
||||||
});
|
});
|
||||||
expect(localStorage.getItem("nanobot.locale")).toBe("zh-CN");
|
expect(localStorage.getItem("nanobot.locale")).toBe("zh-CN");
|
||||||
expect(screen.getByPlaceholderText("输入消息…")).toBeInTheDocument();
|
expect(screen.getByPlaceholderText("输入 / 查看命令,@ 引用会话或应用,$ 选择技能")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("updates the composer aria label when the language changes", async () => {
|
it("updates the composer aria label when the language changes", async () => {
|
||||||
|
|||||||
@@ -2458,7 +2458,7 @@ describe("ThreadShell", () => {
|
|||||||
expect(screen.getByRole("textbox")).toBeInTheDocument(),
|
expect(screen.getByRole("textbox")).toBeInTheDocument(),
|
||||||
);
|
);
|
||||||
const input = screen.getByRole("textbox");
|
const input = screen.getByRole("textbox");
|
||||||
expect(input).toHaveAttribute("placeholder", "Describe what you’d like to do");
|
expect(input).toHaveAttribute("placeholder", "Type / for commands, @ for chats or apps, $ for skills");
|
||||||
expect(input.className).toContain("min-h-[78px]");
|
expect(input.className).toContain("min-h-[78px]");
|
||||||
expect(screen.queryByText("old answer")).not.toBeInTheDocument();
|
expect(screen.queryByText("old answer")).not.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user