Skip to content

[refactor] Delete duplicate InfiniteVirtualTable, migrate to @agenta/ui - #5471

Merged
ardaerzin merged 4 commits into
release/v0.106.1from
ts-chore/table-consolidation
Jul 29, 2026
Merged

[refactor] Delete duplicate InfiniteVirtualTable, migrate to @agenta/ui#5471
ardaerzin merged 4 commits into
release/v0.106.1from
ts-chore/table-consolidation

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

InfiniteVirtualTable existed twice: 55 files in oss/src/components/InfiniteVirtualTable and the canonical 67-file copy in @agenta/ui. The OSS copy was a strict subset (zero files it had that the package didn't; 21 of its 55 were byte-identical). Any fix to the table library had to be applied to both copies or they silently diverged. This session hit that twice on its own: the rowSelection.fixed widening and the ExtendedColumnType consolidation each had to be duplicated.

This deletes the OSS copy and points its 33 consumers at the package.

Changes

  • 33 consumers migrated from @/oss/components/InfiniteVirtualTable to @agenta/ui/table. The package barrel already re-exported every symbol they used, so most were pure import-path swaps.
  • The 55-file OSS copy is deleted.
  • The package now exports ColumnVisibilityNodeMeta / ColumnVisibilityNodeMetaResolver, which one migrated consumer needs.

Net: +93 / −10,073 lines.

The permission gate (the one thing tsc could not catch)

The retired OSS shell computed export visibility internally:

exportEnabled = enableExport && canExportData   // via useProjectPermissions

The package shell has no permission check and defaults enableExport = true, expecting the consumer to gate it (its existing consumers already do). Two OSS consumers passed no enableExport and relied entirely on the OSS shell's implicit gate: EvalRunDetails/Table.tsx and EvaluationRunsTablePOC/.../EvaluationRunsTable/index.tsx. Migrating them as-is would have shown an export button to users without export permission, and both sides are boolean, so no type check would flag it. Both now pass enableExport={canExportData} explicitly.

TestsetsTable type reconciliations

Two spots where the package types are wider than the OSS copy's, both behavior-preserving:

  • String(record.key) at two Set<string> / string[] lookups. The package row base types key as React.Key (string | number); testset keys are UUIDs, so the coercion is a runtime no-op.
  • as never on the datasetStore prop. The store generic is invariant on its ApiRow parameter; this mirrors DeploymentsTable, an existing package consumer.

Tests / notes

What to QA

The migration is import-level, so the risk is behavioral parity of the two table implementations, concentrated on export permissions.

  • As a user WITHOUT export permission, open the evaluation runs list and an evaluation run's detail table. The export button/action must NOT appear. This is the regression this PR most needs verified.
  • As a user WITH export permission, the same two tables show export and it works.
  • Smoke the other migrated tables: testsets, testcases, observability, the add-to-testset drawer. Rendering, sorting, column visibility, row selection, and pagination behave as before.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 29, 2026 12:52pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f42b730-084f-481d-b2fb-f35d6736636e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR removes the entire local InfiniteVirtualTable component tree from web/oss and migrates all consumers to import table utilities, hooks, and types from the @agenta/ui/table package instead. It also adds export-permission gating (enableExport) based on useProjectPermissions, extends ExtendedColumnProps with new optional fields, and introduces new evaluation-run type definitions.

Changes

Table Package Migration

Layer / File(s) Summary
Remove local InfiniteVirtualTable module
web/oss/src/components/InfiniteVirtualTable/*
Entire local component tree (stores, hooks, columns, contexts, providers, features, helpers, types, barrel index) is deleted.
Extend @agenta/ui/table package public API
web/packages/agenta-ui/src/InfiniteVirtualTable/index.ts, .../types.ts
Adds new type re-exports and new optional ExtendedColumnProps fields (defaultHidden, maxWidth, exportEnabled).
EvalRunDetails import migration and export gating
web/oss/src/components/EvalRunDetails/*
Import sources switched to @agenta/ui/table; canExportData from useProjectPermissions wired into enableExport prop.
EvaluationRunsTablePOC import migration, types, and export gating
web/oss/src/components/EvaluationRunsTablePOC/*
Import sources switched to @agenta/ui/table, enableExport wired, and new evaluation-run type contracts added.
TestcasesTableNew, TestsetsTable, Playground/SharedDrawers migration
web/oss/src/components/TestcasesTableNew/*, .../TestsetsTable/*, .../Playground/..., .../SharedDrawers/...
Imports for row height, description, column types, filters, and table manager hooks switched to @agenta/ui/table, plus minor type-cast and key-coercion fixes.
Observability columns and state store migration
web/oss/src/components/pages/observability/*, web/oss/src/state/entities/*
Column type imports and paginated entity store type imports switched to @agenta/ui/table.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 60.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 clearly summarizes the main change: removing the duplicate InfiniteVirtualTable and migrating consumers to @agenta/ui.
Description check ✅ Passed The description is directly related to the changeset and accurately explains the migration, deletions, and permission gating changes.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts-chore/table-consolidation

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.

@ashrafchowdury

Copy link
Copy Markdown
Contributor

Did we really have this duplicated virtual table on oss ?? 🤯

@ardaerzin
ardaerzin requested a review from ashrafchowdury July 29, 2026 10:01
@ardaerzin
ardaerzin changed the base branch from ts-chore/dedupe-api-types to release/v0.106.1 July 29, 2026 10:56
Prep for retiring the duplicate InfiniteVirtualTable in oss/src/components
(55 files, a strict subset of the 67-file @agenta/ui copy).

The two copies had grown parallel abstractions for the same concept: the
package's ExtendedColumn/ExtendedColumnProps and an ExtendedColumnType added
to the OSS copy. Their bases were already equivalent (ColumnsType[number] IS
ColumnType | ColumnGroupType), so the package type just gained the three props
it lacked (defaultHidden, maxWidth, exportEnabled) and the OSS type is now an
alias of it.

Three files imported BOTH copies at once (TestcasesTableShell,
getObservabilityColumns, getSessionColumns); each needed only the column type
from the OSS side, so they now take it from the package. No file imports both
copies anymore.
…ta/ui

The library existed twice: 55 files in oss/src/components/InfiniteVirtualTable
(a strict subset) and the canonical 67-file copy in @agenta/ui. Fixes to
either had to be applied to both — this session alone hit that with the
rowSelection.fixed widening and the ExtendedColumnType consolidation.

- Migrated all 33 app consumers from @/oss/components/InfiniteVirtualTable to
  @agenta/ui/table (the barrel already re-exported every symbol they used).
- Deleted the 55-file OSS copy.
- Package exports ColumnVisibilityNodeMeta / ColumnVisibilityNodeMetaResolver
  (needed by a migrated consumer).

Preserved the export permission gate. The retired OSS shell computed
exportEnabled = enableExport && canExportData internally; the package shell has
no permission check and defaults enableExport=true. The two consumers that
relied on the implicit gate (EvalRunDetails/Table.tsx,
EvaluationRunsTablePOC/.../EvaluationRunsTable/index.tsx) now pass
enableExport={canExportData} explicitly. tsc could not have caught this — both
sides are boolean.

TestsetsTable needed two behavior-preserving adjustments where the package
types are wider: String(record.key) at two Set<string>/string[] lookups (keys
are UUIDs, so a no-op) and 'as never' on the invariant datasetStore generic
(mirrors DeploymentsTable).
@ardaerzin
ardaerzin force-pushed the ts-chore/table-consolidation branch from 1b3be94 to 5ca6ce1 Compare July 29, 2026 12:32
@ardaerzin
ardaerzin marked this pull request as ready for review July 29, 2026 12:35
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Frontend refactoring A code change that neither fixes a bug nor adds a feature labels Jul 29, 2026
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 29, 2026
@ardaerzin
ardaerzin merged commit 65e83ca into release/v0.106.1 Jul 29, 2026
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend lgtm This PR has been approved by a maintainer refactoring A code change that neither fixes a bug nor adds a feature size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants