Skip to content

UN-2742 [FIX] Show profile name instead of LLM name in Output Analyzer tabs#2030

Open
athul-rs wants to merge 1 commit into
mainfrom
UN-2742-profile-name-output-analyzer
Open

UN-2742 [FIX] Show profile name instead of LLM name in Output Analyzer tabs#2030
athul-rs wants to merge 1 commit into
mainfrom
UN-2742-profile-name-output-analyzer

Conversation

@athul-rs

@athul-rs athul-rs commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

  • Output tabs in Prompt Studio now show the LLM profile name as the label, with the LLM model name available as a tooltip on hover. Previously the tab label was the model name, falling back to profile name.

Why

UN-2742 — users create profiles with specific intent (the same model can be used with different LLMWhisperer modes, chunking, retrieval settings). When comparing outputs across profiles, the model name is ambiguous — two tabs can read identically while being different profiles. The profile name is the meaningful identity; the model is secondary context, now preserved in a tooltip.

How

  • combined-output/JsonView.jsx — flipped label preference to profile_name || llm_model, wrapped in <Tooltip title={llm_model}>. This is the shared tab strip used by both the Output Analyzer and the main combined-output view, so both stay consistent.
  • output-for-doc-modal/OutputForDocModal.jsx — same pattern applied to the identical tab strip there.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No. Tab selection is keyed on profile_id (JsonView) / index (OutputForDocModal), never on the label text, so behavior is unchanged — only the visible label flips. No tests, e2e selectors, or CSS reference the label text. profile_name is a required, whitespace-validated field at profile creation, so labels can't be blank. If a profile's adapter was deleted (no resolvable model), the tooltip simply doesn't render (antd disables tooltips with undefined title) — previously that case showed the profile name with no tooltip, so nothing is lost.

Database Migrations

  • None

Env Config

  • None

Relevant Docs

  • N/A

Related Issues or PRs

  • Jira: UN-2742

Dependent Features

  • None

Notes on Testing

  • Biome lint clean; vite build succeeds.
  • Manual: open a Prompt Studio project with 2+ profiles → Output Analyzer and combined output tabs show profile names; hovering a tab shows the model name; tab switching unaffected.

Screenshots

N/A

Checklist

I have read and understood the Contribution Guidelines.

🤖 Generated with Claude Code

Profiles encode user intent (same model can differ by LLMWhisperer
mode, chunking, etc.), so the profile name is the meaningful label
when comparing outputs. The LLM model name stays available as a
tooltip on each tab.

Applies to the shared tab strip used by the Output Analyzer and the
main combined-output view (JsonView), and the same pattern in
OutputForDocModal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Lint Report (Biome)

All checks passed! No linting or formatting issues found.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 444a516e-fc21-4e2b-9c6e-d444cdf1e57d

📥 Commits

Reviewing files that changed from the base of the PR and between c14a3b3 and 677940f.

📒 Files selected for processing (2)
  • frontend/src/components/custom-tools/combined-output/JsonView.jsx
  • frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx

Summary by CodeRabbit

  • New Features
    • Added hover tooltips to adapter tabs displaying additional model information in tool output views.
    • Enhanced adapter tab labels for improved visibility and clarity.

Walkthrough

Two output components add Ant Design Tooltip to adapter tab labels, displaying the LLM model on hover while preferring the profile name for the visible text. Imports are updated in both files, and tab rendering logic is adjusted to wrap labels in tooltip components with updated fallback display priorities.

Changes

Adapter Model Tooltips

