fix(webui): address various UI issues in signup, settings, and sidebar

This commit is contained in:
yiling
2026-06-10 09:35:15 +08:00
parent eedcebf784
commit 2124238751
4 changed files with 97 additions and 95 deletions
+1 -1
View File
@@ -531,7 +531,7 @@ export function FolderTree({
{!hideShares && (
<div
className={cn(
'flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4',
'flex flex-col overflow-hidden transition-all duration-300 ease-in-out',
isSharesExpanded ? 'flex-1 min-h-0 h-full' : 'flex-none h-[44px] max-h-[44px]',
)}
>
+11 -15
View File
@@ -5,7 +5,6 @@ import { TopNav } from '@/ui/components/top-nav'
import { HomeIcon, NotificationFillIcon, UploadCloudIcon } from '@/ui/components/ui/icons'
import { Toaster } from '@/ui/components/ui/sonner'
import { UploadTasks } from '@/ui/components/upload-tasks'
import { usePermissions } from '@/ui/hooks/use-permissions'
import { useAuthStore } from '@/ui/stores/auth'
import { useTeamContextStore } from '@/ui/stores/team-context'
import { useUploadStore } from '@/ui/stores/upload'
@@ -21,7 +20,6 @@ import { useEffect } from 'react'
function RootComponent() {
const user = useAuthStore((state) => state.user)
const { uploading } = useUploadStore()
const { canEdit } = usePermissions()
const pathname = useRouterState({ select: (s) => s.location.pathname })
const navigate = useNavigate()
@@ -90,19 +88,17 @@ function RootComponent() {
<DualSidebarItem icon={<NotificationFillIcon />} label="Notifications" badge={badge}>
<NotificationList />
</DualSidebarItem>
{canEdit && (
<DualSidebarItem
icon={
<UploadCloudIcon
uploading={uploading > 0}
className={uploading > 0 ? 'text-blue-500' : ''}
/>
}
label="Uploads"
>
<UploadTasks />
</DualSidebarItem>
)}
<DualSidebarItem
icon={
<UploadCloudIcon
uploading={uploading > 0}
className={uploading > 0 ? 'text-blue-500' : ''}
/>
}
label="Uploads"
>
<UploadTasks />
</DualSidebarItem>
</DualSidebar>
<div className="flex flex-col flex-1 md:pl-16 overflow-hidden relative">
<TopNav />
+1 -1
View File
@@ -157,7 +157,7 @@ function SignupPage() {
<span>👋</span>
<span>
<strong>{inviteInfo.inviterName}</strong> invited you to join{' '}
<strong>{inviteInfo.teamName || inviteInfo.projectName}</strong> as a{' '}
<strong>{inviteInfo.projectName || inviteInfo.teamName}</strong> as a{' '}
<strong>{inviteInfo.role}</strong>.
</span>
</div>
@@ -233,21 +233,23 @@ function TeamSettingsPage() {
)}
</button>
<button
onClick={() => setActiveTab('transcode')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'transcode'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Film className="w-5 h-5" />
Media Processing
{activeTab === 'transcode' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
{me?.role === 'admin' && (
<button
onClick={() => setActiveTab('transcode')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'transcode'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Film className="w-5 h-5" />
Media Processing
{activeTab === 'transcode' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
)}
<button
onClick={() => setActiveTab('notifications')}
@@ -265,73 +267,77 @@ function TeamSettingsPage() {
)}
</button>
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
AI
</div>
{me?.role === 'admin' && (
<>
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
AI
</div>
<button
onClick={() => setActiveTab('providers')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'providers'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Cpu className="w-5 h-5" />
Providers
{activeTab === 'providers' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('providers')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'providers'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Cpu className="w-5 h-5" />
Providers
{activeTab === 'providers' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('skills')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'skills'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Puzzle className="w-5 h-5" />
Skills
{activeTab === 'skills' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('skills')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'skills'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Puzzle className="w-5 h-5" />
Skills
{activeTab === 'skills' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('agents')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'agents'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Bot className="w-5 h-5" />
Agents
{activeTab === 'agents' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('agents')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'agents'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Bot className="w-5 h-5" />
Agents
{activeTab === 'agents' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('sandbox')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'sandbox'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Shield className="w-5 h-5" />
Agent Sandbox
{activeTab === 'sandbox' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
<button
onClick={() => setActiveTab('sandbox')}
className={cn(
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
activeTab === 'sandbox'
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
)}
>
<Shield className="w-5 h-5" />
Agent Sandbox
{activeTab === 'sandbox' && (
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
)}
</button>
</>
)}
</nav>
</div>