Skip to content

[NA] [FE] feat: add Copy dataset ID action to datasets list row menu#7507

Draft
AndreiCautisanu wants to merge 1 commit into
mainfrom
andreic/NA-copy-dataset-id
Draft

[NA] [FE] feat: add Copy dataset ID action to datasets list row menu#7507
AndreiCautisanu wants to merge 1 commit into
mainfrom
andreic/NA-copy-dataset-id

Conversation

@AndreiCautisanu

@AndreiCautisanu AndreiCautisanu commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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-gate spec (tests_end_to_end/e2e/tests/_release-gate/copy-dataset-id.spec.ts, stamped @release-gate:2.1.33) was generated by the /explore-feature skill from the uncommitted local diff — pre-PR — and ships inside this PR, as the workflow intends.

Change checklist

  • User facing
  • Documentation update

Issues

  • NA (UI nicety; no ticket yet — will be linked when created)

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): Claude Fable 5
  • Scope: full implementation (feature + skill-generated release-gate spec), human-directed
  • Human verification: scope gate confirmed by the author; spec run green locally against a from-main stack

Testing

  • cd tests_end_to_end/e2e && OPIK_BASE_URL=http://localhost:5174 OPIK_DEPLOYMENT=oss npm run test:release-gate1 passed (6.7s) (seeded dataset → row menu → Copy dataset ID → toast asserted + clipboard readback equals the dataset id).
  • FE npm run typecheck and eslint on the changed file: clean.
  • Not run: full E2E tiers (unaffected — the new spec carries only @release-gate, which is excluded from @t1/@t2/@t3).

Documentation

  • N/A (UI nicety; behavior is discoverable in the row menu).

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>
@github-actions github-actions Bot added Frontend tests Including test files, or tests related like configuration. labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ pre-commit per-hook timing

Hook Description Result Duration
🌐 typecheck — frontend Whole-project tsc type check 42.91s
🌐 eslint — frontend Lint + autofix JS/TS 2.83s
Total (2 ran) 45.74s
⏭️ 39 skipped (no matching files changed)
Hook Description Result
🐍 trim trailing whitespace — python sdk Strip trailing whitespace ⏭️
🐍 fix end of files — python sdk Ensure files end in a newline ⏭️
🐍 ruff — python sdk Lint + autofix Python (ruff) ⏭️
🐍 ruff-format — python sdk Format Python code (ruff) ⏭️
🐍 mypy — python sdk Static type check ⏭️
🤖 trim trailing whitespace — optimizer Strip trailing whitespace ⏭️
🤖 fix end of files — optimizer Ensure files end in a newline ⏭️
🤖 check yaml — optimizer Validate YAML syntax ⏭️
🤖 check json — optimizer Validate JSON syntax ⏭️
🤖 check toml — optimizer Validate TOML syntax ⏭️
🤖 check for added large files — optimizer Block large files (>1MB) ⏭️
🔐 detect private key — optimizer Block committed private keys ⏭️
🤖 check for merge conflicts — optimizer Block merge-conflict markers ⏭️
🤖 check for case conflicts — optimizer Block case-only name clashes ⏭️
🤖 pyupgrade — optimizer Modernize Python syntax ⏭️
🤖 ruff — optimizer Lint + autofix Python (ruff) ⏭️
🤖 ruff-format — optimizer Format Python code (ruff) ⏭️
🤖 mypy — optimizer Static type check ⏭️
📓 nbstripout — optimizer notebooks Strip notebook output ⏭️
📝 markdownlint — optimizer Lint Markdown ⏭️
🔤 codespell — optimizer Fix common misspellings ⏭️
📊 radon cc — optimizer Cyclomatic-complexity gate ⏭️
📊 radon raw — optimizer Raw size metrics gate ⏭️
📊 xenon — optimizer Fail on complexity thresholds ⏭️
📊 lizard — optimizer Cyclomatic-complexity gate ⏭️
🧹 vulture — optimizer Find dead code ⏭️
🛡️ trim trailing whitespace — guardrails Strip trailing whitespace ⏭️
🛡️ fix end of files — guardrails Ensure files end in a newline ⏭️
🛡️ ruff — guardrails Lint + autofix Python (ruff) ⏭️
🛡️ ruff-format — guardrails Format Python code (ruff) ⏭️
🛡️ mypy — guardrails Static type check ⏭️
⚓ helm-docs Regenerate Helm chart README ⏭️
block non-public FE plugins Block non-public FE plugins ⏭️
☕ spotless — java backend Format Java code ⏭️
🧪 pre-commit wrapper smoke tests Self-test the wrapper scripts ⏭️
📘 eslint — typescript sdk Lint + autofix JS/TS ⏭️
📘 typecheck — typescript sdk Whole-project tsc type check ⏭️
⚙️ actionlint — github workflows Lint GitHub Actions workflows ⏭️
🐳 hadolint — dockerfiles Lint Dockerfiles ⏭️

Comment on lines +130 to +134
<DropdownMenuItem
onClick={() => {
toast({ description: `Copied ${entityName} ID to clipboard` });
copy(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 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?

Severity web_search

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/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"

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.

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?

Severity

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

Fix in Cursor

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.

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

Labels

baz: pending Frontend 🟢 size/S tests Including test files, or tests related like configuration. typescript *.ts *.tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant