Note and task ui fixes
This commit is contained in:
@@ -64,7 +64,11 @@ export const NotesSidebar: Component<{
|
|||||||
n = n.filter(note => note.tags?.includes(getFavoriteTag()));
|
n = n.filter(note => note.tags?.includes(getFavoriteTag()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return n;
|
return n.sort((a, b) => {
|
||||||
|
const titleA = a.title || "Untitled";
|
||||||
|
const titleB = b.title || "Untitled";
|
||||||
|
return titleB.localeCompare(titleA);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleCreateNote = async () => {
|
const handleCreateNote = async () => {
|
||||||
|
|||||||
@@ -434,6 +434,24 @@ export const TaskDetail: Component<TaskDetailProps> = (props) => {
|
|||||||
<span class="hidden sm:inline">Video</span>
|
<span class="hidden sm:inline">Video</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* File Upload Shortcut */}
|
||||||
|
<div class="flex items-center gap-1 shrink-0">
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
class="h-8 px-1 sm:px-2 text-[0.625rem] font-bold uppercase tracking-wider hover:bg-muted/50 flex items-center gap-1 sm:gap-1.5 text-muted-foreground hover:text-foreground transition-colors"
|
||||||
|
onClick={() => {
|
||||||
|
const instance = editorInstance();
|
||||||
|
if (instance) {
|
||||||
|
instance.chain().focus().uploadFile().run();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FileText size={14} class="opacity-70" />
|
||||||
|
<span class="hidden sm:inline">File</span>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Metadata Row (Dates/Timestamps) */}
|
{/* Metadata Row (Dates/Timestamps) */}
|
||||||
@@ -694,35 +712,7 @@ export const TaskDetail: Component<TaskDetailProps> = (props) => {
|
|||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
{/* Close button (Mobile only) */}
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
class="h-8 w-8 p-0"
|
|
||||||
onClick={() => {
|
|
||||||
const instance = editorInstance();
|
|
||||||
if (instance) {
|
|
||||||
instance.chain().focus().uploadVideo().run();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
title="Video"
|
|
||||||
>
|
|
||||||
<Film class="w-4 h-4" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
class="h-8 w-8 p-0"
|
|
||||||
onClick={() => {
|
|
||||||
const instance = editorInstance();
|
|
||||||
if (instance) {
|
|
||||||
instance.chain().focus().uploadFile().run();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
title="File"
|
|
||||||
>
|
|
||||||
<FileText class="w-4 h-4" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
+39
-19
@@ -513,25 +513,45 @@ export const NotepadView: Component<{
|
|||||||
<Star size={14} class={cn(note().tags?.includes(getFavoriteTag()) && "fill-amber-500")} />
|
<Star size={14} class={cn(note().tags?.includes(getFavoriteTag()) && "fill-amber-500")} />
|
||||||
</Button>
|
</Button>
|
||||||
<Show when={isOwner}>
|
<Show when={isOwner}>
|
||||||
<Button
|
<Popover>
|
||||||
variant="ghost"
|
<PopoverTrigger
|
||||||
size="sm"
|
as={Button}
|
||||||
class="hidden md:flex h-8 w-8 p-0 hover:bg-destructive/10 hover:text-destructive text-muted-foreground transition-all rounded-xl border border-border/40 shadow-sm"
|
variant="ghost"
|
||||||
onClick={() => handleDeleteNote(note().id)}
|
size="sm"
|
||||||
title="Move to Trash"
|
class="hidden md:flex h-8 w-8 p-0 hover:bg-muted text-muted-foreground transition-all rounded-xl border border-border/40 shadow-sm shrink-0"
|
||||||
>
|
>
|
||||||
<Trash2 size={14} />
|
<MoreHorizontal size={14} />
|
||||||
</Button>
|
</PopoverTrigger>
|
||||||
<Button
|
<PopoverContent class="w-48 p-2" align="end">
|
||||||
variant="ghost"
|
<div class="flex flex-col gap-1">
|
||||||
size="sm"
|
<Button
|
||||||
class={cn("hidden md:flex h-8 text-[0.625rem] font-bold uppercase tracking-widest", note().isPrivate ? "text-orange-500 hover:bg-orange-500/10" : "text-muted-foreground")}
|
variant="ghost"
|
||||||
onClick={() => handleUpdateNote(note().id, { isPrivate: !note().isPrivate })}
|
size="sm"
|
||||||
>
|
class={cn("w-full justify-start text-[0.625rem] font-bold uppercase tracking-widest gap-2", note().isPrivate ? "text-orange-500 hover:bg-orange-500/10" : "text-muted-foreground hover:bg-muted")}
|
||||||
<Show when={note().isPrivate} fallback={<><Unlock size={12} class="mr-1.5" /> Public</>}>
|
onClick={(e) => {
|
||||||
<><Lock size={12} class="mr-1.5" /> Private</>
|
e.stopPropagation();
|
||||||
</Show>
|
handleUpdateNote(note().id, { isPrivate: !note().isPrivate });
|
||||||
</Button>
|
}}
|
||||||
|
>
|
||||||
|
<Show when={note().isPrivate} fallback={<><Unlock size={14} /> Public</>}>
|
||||||
|
<><Lock size={14} /> Private</>
|
||||||
|
</Show>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
class="w-full justify-start text-[0.625rem] font-bold uppercase tracking-widest gap-2 hover:bg-destructive/10 hover:text-destructive text-muted-foreground transition-all"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
handleDeleteNote(note().id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Trash2 size={14} />
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</PopoverContent>
|
||||||
|
</Popover>
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user