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

Skip to content

Conversation

GeLi2001
Copy link
Contributor

@GeLi2001 GeLi2001 commented Oct 22, 2025

  • Remove save on create dataset label form on both individual dataset page and datasets (plural) page
  • Make label button clickable + remove chevron
  • Auto-apply of label that gets newly created on both individual dataset page and datasets (plural) page
  • Remove helper text under name and description for create new dataset label + create new prompt label forms

Note

Streamlines dataset label UX by auto-applying selections and newly created labels, removing the save flow, and simplifying menu interactions and form UI.

  • Dataset Labels UX:
    • Auto-apply label selection changes in DatasetLabelConfigButton; removed explicit Save flow and onClose prop; popover stays open when creating labels; selection syncs with dataset via useEffect/useMemo.
    • NewDatasetLabelDialog accepts optional datasetId and auto-applies the newly created label via NewDatasetLabelDialogSetLabelsMutation (generated file added); connections still updated.
    • DatasetActionMenu opens label configuration directly from the menu (no submenu/chevron); adds DialogTrigger with invisible anchor to position popover.
    • NewLabelForm UI cleanup: removes helper descriptions, tweaks placeholders and layout.
  • Copy/Links: Footer in label list now shows Edit Labels link only (removed Manage/Save).

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

@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Oct 22, 2025
@GeLi2001 GeLi2001 marked this pull request as ready for review October 22, 2025 19:53
@GeLi2001 GeLi2001 requested a review from a team as a code owner October 22, 2025 19:53
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 22, 2025
cursor[bot]

This comment was marked as outdated.

message: "Failed to save label changes. Please try again.",
});
});
}
Copy link

Choose a reason for hiding this comment

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

Bug: Label Sync Issue During Rapid User Actions

The auto-apply label logic has a race condition where rapid user selections can be lost. The useEffect hook, intended to sync local state, can overwrite recent user changes with stale server data when mutations are in flight. This results in labels appearing deselected unexpectedly and can cause incorrect or duplicate mutations.

Additional Locations (1)

Fix in Cursor Fix in Web

connections={connections}
datasetId={datasetId}
onCompleted={() => {
// Only close the create modal, keep the labels popover open
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Only close the create modal, keep the labels popover open

Let's nix the comment.

*/
connections?: string[];
/**
* Optional dataset ID to auto-apply the label to after creation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Optional dataset ID to auto-apply the label to after creation
* Optional dataset ID. If provided, newly created labels will be auto-applied to the dataset upon creation.

Comment on lines +219 to +231
const selectedLabelIds = useMemo(
() => datasetData?.labels?.map((label) => label.id) || [],
[datasetData?.labels]
);
const [search, setSearch] = useState("");
const [selected, setSelected] = useState<Selection>(
() => new Set(selectedLabelIds)
);
const [hasChanges, setHasChanges] = useState(false);

// Sync local selection state when dataset labels change (e.g., from auto-apply)
useEffect(() => {
setSelected(new Set(selectedLabelIds));
}, [selectedLabelIds]);
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to rely on Relay for the re-rendering of the labels rather than a useEffect hook.

setSelected(selection);

// Check if there are changes from the original selection
// Auto-apply changes immediately
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Auto-apply changes immediately

message: "Failed to save label changes. Please try again.",
});
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What made this change necessary?

onCompleted,
onCompleted: (response) => {
// Auto-apply the new label to the dataset if datasetId is provided
if (datasetId && response.createDatasetLabel?.datasetLabel?.id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (datasetId && response.createDatasetLabel?.datasetLabel?.id) {
if (datasetId && response.createDatasetLabel.datasetLabel.id) {

Comment on lines +132 to +134
// Still call onCompleted even if auto-apply fails
// The label was created successfully
onCompleted();
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to notify on error here.

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: 📘 Todo

Development

Successfully merging this pull request may close these issues.

2 participants