Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ArcticFaded
Copy link
Contributor

@ArcticFaded ArcticFaded commented Sep 30, 2025

Note

Enable creating dataset splits with selected examples and return affected examples from split add/remove mutations; update UI and Relay to use new payloads and prepend newly created splits.

  • GraphQL Schema:
    • Add examples: [DatasetExample!]! to AddDatasetExamplesToDatasetSplitsMutationPayload and RemoveDatasetExamplesFromDatasetSplitsMutationPayload.
    • Introduce DatasetSplitMutationPayloadWithExamples and update createDatasetSplitWithExamples to return it.
  • Backend (Python):
    • Mutations add_dataset_examples_to_dataset_splits and remove_dataset_examples_from_dataset_splits now load and return updated examples.
    • create_dataset_split_with_examples returns new split plus associated examples.
    • Add to_gql_dataset_example helper.
  • Frontend (React/Relay):
    • NewDatasetSplitDialog:
      • Support creating a split with exampleIds; prepend new split to ManageDatasetSplitsDialog_datasetSplits connection; request returned examples.
    • ManageDatasetSplitsDialog:
      • Accept selectedExamples; compute sharedSplitIds/partialSplitIds internally.
      • Add β€œCreate Split” action opening NewDatasetSplitDialog with selected example IDs.
    • ExampleSelectionToolbar:
      • Pass selectedExamples to dialog; simplify shared/partial split logic; extract confirm handler.
      • Update mutations to request returned examples.
    • Update generated Relay artifacts accordingly.

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

@github-project-automation github-project-automation bot moved this to πŸ“˜ Todo in phoenix Sep 30, 2025
@ArcticFaded ArcticFaded marked this pull request as ready for review October 1, 2025 19:36
@ArcticFaded ArcticFaded requested review from a team as code owners October 1, 2025 19:36
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 1, 2025
Comment on lines 90 to 101
commitWithExamples({
variables: {
connections,
input: {
name: trimmed,
description: params.description || null,
color: params.color,
metadata: null,
exampleIds,
},
},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commitWithExamples mutation is missing onCompleted and onError handlers, unlike the commit function below. This means users won't receive success or error notifications when creating a split with examples. Consider adding these handlers to provide consistent feedback:

commitWithExamples({
  variables: {
    connections,
    input: {
      name: trimmed,
      description: params.description || null,
      color: params.color,
      metadata: null,
      exampleIds,
    },
  },
  onCompleted: () => {
    notifySuccess({
      title: "Split created",
      message: `Created split "${trimmed}"`,
    });
    onCompleted?.();
  },
  onError: (error) => {
    const formattedError = getErrorMessagesFromRelayMutationError(error);
    notifyError({
      title: "Failed to create split",
      message: formattedError?.[0] ?? error.message,
    });
  },
});
Suggested change
commitWithExamples({
variables: {
connections,
input: {
name: trimmed,
description: params.description || null,
color: params.color,
metadata: null,
exampleIds,
},
},
});
commitWithExamples({
variables: {
connections,
input: {
name: trimmed,
description: params.description || null,
color: params.color,
metadata: null,
exampleIds,
},
},
onCompleted: () => {
notifySuccess({
title: "Split created",
message: `Created split "${trimmed}"`,
});
onCompleted?.();
},
onError: (error) => {
const formattedError = getErrorMessagesFromRelayMutationError(error);
notifyError({
title: "Failed to create split",
message: formattedError?.[0] ?? error.message,
});
},
});

Spotted by Diamond

Fix in Graphite


Is this helpful? React πŸ‘ or πŸ‘Ž to let us know.

This comment came from an experimental reviewβ€”please leave feedback if it was helpful/unhelpful. Learn more about experimental comments here.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Comment on lines +203 to +205
onCompleted: () => {
// refreshLatestVersion();
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's nix this callback if it's no longer needed.

});
}}
/>
{isManageSplitsOpen && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional render still feels a little weird. Is it there to prevent jitter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just leave a comment.

};

export function ManageDatasetSplitsDialog(
function ManageDatasetSplitsDialogComponent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the previous name.

return true;
}

export const ManageDatasetSplitsDialog = memo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's nix the memo since we figured out how to reduce the number of renders in other ways.

@github-project-automation github-project-automation bot moved this from πŸ“˜ Todo to πŸ‘ Approved in phoenix Oct 1, 2025
cursor[bot]

This comment was marked as outdated.

@ArcticFaded ArcticFaded merged commit 1e72510 into main Oct 2, 2025
49 of 52 checks passed
@ArcticFaded ArcticFaded deleted the dataset-split-ui-cleanup branch October 2, 2025 14:04
@github-project-automation github-project-automation bot moved this from πŸ‘ Approved to βœ… Done in phoenix Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: βœ… Done

Development

Successfully merging this pull request may close these issues.

3 participants