Layer / File(s) Summary
Add tooltips displaying adapter LLM model to output tabs
frontend/src/components/custom-tools/combined-output/JsonView.jsx, frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx
Both components import Tooltip from antd and wrap adapter tab labels to display llm_model in a tooltip on hover. Visible tab text prioritizes profile_name over llm_model instead of the previous fallback order.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: swapping the tab label priority to show profile name instead of LLM model name in Output Analyzer tabs.
Description check ✅ Passed The PR description is comprehensive and follows the template structure, covering What, Why, How, breaking changes assessment, testing notes, and all required sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch UN-2742-profile-name-output-analyzer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR swaps the display priority of LLM profile tabs in the Output Analyzer and Output-for-Doc modal: the tab label now shows profile name (previously model name), and the LLM model name is exposed as a hover tooltip via antd's Tooltip. The change is applied consistently across both JsonView.jsx and OutputForDocModal.jsx.

  • Label flip: llm_model || profile_nameprofile_name || llm_model, wrapping each tab in <Tooltip title={adapter?.llm_model}> — purely presentational, no impact on tab-selection keying or data-fetch logic.
  • Tooltip behavior: antd silently suppresses the tooltip when title is undefined (e.g., when a profile's adapter has been deleted), so no blank-tooltip regressions are introduced.

Confidence Score: 5/5

Safe to merge — only the tab label text and tooltip are changing; all tab-selection, data-fetching, and rendering logic are untouched.

Both changed files receive an identical, symmetric treatment: import Tooltip, flip the label preference, wrap with tooltip. Tab keys in JsonView remain profile_id and in OutputForDocModal remain (index + 1).toString(), so no tab-switching behavior changes. The getLLMModelNamesForProfiles helper confirms llm_model can be undefined when an adapter is deleted; antd's Tooltip correctly suppresses itself in that case. No tests, route handlers, or data contracts are touched.

No files require special attention.

Important Files Changed

Filename Overview
frontend/src/components/custom-tools/combined-output/JsonView.jsx Added Tooltip import; tab label priority flipped from llm_model
frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx Same Tooltip-wrapping pattern applied consistently; tab selection (handleTabChange) is keyed on index, unchanged by the label swap

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[adapterData array] --> B{profile_name truthy?}
    B -- Yes --> C[Tab label = profile_name]
    B -- No --> D[Tab label = llm_model]
    C --> E{llm_model defined?}
    D --> E
    E -- Yes --> F[Tooltip shows llm_model on hover]
    E -- No --> G[No tooltip rendered]
    F --> H[Tab rendered in strip]
    G --> H
Loading

Reviews (1): Last reviewed commit: "UN-2742 Show profile name instead of LLM..." | Re-trigger Greptile

@jaseemjaskp jaseemjaskp left a comment

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.

Automated PR review (PR Review Toolkit: code-reviewer, silent-failure-hunter, type-design-analyzer, pr-test-analyzer, comment-analyzer, code-simplifier).

Verdict: Clean, focused change — correctly implements UN-2742 (profile name as the tab label, LLM model in a hover tooltip). Change is consistent across both files. No critical/high issues. Findings below are LOW/nit.

Inline comments cover the two behavioral edge cases (blank tab + redundant/empty tooltip when fields are missing).

Additional non-blocking notes (lines outside the diff, so not inlined):

  • Weak prop contract (LOW)JsonView.jsx:111 declares adapterData: PropTypes.array, which permits any array. The producer getLLMModelNamesForProfiles (GetStaticData.js:476-491) always emits { profile_name, llm_model, profile_id }, so tightening to PropTypes.arrayOf(PropTypes.shape({ profile_id: PropTypes.string.isRequired, profile_name: PropTypes.string, llm_model: PropTypes.string })) would document the contract and surface dev-mode warnings. profile_id is load-bearing (tab key + selection).
  • Duplication (nit, no action) — the tab-label JSX is now identical in both files. A shared ProfileTabLabel is not worth it for two call sites with no existing shared-component precedent in these sibling directories; extract only if a third call site appears.
  • Tests (optional) — frontend has Vitest infra but minimal coverage; this presentational change doesn't warrant new tests under current conventions. If anything, a single guard around the empty-string profile_name fallback.

<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.

<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.

@jaseemjaskp jaseemjaskp left a comment

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.

Automated PR review (PR Review Toolkit: Code Reviewer, Silent Failure Hunter, Type Design Analyzer, Test Analyzer, Comment Analyzer, Code Simplifier).

Verdict: ship-able. The change is correct, symmetric across both files, null-safe (optional chaining), and matches the stated intent (profile name as label, model in tooltip). No blocking issues.

Two MEDIUM robustness findings are inline below. The recurring root cause is that llm_model — the field the new tooltip relies on — is exactly the field most likely to be undefined: getLLMModelNamesForProfiles (frontend/src/helpers/GetStaticData.js:484-490) derives it from adapterMap[profile?.llm], which misses whenever the profile's adapter isn't in the returned adapter list (deleted/renamed adapter, or a partial list).

Non-blocking, no inline comment posted:

  • Type/data contract (weak): adapterData is declared only as PropTypes.array (JsonView.jsx:111); the { profile_name, llm_model, profile_id } shape lives implicitly in the producer. The new behavior now depends on profile_name, but that contract is expressed nowhere. Cheap fix: PropTypes.arrayOf(PropTypes.shape({ profile_name: PropTypes.string, llm_model: PropTypes.string, profile_id: PropTypes.string })), plus a JSDoc @returns typedef on the helper (the shape also reaches OutputForDocModal via local state, which PropTypes can't cover).
  • Comment (optional): A one-line comment explaining the profile_name || llm_model label + llm_model tooltip intent would guard the fallback from being misread as redundant/dead code.
  • Simplification: None warranted — extracting a shared <ProfileTabLabel> for a 4-line snippet duplicated twice is disproportionate.
  • Tests: No test required. Frontend uses Vitest + RTL but only for non-trivial branching logic; this presentational change is consistent with leaving such code untested.

<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.

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>

<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.

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants