Skip to content

[OPIK-6167] [FE] fix: rename Test suite column to Item source#6504

Open
awkoy wants to merge 12 commits intomainfrom
awkoy/opik-6167-rename-test-suite-column-to-item-source
Open

[OPIK-6167] [FE] fix: rename Test suite column to Item source#6504
awkoy wants to merge 12 commits intomainfrom
awkoy/opik-6167-rename-test-suite-column-to-item-source

Conversation

@awkoy
Copy link
Copy Markdown
Contributor

@awkoy awkoy commented Apr 27, 2026

Details

Unifies the experiments list dataset/test-suite column header to "Item source", displays a per-row Database/ListChecks icon based on the experiment's evaluation_method, and renders a dynamic "Dataset"/"Test suite" prefix on grouped rows so the page reads consistently regardless of which entity an experiment points at. v2 only — v1, the Trial page, and the standalone test-suite item browser are unchanged.

  • Renamed column header + filter label from "Test suite" → "Item source" across v2 experiments table, groups & filters config, and dashboard widgets (Leaderboard, FeedbackScores, ExperimentWidgetDataSection).
  • Added ItemSourceCell (v2) that renders a Database icon for dataset experiments and a ListChecks icon for test-suite experiments alongside the existing resource link.
  • Plumbed a datasetTypeMap (built from useDatasetsList data in useGroupedExperimentsList) through to useExperimentsTableConfig; used to compute the per-row group prefix label dynamically.
  • Extended generateGroupedRowCellDef to honor an optional customMeta.getGroupRowLabel(row). v1 callers do not pass it, so v1 behavior is unchanged.
  • Made the group column hideable in v2 only by spreading the result of generateGroupedRowCellDef and overriding enableHiding: true at the v2 call site.

Change checklist

  • User facing
  • Documentation update

Issues

  • Resolves #
  • OPIK-6167

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): claude-opus-4-7
  • Scope: Full implementation across v2 experiments table, dashboard widgets, and the shared grouped-row cell helper, plus new ItemSourceCell component
  • Human verification: TypeScript + ESLint pass; v1 paths not modified at runtime; manual UI verification still pending

Testing

  • npx tsc --noEmit — passes
  • npx eslint on all modified files — clean

Manual checks to perform after merge / preview:

  • Experiments list (v2) → column header reads "Item source"; rows show a Database icon for dataset experiments and a ListChecks icon for test-suite experiments
  • Group by Dataset → group prefix shows "Dataset:" or "Test suite:" based on the dataset's type; the group column is hideable from the columns menu
  • Filter panel → field name reads "Item source"
  • Dashboard widgets (Experiments leaderboard / Feedback scores / Experiment widget data section) → "Item source" label

Documentation

n/a — user-visible label change only.

…h dynamic icon and group label

Unifies the experiment list dataset/test-suite column to "Item source",
showing a Database/ListChecks icon per row and a dynamic "Dataset"/"Test suite"
prefix on grouped rows; v2 only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@awkoy awkoy requested a review from a team as a code owner April 27, 2026 14:26
…experiments tab, and dashboard widgets

Apply the rename and icon badge to remaining v2 surfaces missed in the
first pass: experiments-grouped chart legend, Prompt page experiments tab,
ExperimentWidgetDataSection filter list, and the leaderboard widget cell.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment on lines +485 to +489
const datasetTypeMap = useMemo<Record<string, DATASET_TYPE>>(() => {
const map: Record<string, DATASET_TYPE> = {};
datasetsData?.content?.forEach((dataset) => {
if (dataset.type) {
map[dataset.id] = dataset.type;
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.

datasetTypeMap is only built from datasetsData.content (page 1 with size: MAX_ENTITIES_FOR_SORTING), so for datasets outside that slice useExperimentsTableConfig falls back to "Dataset" instead of "Test suite" — should we hydrate the map across all pages or include the dataset type on the grouped rows?

Finding type: Logical Bugs | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/hooks/useGroupedExperimentsList.ts around lines 485-493 where
`datasetTypeMap` is created from `datasetsData?.content`, fix the logical bug caused by
only fetching page 1 (`useDatasetsList` with `page: 1` and `size:
MAX_ENTITIES_FOR_SORTING`). Refactor so `datasetTypeMap` is populated for all dataset
ids that appear in the grouped rows—either by fetching all dataset pages (or at least
all pages needed for `flattenDeepestGroups`) to build a complete map, or by
carrying/deriving the dataset type directly when building grouped rows (e.g., include
dataset type on the group data / flatten step) so the table config doesn’t depend on a
truncated dataset slice. Update the dependencies accordingly and ensure the final
`transformedData` includes the complete `datasetTypeMap` for all grouped dataset rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made less critical in 2cc586e. The grouped row label and the resource-link routing now both read evaluation_method from the row first and only fall back to datasetTypeMap when the field is missing. Since the API returns evaluation_method on every experiment row, the page-1 truncation no longer affects label or routing for current-shape data; the map is now a fallback rather than the primary source of truth. Hydrating across all pages would still be a defensible improvement, but is no longer a correctness issue.

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.

Thanks, that makes sense — with evaluation_method now read from the row first, this is no longer a correctness issue for current data. I’ll save this to memory once the PR is merged.

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.

Commit 2cc586e addressed this comment by checking evaluation_method on the grouped rows when configuring the dataset column so we can label and link to them as Test suite or Dataset before resorting to the limited datasetTypeMap, eliminating the need to hydrate the map with every page.

Comment on lines +258 to +263
getGroupRowLabel: (row: T) => {
const datasetId = get(row, `${metaKey}.value`, "") as string;
const type = datasetTypeMap?.[datasetId];
return type === DATASET_TYPE.TEST_SUITE
? "Test suite"
: "Dataset";
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.

getGroupRowLabel defaults missing datasetTypeMap entries to "Dataset", so callers that omit the prop (e.g. PromptPage/ExperimentsTab) or have deleted/orphan groups lose their original type label — should we carry the dataset type in the grouped metadata directly, or make datasetTypeMap required and pass it through all grouped-experiments callers?

Finding types: Logical Bugs | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In `apps/opik-frontend/src/v2/pages-shared/experiments/useExperimentsTableConfig.tsx`
around lines 258-263, inside the `COLUMN_DATASET_ID` `customMeta.getGroupRowLabel`
logic, stop defaulting all missing `datasetTypeMap[datasetId]` lookups to `"Dataset"`.
Preferred fix: embed the dataset type into the grouped row metadata when building the
`COLUMN_DATASET_ID` group cell, and have `getGroupRowLabel` read it from there via
`generateGroupedRowCellDef`, only falling back when the type is genuinely known.
Fallback fix: make `datasetTypeMap` required for dataset grouping and update all
grouped-experiments callers (notably `PromptPage/ExperimentsTab`) to pass it through.
Either way, callers that omit `datasetTypeMap` or reference deleted/orphan datasets must
no longer silently render grouped rows as `"Dataset"` by default.

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.

Commit 4039975 addressed this comment by threading a datasetTypeMap through the grouped-experiments pipeline: useGroupedExperimentsList now builds the map, the Prompt and General tabs pass it into useExperimentsTableConfig, and the dataset grouping column now uses the ItemSourceCell. customMeta.getGroupRowLabel now only emits “Test suite”/“Dataset” when the map has a known type, and the shared generateGroupedRowCellDef helper renders that resolved label (falling back to the new “Item source” heading) instead of defaulting every missing entry to “Dataset.”

Comment on lines +21 to +25
const { custom } = context.column.columnDef.meta ?? {};
const cellData = context.row.original;
const {
resource,
nameKey = "name",
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.

ItemSourceCell duplicates ResourceCell’s metadata extraction and then renders ResourceLink with the same props, so future ResourceCell changes won’t carry over—should we reuse ResourceCell (e.g., wrap it to add the icon) instead of copying its logic?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentionally not addressed. ItemSourceCell needs to render an icon adjacent to the link and to derive the resource type from evaluation_method, neither of which ResourceCell exposes. Wrapping ResourceCell would require either widening its API to render arbitrary leading content or composing a parent that re-extracts the same row metadata anyway. The current duplication is small (~10 lines of get calls) and keeps both components focused; reusing ResourceCell here would couple it to experiment-specific concerns.

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.

Thanks, that makes sense — the duplication here is small and avoiding coupling ResourceCell to experiment-specific behavior is a good reason to keep ItemSourceCell separate. I'll save this to memory once the PR is merged.

import DataTableNoData from "@/shared/DataTableNoData/DataTableNoData";
import DataTableVirtualBody from "@/shared/DataTable/DataTableVirtualBody";
import ResourceCell from "@/shared/DataTableCells/ResourceCell";
import ItemSourceCell from "@/v2/pages/ExperimentsPage/GeneralDatasetsTab/ItemSourceCell";
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.

PromptPage imports ItemSourceCell from v2/pages/ExperimentsPage/..., which is a disallowed cross-page dependency, so should we move ItemSourceCell to shared/ or v2/pages-shared/ and use it from both pages?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages/PromptPage/ExperimentsTab/ExperimentsTab.tsx around
lines 23 and the `columnsDef` memo where the “Item source” column uses `cell:
ItemSourceCell`, you currently import ItemSourceCell from
`@/v2/pages/ExperimentsPage/GeneralDatasetsTab/ItemSourceCell`, which violates the “no
cross-page imports” guideline. Fix this by moving `ItemSourceCell` into a shared
location that can be consumed by both pages (e.g., `@/shared/...` or
`@/v2/pages-shared/...`), then update both PromptPage and ExperimentsPage to import it
from the new shared path and remove the old page-local import.

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.

Commit 4039975 addressed this comment by relocating ItemSourceCell into the shared v2/pages-shared/experiments directory and updating both PromptPage and ExperimentsPage to import the cell from that shared path, eliminating the disallowed cross-page dependency.

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.

Commit 4f39e97 addressed this comment by moving ItemSourceCell into @/v2/pages-shared/experiments/ItemSourceCell and updating the PromptPage's ExperimentsTab to import from the shared location instead of the ExperimentsPage-only path. The ExperimentsPage's GeneralDatasetsTab now also imports the shared ItemSourceCell and the new column label ensures consistent usage without cross-page dependency.

Comment on lines 207 to 215
},
{
id: COLUMN_DATASET_ID,
label: "Test suite",
label: "Item source",
type: COLUMN_TYPE.string,
cell: ResourceCell as never,
cell: ItemSourceCell as never,
customMeta: {
nameKey: "dataset_name",
idKey: "dataset_id",
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.

The dataset column repeats the same ItemSourceCell + customMeta in multiple files, so should we extract a shared ITEM_SOURCE_COLUMN constant/helper and reuse it instead of copy-pasting?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partially addressed. ITEM_SOURCE_LABEL is now a shared constant (exported from v2/pages-shared/experiments/ItemSourceCell), so the column label is no longer duplicated. The remaining customMeta for the dataset_id column already differs between ExperimentsTab (no datasetTypeMap, no group-by) and GeneralDatasetsTab (full grouping with datasetTypeMap/getResource), so an ITEM_SOURCE_COLUMN factory would need enough config knobs to cover both shapes — which would re-introduce most of the per-caller config it tries to eliminate. Leaving the column-level config inline keeps each callers tab obvious about what it supports.

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.

Thanks, that makes sense — the shared label constant addresses the real duplication, and keeping the remaining column config inline preserves each tab’s intent. I’ll save this to memory once the PR is merged.

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.

Commit 98e05eb addressed this comment by centralizing the item-source metadata: the new resolveItemSourceResource helper and shared ITEM_SOURCE_LABEL now keep both tables aligned on the same column semantics without copy-pasting the ItemSourceCell/customMeta plumbing, while still allowing each tab to keep any extra knobs inline.

import CostCell from "@/shared/DataTableCells/CostCell";
import PassRateCell from "@/shared/DataTableCells/PassRateCell";
import ResourceCell from "@/shared/DataTableCells/ResourceCell";
import ItemSourceCell from "@/v2/pages/ExperimentsPage/GeneralDatasetsTab/ItemSourceCell";
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.

helpers.ts imports ItemSourceCell from @/v2/pages/ExperimentsPage/..., violating the no cross-page import rule — should we move ItemSourceCell into a shared location (e.g. v2/pages-shared/ or shared/) and update all consumers, or move the ExperimentsPage-specific column config out of this shared helper entirely?

Finding types: Avoid tight coupling AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In
apps/opik-frontend/src/v2/pages-shared/dashboards/widgets/ExperimentsLeaderboardWidget/helpers.ts
around lines 17 and 60, remove the page-specific dependency on
`@/v2/pages/ExperimentsPage/GeneralDatasetsTab/ItemSourceCell`. Refactor by either: (a)
Moving `ItemSourceCell` into a shared module (e.g.
`apps/opik-frontend/src/v2/pages-shared/...` or `apps/opik-frontend/src/shared/...`),
updating barrel exports if needed, and changing the import in helpers.ts and any other
consumers to use the new shared path, or (b) Relocating the dataset/item-source column
configuration (including the `cell: ItemSourceCell as never` usage) out of this shared
`helpers.ts` so it lives within the ExperimentsPage scope where the component dependency
is appropriate. Ensure the shared dashboard helpers no longer import from
ExperimentsPage paths, the moved component remains functionally identical, and the
build/typecheck passes.

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.

Commit 4039975 addressed this comment by moving ItemSourceCell into the shared v2/pages-shared/experiments directory and updating the ExperimentsLeaderboardWidget helper (and other consumers such as GeneralDatasetsTab) to import it from the shared path, eliminating the cross-page dependency.

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.

Commit 4f39e97 addressed this comment by moving ItemSourceCell into the shared v2/pages-shared/experiments directory and updating helpers.ts (and the ExperimentsPage consumer) to import from that shared module, removing the cross-page dependency.

Comment on lines 572 to 582
const groupField = groups[index]?.field;
const groupLabel =
groupField === COLUMN_DATASET_ID
? "Item source"
: calculateGroupLabel(groups[index]);

return {
label: calculateGroupLabel(groups[index]),
label: groupLabel,
value:
label === DELETED_ENTITY_LABEL
? "Deleted test suite"
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.

The "Item source" label is hardcoded here and duplicated across ExperimentsTab.tsx and ExperimentWidgetDataSection.tsx, and the deleted-entity branch still hardcodes value: "Deleted test suite" — should we extract a shared ITEM_SOURCE_LABEL constant and align the deleted-entity value with the renamed dataset/item-source semantics?

Finding types: Extract naming constants Logical Bugs | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In GeneralDatasetsTab.tsx around lines 572-582, inside the `deepestExpandedGroups`
useMemo map: 1. Replace the hardcoded `"Item source"` string with a shared constant
(e.g., `ITEM_SOURCE_LABEL`), and update all other occurrences in `ExperimentsTab.tsx`
(around lines 209-214) and `ExperimentWidgetDataSection.tsx` (around lines 41-46) to
import and reuse the same constant. Add it to an appropriate shared constants/util
module if needed. 2. In the deleted-entity branch where `label ===
DELETED_ENTITY_LABEL`, replace the hardcoded `value: "Deleted test suite"` with the
correct value aligned to the renamed dataset/item-source semantics (consistent with the
non-deleted path and the `groupLabel`/`groupField === COLUMN_DATASET_ID` naming).

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.

Commit 4039975 addressed this comment by deriving the dataset-id group label as “Item source” and by updating the deleted-entity value to “Deleted dataset,” aligning the deleted branch with the renamed dataset/item-source semantics (the shared constant extraction is still pending).

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.

Commit 4f39e97 addressed this comment by updating the deleted-entity branch to return “Deleted dataset” and by ensuring dataset groups render the dataset-specific “Item source” label, aligning the new dataset/item-source semantics with the grouped rows.

awkoy and others added 2 commits April 27, 2026 17:31
…eleted-entity label

Resolves frontend dependency-cruiser violations: ItemSourceCell no longer
lives under a page module imported by another page or by pages-shared
helpers. Also retires the stale "Deleted test suite" string from the
chart legend in favor of a neutral "Deleted dataset" matching the
underlying entity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… unknown in group row label

Avoids confidently mislabeling unknown/deleted/orphan groups as "Dataset"
when the dataset is not in the loaded datasets slice. Returning an empty
string lets generateGroupedRowCellDef fall back to the static column
label, which is neutral and correct.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment on lines +50 to +54
<ResourceLink
id={id}
name={name}
resource={resource}
isDeleted={isDeleted}
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.

evaluation_method === EVALUATION_METHOD.TEST_SUITE only changes the icon, but ResourceLink still uses resource with callers hardcoding RESOURCE_TYPE.dataset, so test-suite routes end up with suiteId under a dataset path—should we switch the resource/RESOURCE_TYPE based on evaluation_method?

Finding type: Type Inconsistency | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/ItemSourceCell.tsx around lines 50-54
inside the `ItemSourceCell` render, the icon switches on `evaluation_method` but the
`ResourceLink` still uses the column meta `resource`, which results in dataset routing
when `evaluation_method === EVALUATION_METHOD.TEST_SUITE`. Refactor the component to
also select the `resource` passed to `ResourceLink` based on `evaluationMethod` (e.g.,
use `RESOURCE_TYPE.testSuite` for `TEST_SUITE`, otherwise fall back to the existing
`resource` from `custom`/meta). If you prefer not to hardcode, update the column meta
typing/usage so callers can pass an explicit test-suite resource override and ensure
`ItemSourceCell` uses it when `evaluation_method` indicates a test suite.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2cc586e. ItemSourceCell now derives both the icon and the RESOURCE_TYPE from evaluation_method directly (TEST_SUITE → RESOURCE_TYPE.testSuite, otherwise dataset). Removed the unused resource from the cell meta and dropped the now-redundant resource: RESOURCE_TYPE.dataset from all callers. The same fix was applied to the grouped variant in useExperimentsTableConfig.tsx via a new getResource callback on ResourceCell.Group, falling back to datasetTypeMap when the row lacks evaluation_method.

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.

Thanks for the update — that makes sense. I’ll save this to memory once the PR is merged.

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.

Commit 2cc586e addressed this comment by removing the hardcoded resource metadata and deriving both the icon and ResourceLink resource from evaluation_method, so test-suite rows now pass RESOURCE_TYPE.testSuite (with datasets kept in their own branch). This ensures the link targets the correct route whenever the evaluation is a test suite.

awkoy and others added 2 commits April 27, 2026 18:43
…bel to match Figma

Figma OPIK-6167 shows the prefix as "Test suite test_suite_name (23)"
(no colon between the label and the linked entity). Add an additive
hideGroupRowLabelColon flag in customMeta and set it for the dataset
group case in v2; v1 group rows keep their existing colon since they
do not pass the flag.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…on evaluation_method

- ItemSourceCell: derive resource (and icon) from evaluation_method so
  TEST_SUITE experiments link to /test-suites/{suiteId}/items instead of
  the dataset URL; drop now-redundant resource field from customMeta.
- ResourceCell.Group: add optional getResource(cellData) callback so
  callers can pick the link's resource at render time.
- useExperimentsTableConfig: wire getResource on the dataset_id group
  cell to switch to RESOURCE_TYPE.testSuite when the row is a test
  suite, and read evaluation_method on the row directly in
  getGroupRowLabel before falling back to datasetTypeMap (covers
  datasets beyond the page-1 slice fetched by useDatasetsList).
- Extract ITEM_SOURCE_LABEL constant from ItemSourceCell and reuse it
  across the experiments table, filters/groups config, dashboard
  widgets, and prompt experiments tab to avoid drift.
Comment on lines +261 to +264
const datasetId = get(row, `${metaKey}.value`, "") as string;
if (datasetTypeMap?.[datasetId] === DATASET_TYPE.TEST_SUITE)
return RESOURCE_TYPE.testSuite;
return RESOURCE_TYPE.dataset;
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.

datasetTypeMap is only filled from the first 1000 datasets in useGroupedExperimentsList, so missing entries get treated as RESOURCE_TYPE.dataset and getResource can misclassify grouped rows with absent evaluation_method; should we fetch the resource type from the grouped row/backend instead of a partial client-side map?

Finding type: Type Inconsistency | Severity: 🟠 Medium


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/useExperimentsTableConfig.tsx around
lines 261-264 inside the group column CASE COLUMN_DATASET_ID customMeta `getResource`
(and the related `getGroupRowLabel` block around lines 274-289), the code derives
resource type from `datasetTypeMap?.[datasetId]` and then defaults to
RESOURCE_TYPE.dataset when the map is missing due to only being built from the first
1000 datasets. Refactor this so it does not depend on the partial client-side
`datasetTypeMap` for correctness when `evaluation_method` is absent—source the dataset
type from the grouped row/backend response (preferred) by adding/using a field like
dataset_type/resource_type in the grouped experiments list, or otherwise make the
fallback explicit (return an unknown/undefined resource type and ensure
ResourceLink/group label doesn’t mis-route). Also deduplicate the
evaluation_method/type-to-label logic so `getResource` and `getGroupRowLabel` use the
same helper and the same source of truth.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made the fallback explicit in 98e05eb. getResource and getGroupRowLabel now share a single resolver (resolveItemSourceResource) that returns undefined when neither evaluation_method nor datasetTypeMap[dataset_id] resolves to a known type. The group cell (ResourceCell.Group) renders the name as plain text without a link in that case instead of routing to /datasets/:id/items. Group label falls back to "Item source" rather than "Dataset". Hydrating datasetTypeMap across all dataset pages would still be a defensible improvement (or surfacing evaluation_method directly on the grouped row response), but the silent mis-route is gone — when we cant prove the type, we dont link.

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.

Thanks, that makes sense — the explicit unknown-type fallback removes the silent mis-route concern. I'll save this to memory once the PR is merged.

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.

Commit 98e05eb addressed this comment by introducing resolveItemSourceResource so both the group label and ResourceLink logic now derive the resource type from the row’s evaluation_method when present before falling back to the datasetTypeMap, eliminating the misclassification caused by the partial map and ensuring grouped rows without evaluation_method stay unrouted rather than defaulting to DATASET.

Comment on lines +39 to +43
const isTestSuite = evaluationMethod === EVALUATION_METHOD.TEST_SUITE;
const Icon = isTestSuite ? ListChecks : Database;
const resource = isTestSuite
? RESOURCE_TYPE.testSuite
: RESOURCE_TYPE.dataset;
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.

evaluation_method only gates the test-suite case, so missing/undefined rows get resolved via the dataset path (show dataset icon/link and go to /datasets/:datasetId/items) instead of /test-suites/:suiteId/items; should we resolve the resource like useExperimentsTableConfig or pass a precomputed resource?

Finding type: Type Inconsistency | Severity: 🟠 Medium


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/ItemSourceCell.tsx around lines 39-43
(the component logic that sets `isTestSuite`, `Icon`, and `resource`), the code treats a
missing/undefined `evaluation_method` as “not test suite” and always falls back to
`RESOURCE_TYPE.dataset`. Refactor this so the resource/icon selection uses the same
fallback strategy as `useExperimentsTableConfig` (i.e., determine the correct resource
type when `Experiment.evaluation_method` is optional/missing) or change the component
API to accept a precomputed `resource` from the parent/table config. After the change,
ensure rows that represent test suites navigate to `/test-suites/:suiteId/items` rather
than `/datasets/:datasetId/items` when `evaluation_method` is absent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Aligned with useExperimentsTableConfig in 98e05eb. ItemSourceCell now reads datasetTypeMap from tableMeta and uses the shared resolveItemSourceResource resolver: evaluation_method first, then datasetTypeMap[dataset_id], otherwise undefined. When the resolver returns undefined, the cell renders the name as plain text (no link, default Database icon) rather than mis-routing to /datasets/:id/items. Added datasetTypeMap?: Record<string, DATASET_TYPE> to the TableMeta augmentation so any consumer that already has the map can plumb it through meta.

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.

Thanks for the clarification — that shared resolver and datasetTypeMap fallback make sense here. I'll save this to memory once the PR is merged.

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.

Commit 98e05eb addressed this comment by introducing resolveItemSourceResource, which mirrors useExperimentsTableConfig’s fallback and checks both evaluation_method and the datasetTypeMap stored on the table meta before deciding a RESOURCE_TYPE. ItemSourceCell now only renders the ResourceLink when this resolver returns a resource, ensuring that rows with missing evaluation_method but dataset metadata indicating a test suite still resolve to the test-suite route rather than defaulting to datasets.

…nown

When an experiment row lacks evaluation_method and the dataset isn't
in the (page-1-only) datasetTypeMap, ItemSourceCell and the dataset
group cell were silently routing to /datasets/:id/items, which 404s
for test suites. Extract a shared resolveItemSourceResource helper,
plumb datasetTypeMap through TableMeta so ItemSourceCell can use the
same fallback as the group cell, and render plain text (no link)
when the resource type can't be determined.
Comment on lines +15 to +19
export const resolveItemSourceResource = (
evaluationMethod: EVALUATION_METHOD | undefined,
datasetId: string | undefined,
datasetTypeMap?: Record<string, DATASET_TYPE>,
): RESOURCE_TYPE | undefined => {
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.

resolveItemSourceResource adds branching for TEST_SUITE/DATASET, datasetTypeMap fallback, and undefined, but there’s no Vitest coverage in apps/opik-frontend/src/v2/pages-shared/experiments (or helper tests elsewhere) to lock the resource/link and label mappings—should we add a small unit test suite for the helper’s branch cases?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/ItemSourceCell.tsx around lines
15-32, the resolveItemSourceResource helper has multiple conditional branches
(TEST_SUITE, DATASET, datasetId+datasetTypeMap mapping, and undefined fallback) but
there’s no Vitest coverage to prevent regressions. Add a small Vitest test suite (per
.agents/skills/opik-frontend/testing.md) that imports resolveItemSourceResource and
asserts the returned RESOURCE_TYPE for: evaluationMethod=TEST_SUITE,
evaluationMethod=DATASET, datasetTypeMap mapping to TEST_SUITE and DATASET when
datasetId is present, and cases where datasetId/datasetTypeMap are missing or mapping
doesn’t match (expect undefined). Place the test alongside the helper (or in the
nearest existing __tests__/vitest setup for this folder) and ensure it runs in the
current frontend test config.

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.

Commit 8e75bf6 addressed this comment by removing resolveItemSourceResource and its branching logic from ItemSourceCell; the component now directly infers resource type without the helper, so there is no longer a helper to cover with those Vitest cases.

…e-test-suite-column-to-item-source

# Conflicts:
#	apps/opik-frontend/src/v2/pages-shared/experiments/useExperimentsGroupsAndFilters.ts
@awkoy awkoy added the test-environment Deploy Opik adhoc environment label Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

…plumbing

Reverts 98e05eb surgically — keeps the rename, dynamic icon, and
test-suite routing from the prior commits, and drops:
- DataTable TableMeta augmentation with datasetTypeMap (touched table core)
- ResourceCell.Group signature widening + plain-text fallback (shared cell)
- resolveItemSourceResource helper + datasetTypeMap plumbing in ItemSourceCell
- shared resolver call sites in useExperimentsTableConfig

Group cell falls back to RESOURCE_TYPE.dataset when the type is unknown,
which can mis-route deleted/orphan rows. That's an acceptable trade-off
for OPIK-6167 versus modifying core table types and shared cells.
@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

awkoy and others added 2 commits April 29, 2026 17:08
…pedRowCellDef

generateGroupedRowCellDef is a shared helper. getGroupRowLabel and
hideGroupRowLabelColon were added solely for the experiments dataset
column — neither has any other caller. They don't belong in shared
table utils.

Group rows now show the column's static "Item source" label with the
default trailing colon, matching every other grouped table.
…amic prefix

- Wrap data-cell icon in slate-100 24x24 rounded pill matching Figma node 6095:48496
- Add createItemSourceGroupCell factory owning the full group-row layout
  (checkbox + chevron + dynamic prefix + resource link/text + count + explainer),
  keeping generateGroupedRowCellDef and ResourceCell.Group untouched
- Pass datasetTypeMap via column customMeta instead of TableMeta

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment on lines +96 to +105
if (datasetId && datasetTypeMap) {
const t = datasetTypeMap[datasetId];
if (t === DATASET_TYPE.TEST_SUITE) {
return { prefix: "Test suite", resource: RESOURCE_TYPE.testSuite };
}
if (t === DATASET_TYPE.DATASET) {
return { prefix: "Dataset", resource: RESOURCE_TYPE.dataset };
}
}
return { prefix: ITEM_SOURCE_LABEL, resource: undefined };
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.

If datasetTypeMap lacks a grouped dataset_id, this falls back to ITEM_SOURCE_LABEL with resource: undefined, so ItemSourceGroupCell renders plain text instead of the dataset/test-suite ResourceLink; can we preserve the resource for the group row or make the type map exhaustive?

Finding type: Logical Bugs | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/ItemSourceCell.tsx around lines
85-105, the resolveGroupPrefix fallback returns { prefix: ITEM_SOURCE_LABEL, resource:
undefined } when datasetId is present but datasetTypeMap doesn’t include it, causing
ItemSourceGroupCell (lines 194-205) to render plain text instead of the ResourceLink for
grouped dataset/test-suite rows. Refactor resolveGroupPrefix to avoid dropping the
specific RESOURCE_TYPE when the type map is incomplete—either (a) infer the resource
from other fields already available in cellData (e.g., evaluation_method or dataset type
metadata) or (b) add a second, safer lookup/fallback so that if evaluationMethod is
DATASET you still return resource: RESOURCE_TYPE.dataset and a consistent prefix even
when datasetTypeMap lacks the id. Then adjust ItemSourceGroupCell’s conditional
rendering (lines 194-205) only if needed so id + derived resource always results in
ResourceLink for grouped rows.

Comment on lines +153 to +157
<CellWrapper
metadata={context.column.columnDef.meta}
tableMetadata={context.table.options.meta}
className="items-center p-0 pr-2"
stopClickPropagation
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.

ItemSourceGroupCell duplicates the grouped-row checkbox/expand/depth padding already in generateGroupedRowCellDef in shared/DataTable/utils.tsx, so could we keep the shared grouped-row wrapper and only override the inner content (prefix/ResourceLink)?

Finding type: Code Dedup and Conventions | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label Apr 30, 2026
@awkoy awkoy added the test-environment Deploy Opik adhoc environment label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

aadereiko
aadereiko previously approved these changes Apr 30, 2026
Copy link
Copy Markdown
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

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

The code looks good!

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label May 1, 2026
@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

2 similar comments
@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@awkoy awkoy added the test-environment Deploy Opik adhoc environment label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@awkoy awkoy removed the test-environment Deploy Opik adhoc environment label May 4, 2026
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@awkoy awkoy added the test-environment Deploy Opik adhoc environment label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label May 5, 2026
@awkoy awkoy added the test-environment Deploy Opik adhoc environment label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@awkoy awkoy added test-environment Deploy Opik adhoc environment and removed test-environment Deploy Opik adhoc environment labels May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label May 6, 2026
@awkoy awkoy added the test-environment Deploy Opik adhoc environment label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 2.0.19-5201 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch awkoy/opik-6167-rename-test-suite-column-to-item-source
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6504) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants