Skip to content

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

Draft
ardaerzin wants to merge 2 commits into
ts-chore/dedupe-api-typesfrom
ts-chore/table-consolidation
Draft

[refactor] Delete duplicate InfiniteVirtualTable, migrate to @agenta/ui#5471
ardaerzin wants to merge 2 commits into
ts-chore/dedupe-api-typesfrom
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.

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).
@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 23, 2026 6:46pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: 07ef82a8-328e-4050-888e-23ef2805d8f9

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
✨ Finishing Touches
🧪 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.

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.

1 participant