Spaces:
Running

axeronis commited on
Commit
305a6e6
·
1 Parent(s): e727115

feat(mobile-ui): precision mobile UX overhaul - fix safe areas, header stacking, premium AI toggle, and layout sync

Browse files
frontend/app/layout.tsx CHANGED
@@ -97,11 +97,17 @@ export default function RootLayout({
97
  </div>
98
 
99
  {/* Main Content - with padding for fixed header (64px) and bottom nav on Mobile */}
100
- <main className={cn(
101
- "flex-1 w-full pt-16 pb-14 md:pt-0 md:pb-0 overflow-x-hidden",
102
- // Disable global scroll on chats page to fix layout issues
103
- pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
104
- )}>
 
 
 
 
 
 
105
  {children}
106
  </main>
107
 
 
97
  </div>
98
 
99
  {/* Main Content - with padding for fixed header (64px) and bottom nav on Mobile */}
100
+ <main
101
+ className={cn(
102
+ "flex-1 w-full md:pt-0 md:pb-0 overflow-x-hidden",
103
+ // Disable global scroll on chats page to fix layout issues
104
+ pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
105
+ )}
106
+ style={{
107
+ paddingTop: 'calc(64px + env(safe-area-inset-top, 0px))',
108
+ paddingBottom: 'calc(56px + env(safe-area-inset-bottom, 0px))'
109
+ }}
110
+ >
111
  {children}
112
  </main>
113
 
frontend/components/ChatWindow/ChatHeader.tsx CHANGED
@@ -108,46 +108,62 @@ export function ChatHeader({
108
  <div className="flex items-center gap-2">
109
  <Bot className={cn(
110
  "w-4 h-4 transition-all duration-500 hidden sm:block",
111
- isAIActive ? "text-indigo-400 scale-110" : "text-slate-500 scale-100"
112
  )} />
113
  <button
114
  onClick={onToggleAI}
115
  disabled={isTogglingAI}
116
  className={cn(
117
- "relative w-11 h-6 rounded-full transition-all duration-500 flex-shrink-0 group overflow-hidden",
118
  isAIActive
119
- ? "bg-indigo-600/20 border border-indigo-500/30"
120
- : "bg-white/5 border border-white/10",
121
  isTogglingAI && "opacity-80"
122
  )}
123
  title={isAIActive ? 'AI Активен' : 'AI Отключен'}
124
  >
 
 
 
 
 
 
125
  {/* Glow effect when active */}
126
  {isAIActive && (
127
- <div className="absolute inset-0 bg-indigo-500/20 blur-md animate-pulse" />
 
 
 
128
  )}
129
 
130
  <motion.div
131
  animate={{
132
  x: isAIActive ? 22 : 4,
133
- scale: isTogglingAI ? 0.8 : 1,
134
- boxShadow: isAIActive ? "0 0 15px rgba(99,102,241,0.6)" : "0 2px 4px rgba(0,0,0,0.2)"
 
 
135
  }}
136
- transition={{ type: "spring", stiffness: 400, damping: 25 }}
137
  className={cn(
138
- "absolute top-1 w-4 h-4 rounded-full flex items-center justify-center overflow-hidden transition-colors duration-300 z-10",
139
- isAIActive ? "bg-white" : "bg-slate-400"
 
 
140
  )}
141
  >
 
 
 
142
  {isTogglingAI && (
143
  <Loader2 className="w-2.5 h-2.5 animate-spin text-indigo-500" />
144
  )}
145
  </motion.div>
146
 
147
- {/* Hidden text/indicator for accessibility/polish */}
148
- <div className="absolute inset-0 flex items-center justify-between px-2 pointer-events-none opacity-0 group-hover:opacity-40 transition-opacity">
149
- <div className="w-1 h-1 rounded-full bg-white" />
150
- <div className="w-1 h-1 rounded-full bg-white" />
151
  </div>
152
  </button>
153
  </div>
 
108
  <div className="flex items-center gap-2">
109
  <Bot className={cn(
110
  "w-4 h-4 transition-all duration-500 hidden sm:block",
111
+ isAIActive ? "text-indigo-400 scale-110 drop-shadow-[0_0_8px_rgba(99,102,241,0.5)]" : "text-slate-500 scale-100"
112
  )} />
113
  <button
114
  onClick={onToggleAI}
115
  disabled={isTogglingAI}
116
  className={cn(
117
+ "relative w-11 h-6 rounded-full transition-all duration-500 flex-shrink-0 group overflow-hidden border",
118
  isAIActive
119
+ ? "bg-indigo-600/20 border-indigo-500/40 shadow-[inset_0_0_10px_rgba(99,102,241,0.2)]"
120
+ : "bg-white/5 border-white/10 shadow-[inner_0_2px_4px_rgba(0,0,0,0.3)]",
121
  isTogglingAI && "opacity-80"
122
  )}
123
  title={isAIActive ? 'AI Активен' : 'AI Отключен'}
124
  >
125
+ {/* Track Inner Glow/Gradient */}
126
+ <div className={cn(
127
+ "absolute inset-0 transition-opacity duration-500",
128
+ isAIActive ? "opacity-100 bg-gradient-to-r from-indigo-500/10 via-purple-500/10 to-transparent" : "opacity-0"
129
+ )} />
130
+
131
  {/* Glow effect when active */}
132
  {isAIActive && (
133
+ <motion.div
134
+ layoutId="ai-glow"
135
+ className="absolute inset-0 bg-indigo-500/20 blur-md animate-pulse"
136
+ />
137
  )}
138
 
139
  <motion.div
140
  animate={{
141
  x: isAIActive ? 22 : 4,
142
+ scale: isTogglingAI ? 0.85 : 1,
143
+ boxShadow: isAIActive
144
+ ? "0 0 15px rgba(99,102,241,0.6), inset 0 -1px 2px rgba(0,0,0,0.2)"
145
+ : "0 2px 4px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.2)"
146
  }}
147
+ transition={{ type: "spring", stiffness: 450, damping: 25 }}
148
  className={cn(
149
+ "absolute top-1 w-3.5 h-3.5 rounded-full flex items-center justify-center transition-all duration-300 z-10",
150
+ isAIActive
151
+ ? "bg-white"
152
+ : "bg-slate-300"
153
  )}
154
  >
155
+ {/* Glossy highlight on the thumb */}
156
+ <div className="absolute inset-0 bg-gradient-to-tr from-transparent via-white/40 to-white/60 pointer-events-none rounded-full" />
157
+
158
  {isTogglingAI && (
159
  <Loader2 className="w-2.5 h-2.5 animate-spin text-indigo-500" />
160
  )}
161
  </motion.div>
162
 
163
+ {/* State indicators for extra polish */}
164
+ <div className="absolute inset-0 flex items-center justify-between px-2.5 pointer-events-none">
165
+ <div className={cn("w-0.5 h-0.5 rounded-full transition-all duration-500", isAIActive ? "bg-indigo-300 scale-150" : "bg-white/20 scale-100")} />
166
+ <div className={cn("w-0.5 h-0.5 rounded-full transition-all duration-500", isAIActive ? "bg-white/20 scale-100" : "bg-slate-400 scale-150")} />
167
  </div>
168
  </button>
169
  </div>
frontend/components/ChatWindow/MessageInput.tsx CHANGED
@@ -133,7 +133,7 @@ export function MessageInput({
133
  }
134
 
135
  return (
136
- <div className="px-2 sm:px-3 pb-2 pt-2 bg-[#0D0E18]/80 backdrop-blur-xl flex-shrink-0 sticky bottom-0 left-0 right-0 z-30 border-t border-white/10 md:pb-safe">
137
  <div className="max-w-4xl mx-auto relative">
138
  {/* File Preview */}
139
  {selectedFile && (
 
133
  }
134
 
135
  return (
136
+ <div className="px-2 sm:px-3 pb-2 pt-2 bg-[#0D0E18]/80 backdrop-blur-2xl flex-shrink-0 sticky bottom-0 left-0 right-0 z-30 border-t border-white/10">
137
  <div className="max-w-4xl mx-auto relative">
138
  {/* File Preview */}
139
  {selectedFile && (
frontend/components/MobileBottomNav.tsx CHANGED
@@ -53,7 +53,7 @@ export function MobileBottomNav() {
53
  animate={{ y: 0 }}
54
  exit={{ y: '100%' }}
55
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
56
- className="fixed bottom-0 left-0 right-0 z-40 bg-[#0D0E18]/80 backdrop-blur-xl backdrop-saturate-[1.8] border-t border-white/10 pb-safe shadow-[0_-10px_40px_rgba(0,0,0,0.5)]"
57
  >
58
  <div className="flex items-center justify-around h-14 px-4">
59
  {/* Главная */}
 
53
  animate={{ y: 0 }}
54
  exit={{ y: '100%' }}
55
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
56
+ className="fixed bottom-0 left-0 right-0 z-40 bg-[#0D0E18]/80 backdrop-blur-2xl backdrop-saturate-[1.8] border-t border-white/10 pb-[env(safe-area-inset-bottom,0px)]"
57
  >
58
  <div className="flex items-center justify-around h-14 px-4">
59
  {/* Главная */}
frontend/components/MobileNav.tsx CHANGED
@@ -57,27 +57,29 @@ export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
57
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
58
 
59
  return (
60
- <div className="flex items-center justify-between px-4 h-16 bg-[#0D0E18]/80 backdrop-blur-xl backdrop-saturate-[1.8] text-white relative z-[60] border-b border-white/10 top-0 left-0 right-0">
61
- {/* Left: Logo + Brand Name */}
62
- <Link href="/dashboard" className="flex items-center gap-3">
63
- <div className="w-8 h-8 relative">
64
- <img src="/logo-v2.png" alt="Logo" className="w-full h-full object-contain relative z-10" />
65
- </div>
66
- <span className="font-bold text-lg tracking-[0.2em] uppercase text-white">
67
- MICROFUNNEL
68
- </span>
69
- </Link>
70
-
71
- {/* Right: Hub */}
72
- <div className="flex items-center gap-3">
73
- {usageStats && (
74
- <div className="hidden sm:block text-[10px] font-bold text-indigo-400 bg-indigo-500/10 px-2 py-0.5 rounded-full border border-indigo-500/20 uppercase tracking-wider">
75
- {usedDialogs}/{isUnlimited ? '∞' : limitDialogs}
76
  </div>
77
- )}
 
 
 
 
 
 
 
 
 
 
 
78
 
79
- {/* Profile avatar with its own click handler or just UserMenu if modular */}
80
- <UserMenu user={user} logout={logout} companyName={companyName} getInitials={getInitials} getAvatarColor={getAvatarColor} />
 
81
  </div>
82
  </div>
83
  )
 
57
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
58
 
59
  return (
60
+ <div className="flex flex-col fixed top-0 left-0 right-0 z-[60] bg-[#0D0E18]/80 backdrop-blur-2xl backdrop-saturate-[1.8] border-b border-white/10 pt-[env(safe-area-inset-top,0px)]">
61
+ <div className="flex items-center justify-between px-4 h-16 text-white w-full">
62
+ {/* Left: Logo + Brand Name */}
63
+ <Link href="/dashboard" className="flex items-center gap-3">
64
+ <div className="w-8 h-8 relative">
65
+ <img src="/logo-v2.png" alt="Logo" className="w-full h-full object-contain relative z-10" />
 
 
 
 
 
 
 
 
 
 
66
  </div>
67
+ <span className="font-bold text-lg tracking-[0.2em] uppercase text-white">
68
+ MICROFUNNEL
69
+ </span>
70
+ </Link>
71
+
72
+ {/* Right: Hub */}
73
+ <div className="flex items-center gap-3">
74
+ {usageStats && (
75
+ <div className="hidden sm:block text-[10px] font-bold text-indigo-400 bg-indigo-500/10 px-2 py-0.5 rounded-full border border-indigo-500/20 uppercase tracking-wider">
76
+ {usedDialogs}/{isUnlimited ? '∞' : limitDialogs}
77
+ </div>
78
+ )}
79
 
80
+ {/* Profile avatar with its own click handler or just UserMenu if modular */}
81
+ <UserMenu user={user} logout={logout} companyName={companyName} getInitials={getInitials} getAvatarColor={getAvatarColor} />
82
+ </div>
83
  </div>
84
  </div>
85
  )
frontend/components/Sidebar.tsx CHANGED
@@ -148,8 +148,8 @@ export function Sidebar() {
148
  variants={sidebarVariants}
149
  className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/5 z-20 bg-[#0a0a12]/90 backdrop-blur-xl backdrop-saturate-[1.8]"
150
  >
151
- {/* Logo Section */}
152
- <div className="p-6 relative z-50">
153
  <Link href="/dashboard" className="flex items-center gap-3 group">
154
  <div className="w-8 h-8 flex items-center justify-center relative">
155
  <img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain" />
 
148
  variants={sidebarVariants}
149
  className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/5 z-20 bg-[#0a0a12]/90 backdrop-blur-xl backdrop-saturate-[1.8]"
150
  >
151
+ {/* Logo Section - Hidden on mobile, already in MobileHeader */}
152
+ <div className="p-6 relative z-50 hidden lg:block">
153
  <Link href="/dashboard" className="flex items-center gap-3 group">
154
  <div className="w-8 h-8 flex items-center justify-center relative">
155
  <img src="/logo-v2.png" alt="MicroFunnel Logo" className="w-full h-full object-contain" />