From e831de4f8517cdbf8fa52462bb04afcef0570b3c Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 26 Mar 2026 12:28:18 +0100 Subject: [PATCH] refactor(home): extract SearchFilterBar, DropZone, and DocumentList Split the 580-line home page into three focused co-located components: - SearchFilterBar: full-text search + collapsible advanced filters - DropZone: drag-and-drop / click-to-upload with progress and messages - DocumentList: document list with new-doc link and empty state Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/+page.svelte | 535 +-------------------- frontend/src/routes/DocumentList.svelte | 177 +++++++ frontend/src/routes/DropZone.svelte | 213 ++++++++ frontend/src/routes/SearchFilterBar.svelte | 164 +++++++ 4 files changed, 577 insertions(+), 512 deletions(-) create mode 100644 frontend/src/routes/DocumentList.svelte create mode 100644 frontend/src/routes/DropZone.svelte create mode 100644 frontend/src/routes/SearchFilterBar.svelte diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 71a5c93b..e5130ff1 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,13 +1,10 @@ -
- -
- -
- -
- (qFocused = true)} - onblur={() => (qFocused = false)} - placeholder={m.docs_search_placeholder()} - class="block w-full border-line py-2.5 pr-10 pl-3 placeholder-ink-3 shadow-sm focus:border-ink focus:ring-ink" - /> -
- -
-
- - - - - - - - -
- - - {#if showAdvanced} -
- -
-

- {m.docs_filter_label_tags()} -

- -
- - -
-
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - -
-
-
- {/if} -
+ (qFocused = true)} + onblur={() => (qFocused = false)} + /> {#if data.canWrite} - -
fileInput.click()} - onkeydown={(e) => e.key === 'Enter' && fileInput.click()} - > - - {#if isUploading} -
-
-
-
- {uploadProgress}% -
- {:else} - {m.upload_drop_hint()} - {m.upload_accepted_types()} - {/if} -
- - {#if uploadMessages.length > 0} -
- {#each uploadMessages as msg, i (i)} - - {/each} -
- {/if} + {/if} - -
- {#if data.canWrite} - - - {m.docs_btn_new()} - - {/if} -
- - - - +
diff --git a/frontend/src/routes/DocumentList.svelte b/frontend/src/routes/DocumentList.svelte new file mode 100644 index 00000000..9ac8537a --- /dev/null +++ b/frontend/src/routes/DocumentList.svelte @@ -0,0 +1,177 @@ + + + +
+ {#if canWrite} + + + {m.docs_btn_new()} + + {/if} +
+ + + diff --git a/frontend/src/routes/DropZone.svelte b/frontend/src/routes/DropZone.svelte new file mode 100644 index 00000000..d845d027 --- /dev/null +++ b/frontend/src/routes/DropZone.svelte @@ -0,0 +1,213 @@ + + +
fileInput.click()} + onkeydown={(e) => e.key === 'Enter' && fileInput.click()} +> + + {#if isUploading} +
+
+
+
+ {uploadProgress}% +
+ {:else} + {m.upload_drop_hint()} + {m.upload_accepted_types()} + {/if} +
+ +{#if uploadMessages.length > 0} +
+ {#each uploadMessages as msg, i (i)} + + {/each} +
+{/if} + + diff --git a/frontend/src/routes/SearchFilterBar.svelte b/frontend/src/routes/SearchFilterBar.svelte new file mode 100644 index 00000000..7b471b89 --- /dev/null +++ b/frontend/src/routes/SearchFilterBar.svelte @@ -0,0 +1,164 @@ + + +
+ +
+ +
+ +
+ +
+
+ + + + + + + + +
+ + + {#if showAdvanced} +
+ +
+

+ {m.docs_filter_label_tags()} +

+ +
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+ {/if} +