Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs } from "antd";
import { Tabs, Tooltip } from "antd";
import TabPane from "antd/es/tabs/TabPane";
import Prism from "prismjs";
import PropTypes from "prop-types";
Expand Down Expand Up @@ -70,7 +70,11 @@ function JsonView({
)}
{adapterData.map((adapter) => (
<TabPane
tab={<span>{adapter?.llm_model || adapter?.profile_name}</span>}
tab={
<Tooltip title={adapter?.llm_model}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW / nit — tooltip is redundant or empty in the fallback path.

When profile_name is missing, the span already falls back to llm_model, and the tooltip title is also llm_model — so the hover just repeats the visible text. And when llm_model itself is undefined (the adapter for profile.llm doesn't resolve in getLLMModelNamesForProfiles), the tooltip is empty and hover reveals nothing. If both fields are falsy the tab renders with no label at all (a blank, anonymous-but-selectable tab) — pre-existing, but the new tooltip was a chance to address it.

Suggestion (only show the tooltip when it adds info, and guarantee a visible label):

tab={
  <Tooltip title={adapter?.profile_name ? adapter?.llm_model : undefined}>
    <span>{adapter?.profile_name || adapter?.llm_model || "Unnamed profile"}</span>
  </Tooltip>
}

(antd suppresses the popup when title is undefined.) Non-blocking.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Tooltip can render empty, and the tab label can be blank.

llm_model is the field most prone to being undefined here (lookup miss in getLLMModelNamesForProfiles, GetStaticData.js:484-490, when the profile's adapter isn't in the list). When it's undefined, <Tooltip title={undefined}> shows nothing on hover — defeating the stated goal of keeping the model name discoverable.

Separately, {adapter?.profile_name || adapter?.llm_model} (next line) renders an empty <span> when both are missing, producing a blank, unidentifiable tab (still keyed by profile_id, so output loads but the user can't tell which profile it is).

Suggest terminal fallbacks so neither is ever empty:

<Tooltip title={adapter?.llm_model || adapter?.profile_name}>
  <span>
    {adapter?.profile_name || adapter?.llm_model || `Profile ${adapter?.profile_id ?? "?"}`}
  </span>
</Tooltip>

<span>{adapter?.profile_name || adapter?.llm_model}</span>
</Tooltip>
}
key={adapter?.profile_id}
/>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CloseCircleFilled,
InfoCircleFilled,
} from "@ant-design/icons";
import { Button, Modal, Table, Tabs, Typography } from "antd";
import { Button, Modal, Table, Tabs, Tooltip, Typography } from "antd";
import TabPane from "antd/es/tabs/TabPane";
import PropTypes from "prop-types";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -340,7 +340,11 @@ function OutputForDocModal({
<TabPane tab={<span>Default</span>} key={"0"}></TabPane>
{adapterData?.map((adapter, index) => (
<TabPane
tab={<span>{adapter?.llm_model || adapter?.profile_name}</span>}
tab={
<Tooltip title={adapter?.llm_model}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW / nit — same as JsonView.jsx. When profile_name is absent the span and the tooltip both show llm_model (redundant); when llm_model is also undefined the tooltip is empty and a both-empty case yields a blank, anonymous tab. Mirror the same guard here to keep the two files consistent:

tab={
  <Tooltip title={adapter?.profile_name ? adapter?.llm_model : undefined}>
    <span>{adapter?.profile_name || adapter?.llm_model || "Unnamed profile"}</span>
  </Tooltip>
}

Non-blocking.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — same robustness gap as JsonView.jsx (mirror this file's fix).

The tooltip binds to llm_model, the field most likely to be undefined (lookup miss in getLLMModelNamesForProfiles, GetStaticData.js:484-490); when absent the tooltip shows nothing on hover. And {adapter?.profile_name || adapter?.llm_model} (next line) renders an empty tab label when both fields are missing.

Apply the same terminal-fallback fix as in JsonView.jsx so neither the tooltip nor the label can be empty:

<Tooltip title={adapter?.llm_model || adapter?.profile_name}>
  <span>{adapter?.profile_name || adapter?.llm_model || `Profile ${index + 1}`}</span>
</Tooltip>

<span>{adapter?.profile_name || adapter?.llm_model}</span>
</Tooltip>
}
key={(index + 1)?.toString()}
></TabPane>
))}
Expand Down