mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-03 18:38:35 +02:00
feat: allow deletion of built-in orchestration patterns
Remove the restriction that prevented users from deleting built-in patterns (those with IDs prefixed 'pattern-'). Built-in patterns are intended as starting points, not permanent fixtures. Changes: - Add deletedBuiltinPatternIds field to WorkspaceState to track which built-in patterns the user has removed - Update mergePatterns to skip deleted built-ins during workspace load, preventing them from being re-added - Remove the isBuiltinPattern guard from AryxAppService.deletePattern; when a built-in is deleted, its ID is recorded in the tracking list - Enable the delete button in SettingsPanel and PatternEditor for all patterns (keep the 'Built-in pattern' label for context) - Add 3 tests covering built-in deletion, custom deletion, and selectedPatternId fallback Users can still restore deleted built-ins via workspace reset. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -311,7 +311,7 @@ export function PatternEditor({
|
||||
</div>
|
||||
</div>
|
||||
<div className="no-drag flex items-center gap-2">
|
||||
{!isBuiltin && onDelete && (
|
||||
{onDelete && (
|
||||
<button
|
||||
className="flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] text-[var(--color-status-error)] transition-all duration-200 hover:bg-[var(--color-status-error)]/10"
|
||||
onClick={onDelete}
|
||||
|
||||
@@ -165,12 +165,10 @@ export function SettingsPanel({
|
||||
onBack={() => setEditingPattern(null)}
|
||||
onChange={setEditingPattern}
|
||||
onDelete={
|
||||
isBuiltin
|
||||
? undefined
|
||||
: async () => {
|
||||
await onDeletePattern(editingPattern.id);
|
||||
setEditingPattern(null);
|
||||
}
|
||||
async () => {
|
||||
await onDeletePattern(editingPattern.id);
|
||||
setEditingPattern(null);
|
||||
}
|
||||
}
|
||||
onSave={async () => {
|
||||
await onSavePattern(editingPattern);
|
||||
|
||||
Reference in New Issue
Block a user