feat(ai): export conversation as markdown or html
This commit is contained in:
1 parent
d0832f17f4
commit
2b2d1f0d95
20 files changed
+506
-5
No files matched your search
@@ -26,6 +26,10 @@ const locales: Array<[string, Record<string, unknown>]> = [
|
||||
// the user runs, and a missing key would leak raw keys into the toolbar.
|
||||
const AI_HTML_PREVIEW_KEYS = ["htmlPreviewLabel", "htmlExpandPreview", "htmlExpandPreviewHint", "htmlSaveSafe", "htmlSaveFailed", "htmlCopySource", "htmlCopyRiskBody", "htmlCopyRiskAccept", "htmlCopyRiskRemember", "htmlCopyRiskToast"] as const;
|
||||
|
||||
// Keys the conversation export (PR3 of #6467) adds to the `ai` namespace —
|
||||
// header menu entry, report role labels, failure marker, and empty-state copy.
|
||||
const AI_CONVERSATION_EXPORT_KEYS = ["exportConversation", "conversationExportMarkdown", "conversationExportHtml", "conversationRoleUser", "conversationRoleAssistant", "conversationFailedMarker", "conversationExportEmpty"] as const;
|
||||
|
||||
describe("AI rich content locale parity", () => {
|
||||
it.each(locales)("%s exposes the full ai.html* key set with non-empty copy", (_name, locale) => {
|
||||
const ai = (locale as { ai: Record<string, unknown> }).ai;
|
||||
@@ -34,4 +38,12 @@ describe("AI rich content locale parity", () => {
|
||||
expect(ai[key] as string, `${_name}: ai.${key}`).not.toHaveLength(0);
|
||||
}
|
||||
});
|
||||
|
||||
it.each(locales)("%s exposes the full conversation-export key set with non-empty copy", (_name, locale) => {
|
||||
const ai = (locale as { ai: Record<string, unknown> }).ai;
|
||||
for (const key of AI_CONVERSATION_EXPORT_KEYS) {
|
||||
expect(ai[key], `${_name}: ai.${key}`).toBeTypeOf("string");
|
||||
expect(ai[key] as string, `${_name}: ai.${key}`).not.toHaveLength(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -3047,6 +3047,13 @@ export default {
|
||||
htmlCopyRiskAccept: "Copy anyway",
|
||||
htmlCopyRiskRemember: "Don't ask again this session",
|
||||
htmlCopyRiskToast: "Copied. This AI-generated HTML may execute scripts or access the network when opened outside DBX.",
|
||||
exportConversation: "Export conversation",
|
||||
conversationExportMarkdown: "Export as Markdown",
|
||||
conversationExportHtml: "Export as HTML",
|
||||
conversationRoleUser: "User",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "This reply failed to generate",
|
||||
conversationExportEmpty: "No messages to export yet",
|
||||
},
|
||||
contextMenu: {
|
||||
openConnection: "Open Connection",
|
||||
|
||||
@@ -2834,6 +2834,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "Copiar de todos modos",
|
||||
htmlCopyRiskRemember: "No volver a preguntar en esta sesión",
|
||||
htmlCopyRiskToast: "Copiado. Este HTML generado por IA puede ejecutar scripts o acceder a la red si se abre fuera de DBX.",
|
||||
exportConversation: "Exportar conversación",
|
||||
conversationExportMarkdown: "Exportar como Markdown",
|
||||
conversationExportHtml: "Exportar como HTML",
|
||||
conversationRoleUser: "Usuario",
|
||||
conversationRoleAssistant: "IA",
|
||||
conversationFailedMarker: "Esta respuesta no se pudo generar",
|
||||
conversationExportEmpty: "Aún no hay mensajes para exportar",
|
||||
agentSteps: {
|
||||
generated: "SQL generado",
|
||||
noSql: "No se encontró SQL",
|
||||
|
||||
@@ -2728,6 +2728,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "Copia comunque",
|
||||
htmlCopyRiskRemember: "Non chiedere più in questa sessione",
|
||||
htmlCopyRiskToast: "Copiato. Questo HTML generato dall'IA può eseguire script o accedere alla rete se aperto fuori da DBX.",
|
||||
exportConversation: "Esporta conversazione",
|
||||
conversationExportMarkdown: "Esporta come Markdown",
|
||||
conversationExportHtml: "Esporta come HTML",
|
||||
conversationRoleUser: "Utente",
|
||||
conversationRoleAssistant: "IA",
|
||||
conversationFailedMarker: "Generazione di questa risposta non riuscita",
|
||||
conversationExportEmpty: "Nessun messaggio da esportare",
|
||||
agentSteps: {
|
||||
generated: "SQL generato",
|
||||
noSql: "Nessun SQL trovato",
|
||||
|
||||
@@ -2870,6 +2870,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "それでもコピー",
|
||||
htmlCopyRiskRemember: "このセッションでは今後確認しない",
|
||||
htmlCopyRiskToast: "コピーしました。このAI生成HTMLは、DBXの外部で開くとスクリプトを実行したりネットワークへアクセスしたりする可能性があります。",
|
||||
exportConversation: "会話をエクスポート",
|
||||
conversationExportMarkdown: "Markdownでエクスポート",
|
||||
conversationExportHtml: "HTMLでエクスポート",
|
||||
conversationRoleUser: "ユーザー",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "この返信の生成に失敗しました",
|
||||
conversationExportEmpty: "エクスポートできるメッセージがありません",
|
||||
agentSteps: {
|
||||
generated: "SQL生成完了",
|
||||
noSql: "SQLが見つかりません",
|
||||
|
||||
@@ -2840,6 +2840,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "그래도 복사",
|
||||
htmlCopyRiskRemember: "이 세션에서 다시 묻지 않기",
|
||||
htmlCopyRiskToast: "복사되었습니다. 이 AI 생성 HTML은 DBX 외부에서 열면 스크립트를 실행하거나 네트워크에 접근할 수 있습니다.",
|
||||
exportConversation: "대화 내보내기",
|
||||
conversationExportMarkdown: "Markdown으로 내보내기",
|
||||
conversationExportHtml: "HTML로 내보내기",
|
||||
conversationRoleUser: "사용자",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "이 응답 생성에 실패했습니다",
|
||||
conversationExportEmpty: "내보낼 메시지가 없습니다",
|
||||
},
|
||||
contextMenu: {
|
||||
openConnection: "연결 열기",
|
||||
|
||||
@@ -2836,6 +2836,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "Copiar mesmo assim",
|
||||
htmlCopyRiskRemember: "Não perguntar novamente nesta sessão",
|
||||
htmlCopyRiskToast: "Copiado. Este HTML gerado por IA pode executar scripts ou acessar a rede quando aberto fora do DBX.",
|
||||
exportConversation: "Exportar conversa",
|
||||
conversationExportMarkdown: "Exportar como Markdown",
|
||||
conversationExportHtml: "Exportar como HTML",
|
||||
conversationRoleUser: "Usuário",
|
||||
conversationRoleAssistant: "IA",
|
||||
conversationFailedMarker: "Falha ao gerar esta resposta",
|
||||
conversationExportEmpty: "Ainda não há mensagens para exportar",
|
||||
agentSteps: {
|
||||
generated: "SQL gerado",
|
||||
noSql: "Nenhum SQL encontrado",
|
||||
|
||||
@@ -3021,6 +3021,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "Yine de kopyala",
|
||||
htmlCopyRiskRemember: "Bu oturumda tekrar sorma",
|
||||
htmlCopyRiskToast: "Kopyalandı. Bu AI tarafından oluşturulan HTML, DBX dışında açıldığında betik çalıştırabilir veya ağa erişebilir.",
|
||||
exportConversation: "Sohbeti dışa aktar",
|
||||
conversationExportMarkdown: "Markdown olarak dışa aktar",
|
||||
conversationExportHtml: "HTML olarak dışa aktar",
|
||||
conversationRoleUser: "Kullanıcı",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "Bu yanıt oluşturulamadı",
|
||||
conversationExportEmpty: "Dışa aktarılacak mesaj yok",
|
||||
},
|
||||
contextMenu: {
|
||||
openConnection: "Bağlantıyı Aç",
|
||||
|
||||
@@ -2970,6 +2970,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "仍要复制",
|
||||
htmlCopyRiskRemember: "本会话不再询问",
|
||||
htmlCopyRiskToast: "已复制。此 AI 生成的 HTML 在 DBX 外打开可能执行脚本或访问网络。",
|
||||
exportConversation: "导出对话",
|
||||
conversationExportMarkdown: "导出为 Markdown",
|
||||
conversationExportHtml: "导出为 HTML",
|
||||
conversationRoleUser: "用户",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "此回复生成失败",
|
||||
conversationExportEmpty: "暂无可导出的消息",
|
||||
},
|
||||
contextMenu: {
|
||||
openConnection: "打开连接",
|
||||
|
||||
@@ -2948,6 +2948,13 @@ export default withEnglishFallback({
|
||||
htmlCopyRiskAccept: "仍要複製",
|
||||
htmlCopyRiskRemember: "本次工作階段不再詢問",
|
||||
htmlCopyRiskToast: "已複製。此 AI 產生的 HTML 在 DBX 外開啟可能執行指令碼或存取網路。",
|
||||
exportConversation: "匯出對話",
|
||||
conversationExportMarkdown: "匯出為 Markdown",
|
||||
conversationExportHtml: "匯出為 HTML",
|
||||
conversationRoleUser: "使用者",
|
||||
conversationRoleAssistant: "AI",
|
||||
conversationFailedMarker: "此回覆產生失敗",
|
||||
conversationExportEmpty: "尚無可匯出的訊息",
|
||||
},
|
||||
contextMenu: {
|
||||
openConnection: "開啟連線",
|
||||
|
||||
Reference in new issue
Block a user