Skip to content

feat(experiments): Add inline add/remove from experiment actions - #923

Merged
shanaiabuggy merged 2 commits into
mainfrom
sbuggy/ase-672
Jul 27, 2026
Merged

feat(experiments): Add inline add/remove from experiment actions#923
shanaiabuggy merged 2 commits into
mainfrom
sbuggy/ase-672

Conversation

@shanaiabuggy

@shanaiabuggy shanaiabuggy commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-07-27.at.2.15.07.PM.mov

Summary by CodeRabbit

Summary

  • New Features

    • Added a right-pinned row actions menu for experiment group evaluations, with per-row options to add to another group or remove from the current group.
  • Bug Fixes

    • Prevented “remove from group” when it would leave an evaluation in no groups.
    • Improved handling to avoid action conflicts while a row update is in progress.
  • Tests

    • Expanded hook tests to cover successful and failing “remove from group” mutation behavior and error toasts.

Signed-off-by: shanaiabuggy <59746633+shanaiabuggy@users.noreply.github.com>
@shanaiabuggy
shanaiabuggy requested review from a team as code owners July 27, 2026 20:18
@github-actions github-actions Bot added the feat label Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f0ba9722-3544-490d-bd91-73f4c94a07db

📥 Commits

Reviewing files that changed from the base of the PR and between 5afa1fb and 3117dee.

📒 Files selected for processing (1)
  • web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.ts

📝 Walkthrough

Walkthrough

Adds a right-pinned row actions menu to the experiment group table and implements removeFromGroup with validation, patching, query invalidation, toasts, and tests.

Changes

Experiment group actions

Layer / File(s) Summary
Group removal mutation and validation
web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.ts, web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.test.ts
The hook exposes removeFromGroup, blocks removal of the last group, patches remaining experiment_ids, manages mutation state, invalidates queries, and reports success or failure toasts. Tests cover both removal paths.
Pinned row actions menu
web/packages/studio/src/components/dataViews/ExperimentGroupDataView/index.tsx
The table adds a right-pinned actions column with “Add to group” and “Remove from group” actions wired to local state and removeFromGroup.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant QuickActionsMenuRoot
  participant useExperimentGroupEvaluations
  participant usePatchEvaluation
  User->>QuickActionsMenuRoot: Select Remove from group
  QuickActionsMenuRoot->>useExperimentGroupEvaluations: removeFromGroup(row)
  useExperimentGroupEvaluations->>usePatchEvaluation: Patch remaining experiment_ids
  usePatchEvaluation-->>useExperimentGroupEvaluations: Return mutation result
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding inline add/remove actions for experiments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sbuggy/ase-672

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/packages/studio/src/components/dataViews/ExperimentGroupDataView/index.tsx (1)

39-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Place lucide-react with external imports.

Line 44 is an external import but follows internal @studio imports.

As per coding guidelines, group imports as external libraries, internal modules, then relative imports.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/packages/studio/src/components/dataViews/ExperimentGroupDataView/index.tsx`
around lines 39 - 44, Move the lucide-react import containing Columns3,
FolderMinus, FolderPlus, and Pin above the internal `@studio` imports, preserving
the grouping order of external libraries, internal modules, and relative
imports.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.ts`:
- Around line 195-201: Update the onSuccess handler in the evaluation removal
mutation to return the invalidateList() promise after showing the success toast.
Keep the existing onSettled cleanup unchanged so pendingRef remains locked until
invalidation completes.

---

Nitpick comments:
In
`@web/packages/studio/src/components/dataViews/ExperimentGroupDataView/index.tsx`:
- Around line 39-44: Move the lucide-react import containing Columns3,
FolderMinus, FolderPlus, and Pin above the internal `@studio` imports, preserving
the grouping order of external libraries, internal modules, and relative
imports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fa9931ab-fc94-4ab3-88cf-f497b0b8d1ad

📥 Commits

Reviewing files that changed from the base of the PR and between ee4dfd8 and a74083a.

📒 Files selected for processing (3)
  • web/packages/studio/src/components/dataViews/ExperimentGroupDataView/index.tsx
  • web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.test.ts
  • web/packages/studio/src/components/dataViews/ExperimentGroupDataView/useExperimentGroupEvaluations.ts

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 27236/34958 77.9% 62.2%
Integration Tests 15999/33670 47.5% 19.9%

shanaiabuggy added a commit that referenced this pull request Jul 27, 2026
Address CodeRabbit on PR #923: removeFromGroup's onSuccess called invalidateList()
fire-and-forget, so onSettled could clear the pending-row lock before the refetch
finished. Return the invalidation promise (like the pin/unpin mutations) so the row
stays locked until the list updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: shanaiabuggy <59746633+shanaiabuggy@users.noreply.github.com>
Address CodeRabbit on PR #923: removeFromGroup's onSuccess called invalidateList()
fire-and-forget, so onSettled could clear the pending-row lock before the refetch
finished. Return the invalidation promise (like the pin/unpin mutations) so the row
stays locked until the list updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: shanaiabuggy <59746633+shanaiabuggy@users.noreply.github.com>
@shanaiabuggy
shanaiabuggy enabled auto-merge July 27, 2026 20:58
@shanaiabuggy
shanaiabuggy added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 95d25c1 Jul 27, 2026
60 checks passed
@shanaiabuggy
shanaiabuggy deleted the sbuggy/ase-672 branch July 27, 2026 21:33
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.

2 participants