Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 8ac2311

Browse files
committed
feat: redesign files management routes with new components and hooks
- Introduced new components for file management: FileThumbnail, FileListRow, FileDetailPane, UploadDropOverlay, and UploadProgressDock. - Implemented hooks for file uploading (useFileUploader) and file searching (useFileSearch). - Refactored existing routes to use the new components, improving code organization and maintainability. - Added utility functions for formatting bytes and validating color previews. - Updated constants and adapters for file types and statuses. - Enhanced UI with improved search functionality and upload overlays. - Updated translations for new UI elements and messages. - Documented the redesign goals, structure, and migration plan in a new design spec. Signed-off-by: Innei <tukon479@gmail.com>
1 parent 24b7dea commit 8ac2311

38 files changed

Lines changed: 3182 additions & 1403 deletions

apps/admin/src/features/ai/components/AiTasksSurface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function AiTasksSurface() {
220220
<MasterDetailLayout
221221
showDetailOnMobile={showDetailOnMobile}
222222
list={
223-
<section className="flex h-full min-h-0 flex-col border-b border-neutral-200 lg:border-b-0 lg:border-r dark:border-neutral-800">
223+
<section className="flex h-full min-h-0 flex-col">
224224
<div
225225
className={cn(
226226
'flex shrink-0 items-center justify-between gap-3 border-b border-neutral-200 px-4 dark:border-neutral-800',

apps/admin/src/features/categories/components/CategoriesRouteViewContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function CategoriesRouteViewContent() {
103103
<MasterDetailLayout
104104
showDetailOnMobile={showDetailOnMobile}
105105
list={
106-
<section className="flex h-full min-h-0 flex-col border-b border-neutral-200 lg:border-b-0 lg:border-r dark:border-neutral-800">
106+
<section className="flex h-full min-h-0 flex-col">
107107
<div
108108
className={cn(
109109
'flex shrink-0 items-center justify-between border-b border-neutral-200 px-4 dark:border-neutral-800',

apps/admin/src/features/cron/components/CronRouteViewContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function CronRouteViewContent() {
186186
</section>
187187
}
188188
list={
189-
<section className="flex min-h-0 flex-col border-b border-neutral-200 lg:border-b-0 lg:border-r dark:border-neutral-800">
189+
<section className="flex min-h-0 flex-col">
190190
<div
191191
className={cn(
192192
'flex shrink-0 items-center justify-between gap-3 border-b border-neutral-200 px-4 dark:border-neutral-800',

apps/admin/src/features/drafts/components/DraftsRouteViewContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function DraftsRouteViewContent() {
203203
<MasterDetailLayout
204204
list={
205205
<FocusScope
206-
className="outline-hidden flex h-full min-h-0 flex-col border-r border-neutral-200 dark:border-neutral-800"
206+
className="outline-hidden flex h-full min-h-0 flex-col"
207207
id={FOCUS_SCOPE_ID}
208208
>
209209
<div

apps/admin/src/features/enrichment/components/EnrichmentRouteViewContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function EnrichmentRouteViewContent() {
198198
<MasterDetailLayout
199199
showDetailOnMobile={showDetailOnMobile}
200200
list={
201-
<section className="flex h-full min-h-0 flex-col border-b border-neutral-200 lg:border-b-0 lg:border-r dark:border-neutral-800">
201+
<section className="flex h-full min-h-0 flex-col">
202202
<div className="border-b border-neutral-200 px-4 py-3 dark:border-neutral-800">
203203
<SourceSwitcher onChange={setSourceAndReset} value={source} />
204204
{source === 'cache' ? (
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import type { LucideIcon } from 'lucide-react'
2+
import type { ReactNode } from 'react'
3+
4+
import { cn } from '~/utils/cn'
5+
6+
export interface ChipOption<V extends string> {
7+
value: V
8+
label: ReactNode
9+
icon?: LucideIcon
10+
}
11+
12+
interface ChipStripProps<V extends string> {
13+
options: ChipOption<V>[]
14+
value: V
15+
onChange: (value: V) => void
16+
ariaLabel?: string
17+
}
18+
19+
export function ChipStrip<V extends string>(props: ChipStripProps<V>) {
20+
return (
21+
<div
22+
aria-label={props.ariaLabel}
23+
className="flex flex-wrap gap-2 border-b border-neutral-200 px-4 py-3 dark:border-neutral-800"
24+
role="tablist"
25+
>
26+
{props.options.map((option) => {
27+
const active = props.value === option.value
28+
const Icon = option.icon
29+
return (
30+
<button
31+
aria-selected={active}
32+
className={cn(
33+
'inline-flex items-center gap-1.5 rounded border px-2.5 py-1 text-xs transition-colors',
34+
active
35+
? 'border-neutral-950 bg-neutral-950 text-white dark:border-neutral-50 dark:bg-neutral-50 dark:text-neutral-950'
36+
: 'border-neutral-200 text-neutral-600 hover:bg-neutral-50 dark:border-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-900',
37+
)}
38+
key={option.value}
39+
onClick={() => props.onChange(option.value)}
40+
role="tab"
41+
type="button"
42+
>
43+
{Icon ? <Icon aria-hidden="true" className="size-3" /> : null}
44+
{option.label}
45+
</button>
46+
)
47+
})}
48+
</div>
49+
)
50+
}

0 commit comments

Comments
 (0)