From 1052d342add21025c8e1330f82cd952aded86226 Mon Sep 17 00:00:00 2001 From: Amr Mohammed El-Sheraey <141947355+AmrMsCLL@users.noreply.github.com> Date: Mon, 5 Oct 2026 18:59:06 +0300 Subject: [PATCH] feat: let Tidy rules match files by type --- app/frontend/src/components/TidyPreview.tsx | 2 +- app/frontend/src/files.tsx | 10 +++++ app/frontend/src/pages/TidyPage.tsx | 4 +- app/frontend/src/pages/spaces/TidyRules.tsx | 40 +++++++++++++++---- app/frontend/test/tidy.spec.tsx | 33 +++++++++++++++ .../migration.sql | 3 ++ app/server/prisma/schema.prisma | 3 +- app/server/src/files/file-inspection.ts | 6 +-- app/server/src/tidy/dto/tidy.dto.ts | 10 ++++- app/server/src/tidy/file-types.ts | 14 +++++++ app/server/src/tidy/tidy-rules.service.ts | 16 +++++--- app/server/src/tidy/tidy.service.ts | 2 +- app/server/test/integration/tidy.spec.ts | 23 +++++++++++ 13 files changed, 143 insertions(+), 23 deletions(-) create mode 100644 app/server/prisma/migrations/20261005100000_tidy_file_types/migration.sql create mode 100644 app/server/src/tidy/file-types.ts diff --git a/app/frontend/src/components/TidyPreview.tsx b/app/frontend/src/components/TidyPreview.tsx index a20599f..63cc9d9 100644 --- a/app/frontend/src/components/TidyPreview.tsx +++ b/app/frontend/src/components/TidyPreview.tsx @@ -16,7 +16,7 @@ export interface TidyBatch { id: string; action: TidyAction; tag: Tag | null; - rule: { id: string; titleContains: string } | null; + rule: { id: string; titleContains: string; fileType: string | null } | null; itemCount: number; remaining: number; createdAt: string; diff --git a/app/frontend/src/files.tsx b/app/frontend/src/files.tsx index 77ca8a2..a8605c9 100644 --- a/app/frontend/src/files.tsx +++ b/app/frontend/src/files.tsx @@ -82,3 +82,13 @@ export function FilePreview({ item }: { item: Item }) {