[NA] [FE] feat: add Copy dataset ID action to datasets list row menu#7507
[NA] [FE] feat: add Copy dataset ID action to datasets list row menu#7507AndreiCautisanu wants to merge 1 commit into
Conversation
Adds a "Copy {entity} ID" item (clipboard + toast) to the shared dataset/test-suite
row actions cell, following the trace panel's copy idiom. Ships with its
@release-gate happy-path spec per the dev-driven testing workflow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
⏱️ pre-commit per-hook timing
⏭️ 39 skipped (no matching files changed)
|
| <DropdownMenuItem | ||
| onClick={() => { | ||
| toast({ description: `Copied ${entityName} ID to clipboard` }); | ||
| copy(dataset.id); | ||
| }} |
There was a problem hiding this comment.
The toast fires before copy(dataset.id) settles, so users see a success message even when the clipboard write rejects — should we make the handler async, await copy(dataset.id) first, and show the toast only on fulfillment with a destructive error toast in the catch?
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/datasets/DatasetRowActionsCell/DatasetRowActionsCell.tsx
around lines 130-134, the "Copy {entityName} ID" DropdownMenuItem onClick shows the
success toast before copy(dataset.id) completes, and doesn't handle rejections. Refactor
the handler to be async, await copy(dataset.id) first, then call toast({ description:
`Copied ${entityName} ID to clipboard` }) only on success. Add a try/catch (or .catch)
that shows a destructive error toast (e.g., "Copy failed") when the clipboard write
rejects, so the UI never silently reports success on failure.
| @@ -0,0 +1,53 @@ | |||
| // Copy-dataset-ID row action — the datasets list row menu gains a "Copy dataset ID" | |||
There was a problem hiding this comment.
Undiscoverable release-gate file
copy-dataset-id.spec.ts breaks the release-gate ticket-key naming convention, so discovery and ownership can drift from the one-file-per-ticket contract — should we rename it to opik-7167.spec.ts, as .agents/skills/explore-feature/release-gate-contract.md requires?
Want Baz to fix this for you? Activate Fixer You can also update your AI coding guidelines based on this comment by apply pr to [branch name]
Other fix methods
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
tests_end_to_end/e2e/tests/_release-gate/copy-dataset-id.spec.ts around lines 1-53,
rename this spec file to match the release-gate contract for OPIK-7167 (use
`opik-7167.spec.ts` instead of `copy-dataset-id.spec.ts`). Also search the repo for any
references to `copy-dataset-id.spec.ts` (test discovery config, docs, links, or scripts)
and update them so the gate still runs and ownership/discovery aligns with the contract.
Details
Adds a "Copy dataset ID" item to the datasets list row actions menu (clipboard + confirmation toast), mirroring the trace panel's existing "Copy trace ID" idiom. The shared row-actions cell serves both Datasets and Test Suites, so Test Suites gets "Copy test suite ID" for free.
This PR is also the live demo of the dev-driven testing workflow (OPIK_7167 initiative — related, not resolved here): its happy-path
@release-gatespec (tests_end_to_end/e2e/tests/_release-gate/copy-dataset-id.spec.ts, stamped@release-gate:2.1.33) was generated by the/explore-featureskill from the uncommitted local diff — pre-PR — and ships inside this PR, as the workflow intends.Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
cd tests_end_to_end/e2e && OPIK_BASE_URL=http://localhost:5174 OPIK_DEPLOYMENT=oss npm run test:release-gate→1 passed (6.7s)(seeded dataset → row menu → Copy dataset ID → toast asserted + clipboard readback equals the dataset id).npm run typecheckand eslint on the changed file: clean.@release-gate, which is excluded from@t1/@t2/@t3).Documentation