feat(documents): folder tree + actions UI for system-managed folders
FolderTreeSidebar shows a lock marker on system_managed rows and renders archived entity folders muted. FolderActionsMenu disables Rename / Move / Delete with a tooltip explanation when a system folder is selected; the server-side guard (Task 4) is the authoritative rejection — the UI is the friendly first line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { ChevronRight, Folder, FolderOpen, Inbox } from 'lucide-react';
|
||||
import { ChevronRight, Folder, FolderOpen, Inbox, Lock } from 'lucide-react';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
@@ -135,7 +135,10 @@ function FolderRow({
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onSelect(node.id)}
|
||||
className="flex flex-1 items-center gap-1.5 truncate text-left"
|
||||
className={cn(
|
||||
'flex flex-1 items-center gap-1.5 truncate text-left',
|
||||
node.archivedAt != null && 'text-muted-foreground',
|
||||
)}
|
||||
>
|
||||
{open && hasChildren ? (
|
||||
<FolderOpen className="h-4 w-4 shrink-0" />
|
||||
@@ -143,6 +146,9 @@ function FolderRow({
|
||||
<Folder className="h-4 w-4 shrink-0" />
|
||||
)}
|
||||
<span className="truncate">{node.name}</span>
|
||||
{node.systemManaged ? (
|
||||
<Lock className="ml-1 h-3 w-3 shrink-0 text-muted-foreground" aria-label="System folder" />
|
||||
) : null}
|
||||
</button>
|
||||
</div>
|
||||
{open
|
||||
|
||||
Reference in New Issue
Block a user