From f836e2f9df930eeaf505837e26dfd9533ad4a539 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Tr=C3=A1vn=C3=ADk?=
Date: Fri, 2 Jan 2026 15:33:25 +0100
Subject: [PATCH] fix(backups): allow removing selected paths that no longer
exist on filesystem (#272)
Add X button to selected paths list in backup schedule form. When files/folders
are selected for backup but later deleted from the volume, restic fails because
`--files-from` references non-existent paths. Previously, users couldn't remove
these stale paths since they don't appear in the file browser to uncheck.
The X button enables direct removal of any selected path, fixing stuck backup
configurations that would always fail with "file not found" errors.
---
.../components/create-schedule-form.tsx | 24 ++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/app/client/modules/backups/components/create-schedule-form.tsx b/app/client/modules/backups/components/create-schedule-form.tsx
index 1d94ff17..38437f7f 100644
--- a/app/client/modules/backups/components/create-schedule-form.tsx
+++ b/app/client/modules/backups/components/create-schedule-form.tsx
@@ -2,6 +2,7 @@ import { arktypeResolver } from "@hookform/resolvers/arktype";
import { useQuery } from "@tanstack/react-query";
import { type } from "arktype";
+import { X } from "lucide-react";
import { useCallback, useState } from "react";
import { useForm } from "react-hook-form";
import { listRepositoriesOptions } from "~/client/api-client/@tanstack/react-query.gen";
@@ -169,6 +170,16 @@ export const CreateScheduleForm = ({ initialValues, formId, onSubmit, volume }:
[form],
);
+ const handleRemovePath = useCallback(
+ (pathToRemove: string) => {
+ const newPaths = new Set(selectedPaths);
+ newPaths.delete(pathToRemove);
+ setSelectedPaths(newPaths);
+ form.setValue("includePatterns", Array.from(newPaths));
+ },
+ [selectedPaths, form],
+ );
+
return (