phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

fix(splits): Make split assignment idempotent

Open ArcticFaded opened this issue 5 months ago • 0 comments

[!NOTE] Replaces add/remove split mutations with a single idempotent set-example-splits operation and updates the UI to use it with improved menu behavior.

  • GraphQL API:
    • Remove addDatasetExamplesToDatasetSplits and removeDatasetExamplesFromDatasetSplits inputs/mutations/payloads.
    • Add setDatasetExampleSplits with SetDatasetExampleSplitsInput and SetDatasetExampleSplitsMutationPayload returning a single example.
  • Backend (src/phoenix/server/api/mutations/dataset_split_mutations.py):
    • Implement set_dataset_example_splits to atomically set splits for an example (validates IDs, deletes missing, inserts new; uses joinedload and tuple_).
    • Remove legacy add/remove example-split mutations and related types.
  • Frontend (app/src/pages/examples/ExamplesSplitMenu.tsx):
    • Switch to ExamplesSplitMenuSetDatasetExampleSplitsMutation and update apply logic to send full splitIds per exampleId.
    • Change apply menu to single-select with manual open-state control to keep menu open on actions; add onAction handler and checkbox state sync.
    • Remove generated file for old remove mutation; add/update generated file for new set mutation.

Written by Cursor Bugbot for commit 18bb22d2901a75950eebc305c6a108b2d9f6ebea. This will update automatically on new commits. Configure here.

ArcticFaded avatar Nov 13 '25 05:11 ArcticFaded