refactor: streamline feature creation and auto-start logic in BoardView

- Removed the delay mechanism for starting newly created features, simplifying the process.
- Updated the logic to capture existing feature IDs before adding a new feature, allowing for immediate identification of the newly created feature.
- Enhanced error handling to notify users if the feature could not be started automatically.
This commit is contained in:
Test User
2025-12-27 14:20:52 -05:00
parent 7b7de2b601
commit 01911287f2
2 changed files with 46 additions and 54 deletions

View File

@@ -288,24 +288,20 @@ export function AddFeatureDialog({
onOpenChange(false);
};
const handleAdd = () => {
const featureData = buildFeatureData();
if (!featureData) return;
onAdd(featureData);
resetForm();
};
const handleAddAndStart = () => {
if (!onAddAndStart) return;
const handleAction = (actionFn?: (data: FeatureData) => void) => {
if (!actionFn) return;
const featureData = buildFeatureData();
if (!featureData) return;
onAddAndStart(featureData);
actionFn(featureData);
resetForm();
};
const handleAdd = () => handleAction(onAdd);
const handleAddAndStart = () => handleAction(onAddAndStart);
const handleDialogClose = (open: boolean) => {
onOpenChange(open);
if (!open) {