mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 18:57:09 +08:00
fix lighthouse errors on panel
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import {
|
||||
oneDark,
|
||||
@ -19,6 +20,7 @@ export default function SimplifiedCodeTabComponent({
|
||||
language,
|
||||
maxHeight,
|
||||
}: SimplifiedCodeTabProps) {
|
||||
const { t } = useTranslation();
|
||||
const [isCopied, setIsCopied] = useState<boolean>(false);
|
||||
const dark = useDarkStore((state) => state.dark);
|
||||
|
||||
@ -51,6 +53,7 @@ export default function SimplifiedCodeTabComponent({
|
||||
className="text-muted-foreground hover:bg-card"
|
||||
data-testid="copy-code-button"
|
||||
onClick={copyToClipboard}
|
||||
aria-label={isCopied ? t("chat.copiedCode") : t("chat.copyCode")}
|
||||
>
|
||||
{isCopied ? (
|
||||
<IconComponent name="Check" className="h-4 w-4" />
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "Dies ist kein Chat-Ablauf.",
|
||||
"chat.cannotOpenTitle": "Der Chat lässt sich nicht öffnen",
|
||||
"chat.copied": "Kopiert!",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "Nachricht kopieren",
|
||||
"chat.defaultSession": "Standardsitzung",
|
||||
"chat.deleteSessionsCount_one": "{{count}} -Sitzung löschen",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "Alle Datensätze löschen",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "Termine löschen",
|
||||
"trace.clearError": "Fehler beim Löschen von Datensätzen",
|
||||
"trace.clearedSuccess": "Datensätze wurden erfolgreich gelöscht",
|
||||
|
||||
@ -1327,6 +1327,8 @@
|
||||
"trace.clearDates": "Clear dates",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"flow.restoreVersion": "Restore this version of your flow",
|
||||
"flow.saveVersion": "Save a version of your flow",
|
||||
"flow.moreOptions": "More options",
|
||||
@ -1500,6 +1502,8 @@
|
||||
"chat.options": "Options",
|
||||
"chat.editMessage": "Edit message",
|
||||
"chat.copied": "Copied!",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "Copy message",
|
||||
"chat.helpful": "Helpful",
|
||||
"chat.notHelpful": "Not helpful",
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "Esto no es un flujo de chat.",
|
||||
"chat.cannotOpenTitle": "No se puede abrir el chat",
|
||||
"chat.copied": "Copiado",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "Copiar mensaje",
|
||||
"chat.defaultSession": "Sesión predeterminada",
|
||||
"chat.deleteSessionsCount_one": "Eliminar una sesión de « {{count}} »",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "Borrar todos los registros",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "Borrar fechas",
|
||||
"trace.clearError": "Error al borrar registros",
|
||||
"trace.clearedSuccess": "Los registros se han borrado correctamente",
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "Ce n'est pas un flux de conversation.",
|
||||
"chat.cannotOpenTitle": "Impossible d'ouvrir la discussion",
|
||||
"chat.copied": "Copié",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "Copier le message",
|
||||
"chat.defaultSession": "Session par défaut",
|
||||
"chat.deleteSessionsCount_one": "Supprimer la session d' {{count}}",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "Effacer tous les enregistrements",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "Effacer les dates",
|
||||
"trace.clearError": "Erreur lors de la suppression des enregistrements",
|
||||
"trace.clearedSuccess": "Les enregistrements ont été effacés avec succès",
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "これはチャットフローではありません。",
|
||||
"chat.cannotOpenTitle": "チャットが開けません",
|
||||
"chat.copied": "コピーされました",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "メッセージをコピーする",
|
||||
"chat.defaultSession": "デフォルトのセッション",
|
||||
"chat.deleteSessionsCount_one": "{{count}} のセッションを削除する",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "すべての記録を消去",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "日付を消去",
|
||||
"trace.clearError": "レコードの削除中にエラーが発生しました",
|
||||
"trace.clearedSuccess": "レコードのクリアに成功しました",
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "Isso não é um fluxo de chat.",
|
||||
"chat.cannotOpenTitle": "Não é possível abrir o chat",
|
||||
"chat.copied": "Copiado!",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "Copiar mensagem",
|
||||
"chat.defaultSession": "Sessão padrão",
|
||||
"chat.deleteSessionsCount_one": "Excluir a sessão do {{count}}",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "Limpar todos os registros",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "Limpar datas",
|
||||
"trace.clearError": "Erro ao limpar registros",
|
||||
"trace.clearedSuccess": "Os registros foram apagados com sucesso",
|
||||
|
||||
@ -217,6 +217,8 @@
|
||||
"chat.cannotOpenDescription": "这不是一个聊天流程。",
|
||||
"chat.cannotOpenTitle": "无法打开聊天窗口",
|
||||
"chat.copied": "已复制!",
|
||||
"chat.copyCode": "Copy code",
|
||||
"chat.copiedCode": "Code copied",
|
||||
"chat.copyMessage": "复制消息",
|
||||
"chat.defaultSession": "默认会话",
|
||||
"chat.deleteSessionsCount_one": "删除 {{count}} 会话",
|
||||
@ -1940,6 +1942,8 @@
|
||||
"trace.clearAllRecords": "清除所有记录",
|
||||
"trace.tableAriaLabel": "Trace runs table",
|
||||
"trace.statusFilterLabel": "Filter by status",
|
||||
"trace.expandSpan": "Expand span",
|
||||
"trace.collapseSpan": "Collapse span",
|
||||
"trace.clearDates": "清除日期",
|
||||
"trace.clearError": "清除记录时发生错误",
|
||||
"trace.clearedSuccess": "记录已成功清除",
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import IconComponent from "@/components/common/genericIconComponent";
|
||||
import useFlowStore from "@/stores/flowStore";
|
||||
import { cn } from "@/utils/utils";
|
||||
@ -22,6 +23,7 @@ export function SpanNode({
|
||||
onToggle,
|
||||
onSelect,
|
||||
}: SpanNodeProps) {
|
||||
const { t } = useTranslation();
|
||||
const nodes = useFlowStore((state) => state.nodes);
|
||||
const componentIconMap = useMemo(() => {
|
||||
const map = new Map<string, string>();
|
||||
@ -71,6 +73,7 @@ export function SpanNode({
|
||||
}}
|
||||
tabIndex={-1}
|
||||
aria-hidden={!hasChildren}
|
||||
aria-label={hasChildren ? (isExpanded ? t("trace.collapseSpan") : t("trace.expandSpan")) : undefined}
|
||||
>
|
||||
<IconComponent
|
||||
name={isExpanded ? "ChevronDown" : "ChevronRight"}
|
||||
|
||||
Reference in New Issue
Block a user