From 8ed098ebd669e43aebd945dd586bcf893ec77fec Mon Sep 17 00:00:00 2001 From: Creylay Date: Fri, 11 Sep 2026 13:56:53 -0300 Subject: [PATCH 1/2] feat: enhance InfoModal layout with flexible sizing and overflow handling --- DashAI/front/src/components/shared/InfoModal.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DashAI/front/src/components/shared/InfoModal.jsx b/DashAI/front/src/components/shared/InfoModal.jsx index ff69d79c9..6af897dee 100644 --- a/DashAI/front/src/components/shared/InfoModal.jsx +++ b/DashAI/front/src/components/shared/InfoModal.jsx @@ -36,6 +36,9 @@ export default function InfoModal({ left: "50%", transform: "translate(-50%, -50%)", width: { xs: "90%", sm: 500 }, + maxHeight: "85vh", + display: "flex", + flexDirection: "column", bgcolor: "background.paper", borderRadius: 2, boxShadow: 12, @@ -50,6 +53,7 @@ export default function InfoModal({ justifyContent: "space-between", alignItems: "center", borderBottom: "1px solid rgba(255, 255, 255, 0.1)", + flexShrink: 0, }} > @@ -71,7 +75,7 @@ export default function InfoModal({ - + {extraContent} {rows.length > 0 && ( From a2f506a8f5de857ab261a3cf0e8553c4b1f17226 Mon Sep 17 00:00:00 2001 From: Creylay Date: Fri, 11 Sep 2026 13:57:16 -0300 Subject: [PATCH 2/2] feat: add appliedConverters label to multiple language files and enhance SessionInfoContent with converter metadata --- .../components/models/SessionInfoContent.jsx | 72 ++++++++++++++++++- .../src/utils/i18n/locales/de/models.json | 1 + .../src/utils/i18n/locales/en/models.json | 1 + .../src/utils/i18n/locales/es/models.json | 1 + .../src/utils/i18n/locales/pt/models.json | 1 + .../src/utils/i18n/locales/zh/models.json | 1 + 6 files changed, 75 insertions(+), 2 deletions(-) diff --git a/DashAI/front/src/components/models/SessionInfoContent.jsx b/DashAI/front/src/components/models/SessionInfoContent.jsx index 3d97764fe..8b79df8ae 100644 --- a/DashAI/front/src/components/models/SessionInfoContent.jsx +++ b/DashAI/front/src/components/models/SessionInfoContent.jsx @@ -1,9 +1,15 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; import { Box, Typography, Chip } from "@mui/material"; import { useTranslation } from "react-i18next"; import { formatDate } from "../../utils"; -import ParamInfoList from "./ParamInfoBox"; +import { getComponents } from "../../api/component"; +import ParamInfoList, { ParamInfoBox } from "./ParamInfoBox"; +import { + buildStepDisplayNames, + buildColumnKeysAndTypes, + refToKey, +} from "./modelSession/sessionColumnRefs"; const SPLIT_TYPE_LABEL_KEYS = { random: "experiments:label.random", @@ -24,9 +30,41 @@ export default function SessionInfoContent({ tasks = [], }) { const { t } = useTranslation(["common", "experiments", "models"]); + const [convertersMeta, setConvertersMeta] = useState({}); + + useEffect(() => { + let cancelled = false; + getComponents({ selectTypes: ["Converter"] }) + .then((data) => { + if (cancelled) return; + setConvertersMeta( + Object.fromEntries((data || []).map((c) => [c.name, c])), + ); + }) + .catch((error) => + console.error("Failed to fetch converter metadata:", error), + ); + return () => { + cancelled = true; + }; + }, []); if (!session) return null; + const preprocessingSteps = session.preprocessing?.steps || []; + const stepDisplayNames = buildStepDisplayNames( + preprocessingSteps, + convertersMeta, + ); + // datasetTypes isn't needed here: a raw scope ref is shown as its own + // column name regardless, and a group scope ref's label only depends on + // the earlier step it points to (see buildColumnKeysAndTypes). + const { optionLabels: scopeOptionLabels } = buildColumnKeysAndTypes({ + datasetTypes: {}, + preprocessing: preprocessingSteps, + convertersMeta, + }); + const getDatasetName = () => { if (!session.dataset_id || !datasets.length) return t("common:unknown"); const dataset = datasets.find((d) => d.id === session.dataset_id); @@ -150,6 +188,28 @@ export default function SessionInfoContent({ + {preprocessingSteps.length > 0 && ( + + + {t("models:label.appliedConverters")} + + + {preprocessingSteps.map((step, index) => ( + { + const key = refToKey(ref); + return scopeOptionLabels[key] || key; + }) + .join(", ")} + /> + ))} + + + )} + {t("common:metadata")} @@ -172,6 +232,14 @@ SessionInfoContent.propTypes = { created: PropTypes.string, last_modified: PropTypes.string, description: PropTypes.string, + preprocessing: PropTypes.shape({ + steps: PropTypes.arrayOf( + PropTypes.shape({ + converter: PropTypes.string, + scope: PropTypes.array, + }), + ), + }), }), datasets: PropTypes.array, tasks: PropTypes.array, diff --git a/DashAI/front/src/utils/i18n/locales/de/models.json b/DashAI/front/src/utils/i18n/locales/de/models.json index 501e34c7e..71507b0cf 100644 --- a/DashAI/front/src/utils/i18n/locales/de/models.json +++ b/DashAI/front/src/utils/i18n/locales/de/models.json @@ -74,6 +74,7 @@ "addModelToSession": "Modell zur Sitzung hinzufügen", "allRepetitions": "Alle Wiederholungen", "alternativeHypothesis": "Alternativhypothese", + "appliedConverters": "Angewendete Converter", "applyPreprocessing": "Vorverarbeitung anwenden", "applyPreprocessingDescription": "Die ausgewählten Converter werden nur anhand der Trainingsdaten angepasst und auf den Rest angewendet, um Datenlecks zu vermeiden. Wird dies nicht angewendet, trainiert das Modell mit den Daten wie sie sind.", "availableExplainers": "Verfügbare Erklärungsmodelle", diff --git a/DashAI/front/src/utils/i18n/locales/en/models.json b/DashAI/front/src/utils/i18n/locales/en/models.json index 8bcbd08d3..962e0b225 100644 --- a/DashAI/front/src/utils/i18n/locales/en/models.json +++ b/DashAI/front/src/utils/i18n/locales/en/models.json @@ -232,6 +232,7 @@ "predictionsCount_other": "• <1>{{count}} predictions", "divideColumnsAndSplits": "Divide columns and configure dataset splits", "prepareDataset": "Prepare Dataset", + "appliedConverters": "Applied Converters", "applyPreprocessing": "Apply preprocessing", "applyPreprocessingDescription": "Selected converters are fit only on training data and applied to the rest, to avoid data leakage. If not applied, the model trains on the data as-is.", "preprocessingOptional": "Preprocessing (optional)", diff --git a/DashAI/front/src/utils/i18n/locales/es/models.json b/DashAI/front/src/utils/i18n/locales/es/models.json index fd98076b8..4705e406d 100644 --- a/DashAI/front/src/utils/i18n/locales/es/models.json +++ b/DashAI/front/src/utils/i18n/locales/es/models.json @@ -238,6 +238,7 @@ "predictionsCount_other": "• <1>{{count}} predicciones", "divideColumnsAndSplits": "Divide columnas y configura las particiones del dataset", "prepareDataset": "Preparar Dataset", + "appliedConverters": "Converters Aplicados", "applyPreprocessing": "Aplicar preprocesamiento", "applyPreprocessingDescription": "Los converters seleccionados se ajustan solo sobre los datos de entrenamiento y se aplican al resto, para evitar fuga de datos. Si no se aplica, el modelo se entrena con los datos tal como están.", "preprocessingOptional": "Preprocesamiento (opcional)", diff --git a/DashAI/front/src/utils/i18n/locales/pt/models.json b/DashAI/front/src/utils/i18n/locales/pt/models.json index 4d9d71dbb..40d807c4d 100644 --- a/DashAI/front/src/utils/i18n/locales/pt/models.json +++ b/DashAI/front/src/utils/i18n/locales/pt/models.json @@ -74,6 +74,7 @@ "addModelToSession": "Adicionar Modelo à Sessão", "allRepetitions": "Todas as Repetições", "alternativeHypothesis": "Hipótese Alternativa", + "appliedConverters": "Conversores Aplicados", "applyPreprocessing": "Aplicar pré-processamento", "applyPreprocessingDescription": "Os conversores selecionados são ajustados apenas com os dados de treinamento e aplicados ao restante, para evitar vazamento de dados. Se não for aplicado, o modelo treina com os dados como estão.", "availableExplainers": "Explicadores Disponíveis", diff --git a/DashAI/front/src/utils/i18n/locales/zh/models.json b/DashAI/front/src/utils/i18n/locales/zh/models.json index 6ab14cc6d..b77edcbc9 100644 --- a/DashAI/front/src/utils/i18n/locales/zh/models.json +++ b/DashAI/front/src/utils/i18n/locales/zh/models.json @@ -74,6 +74,7 @@ "addModelToSession": "将模型添加到会话", "allRepetitions": "所有重复", "alternativeHypothesis": "备择假设", + "appliedConverters": "已应用的转换器", "applyPreprocessing": "应用预处理", "applyPreprocessingDescription": "所选的转换器仅在训练数据上拟合,然后应用于其余数据,以避免数据泄漏。如果不应用,模型将按原样使用数据进行训练。", "availableExplainers": "可用解释器",