fix: simplify note-input toolbar by using compact mode for label, type selector, and ai button
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 45s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 45s
This commit is contained in:
@@ -56,11 +56,11 @@ export function LabelSelector({
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="h-8 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 px-2">
|
||||
<Tag className={cn("h-4 w-4", triggerLabel && "mr-2")} />
|
||||
{triggerLabel || t('labels.title')}
|
||||
<Button variant="ghost" size={variant === 'compact' ? 'icon' : 'sm'} className={cn("h-8 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100", variant === 'compact' ? "w-8 relative" : "px-2")} title={t('labels.title')}>
|
||||
<Tag className={cn("h-4 w-4", variant !== 'compact' && (triggerLabel || t('labels.title')) ? "mr-2" : "")} />
|
||||
{variant !== 'compact' && (triggerLabel || t('labels.title'))}
|
||||
{selectedLabels.length > 0 && (
|
||||
<Badge variant="secondary" className="ml-2 h-5 min-w-5 px-1.5 bg-gray-200 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300">
|
||||
<Badge variant="secondary" className={cn("h-5 min-w-5 px-1.5 bg-gray-200 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300", variant === 'compact' ? "absolute -top-2 -right-2 scale-75" : "ml-2")}>
|
||||
{selectedLabels.length}
|
||||
</Badge>
|
||||
)}
|
||||
|
||||
@@ -934,7 +934,7 @@ export function NoteInput({
|
||||
</Button>
|
||||
</TooltipTrigger><TooltipContent>{t('notes.remindMe')}</TooltipContent></Tooltip>
|
||||
|
||||
<NoteTypeSelector value={type} onChange={(newType) => { setType(newType); if (newType !== 'markdown') setShowMarkdownPreview(false) }} />
|
||||
<NoteTypeSelector value={type} onChange={(newType) => { setType(newType); if (newType !== 'markdown') setShowMarkdownPreview(false) }} compact />
|
||||
|
||||
{type === 'markdown' && (
|
||||
<Tooltip><TooltipTrigger asChild>
|
||||
@@ -947,11 +947,10 @@ export function NoteInput({
|
||||
|
||||
{aiAssistantEnabled && (
|
||||
<Tooltip><TooltipTrigger asChild>
|
||||
<Button variant="ghost" size="sm"
|
||||
className={cn('h-8 gap-1.5 px-2 text-xs font-medium transition-colors shrink-0', aiOpen && 'bg-primary/10 text-primary')}
|
||||
<Button variant="ghost" size="icon"
|
||||
className={cn('h-8 w-8 transition-colors shrink-0', aiOpen && 'bg-primary/10 text-primary')}
|
||||
onClick={() => setAiOpen(!aiOpen)}>
|
||||
<Sparkles className="h-3.5 w-3.5" />
|
||||
<span className="hidden sm:inline">IA Note</span>
|
||||
<Sparkles className="h-4 w-4" />
|
||||
</Button>
|
||||
</TooltipTrigger><TooltipContent>Ouvrir IA Note</TooltipContent></Tooltip>
|
||||
)}
|
||||
@@ -974,7 +973,7 @@ export function NoteInput({
|
||||
</Button>
|
||||
</TooltipTrigger><TooltipContent>{t('notes.addLink')}</TooltipContent></Tooltip>
|
||||
|
||||
<LabelSelector selectedLabels={selectedLabels} onLabelsChange={setSelectedLabels} triggerLabel="" align="start" />
|
||||
<LabelSelector selectedLabels={selectedLabels} onLabelsChange={setSelectedLabels} variant="compact" align="start" />
|
||||
|
||||
<DropdownMenu>
|
||||
<Tooltip><TooltipTrigger asChild>
|
||||
|
||||
Reference in New Issue
Block a user