Spaces:
Running

axeronis commited on
Commit
55839d5
·
1 Parent(s): 0acf249

fix: Mobile UI seamless flow - fixed footer sync, header gaps, and input/footer unified background

Browse files
frontend/app/layout.tsx CHANGED
@@ -82,7 +82,7 @@ export default function RootLayout({
82
  <Header />
83
 
84
  {/* Mobile Header - FIXED at top */}
85
- <div className="md:hidden fixed top-0 left-0 right-0 z-40">
86
  <MobileHeader />
87
  </div>
88
 
 
82
  <Header />
83
 
84
  {/* Mobile Header - FIXED at top */}
85
+ <div className="md:hidden fixed top-0 left-0 right-0 z-[60]">
86
  <MobileHeader />
87
  </div>
88
 
frontend/components/ChatWindow/MessageInput.tsx CHANGED
@@ -132,7 +132,7 @@ export function MessageInput({
132
  }
133
 
134
  return (
135
- <div className="p-3 md:p-6 bg-gradient-to-t from-black/40 to-transparent backdrop-blur-xl flex-shrink-0 md:relative fixed bottom-14 md:bottom-auto left-0 right-0 z-30">
136
  <div className="max-w-4xl mx-auto relative">
137
  {/* File Preview */}
138
  {selectedFile && (
@@ -193,7 +193,7 @@ export function MessageInput({
193
 
194
  <form
195
  onSubmit={handleSubmit}
196
- className="flex items-end gap-2 bg-white/5 p-2 rounded-2xl border border-white/10 focus-within:ring-2 focus-within:ring-indigo-500/30 transition-all"
197
  >
198
  <input
199
  type="file"
@@ -203,35 +203,37 @@ export function MessageInput({
203
  accept="image/*,.pdf,.txt,.doc,.docx"
204
  />
205
 
206
- <button
207
- type="button"
208
- onClick={() => fileInputRef.current?.click()}
209
- className={cn(
210
- "p-2.5 rounded-xl transition-colors",
211
- selectedFile ? "text-indigo-400 bg-indigo-500/10" : "text-slate-500 hover:text-indigo-400 hover:bg-white/5"
212
- )}
213
- >
214
- <Paperclip className="w-5 h-5" />
215
- </button>
 
216
 
217
- <button
218
- type="button"
219
- onClick={startRecording}
220
- className={cn(
221
- "p-2.5 rounded-xl transition-colors",
222
- isRecording ? "text-red-500 bg-red-500/10" : "text-slate-500 hover:text-indigo-400 hover:bg-white/5"
223
- )}
224
- disabled={!!selectedFile}
225
- >
226
- <Mic className="w-5 h-5" />
227
- </button>
 
228
 
229
  <textarea
230
  value={value}
231
  onChange={(e) => onChange(e.target.value)}
232
  onKeyDown={handleKeyDown}
233
  placeholder="Сообщение..."
234
- className="flex-1 bg-transparent border-none focus:ring-0 resize-none max-h-32 py-2 md:py-2.5 px-2 md:px-4 text-sm text-white placeholder:text-slate-500"
235
  rows={1}
236
  style={{ minHeight: '40px' }}
237
  disabled={disabled || isRecording}
@@ -242,10 +244,10 @@ export function MessageInput({
242
  type="submit"
243
  disabled={(!value.trim() && !selectedFile) || isSending || disabled}
244
  className={cn(
245
- "p-2.5 rounded-xl transition-all duration-200 shadow-sm",
246
  ((value.trim() || selectedFile) && !isSending && !disabled)
247
- ? "bg-indigo-600 text-white hover:bg-indigo-500 hover:scale-105 active:scale-95"
248
- : "bg-white/5 text-slate-500 cursor-not-allowed"
249
  )}
250
  >
251
  {isSending ? (
 
132
  }
133
 
134
  return (
135
+ <div className="p-3 bg-gradient-to-t from-black/90 via-black/40 to-transparent backdrop-blur-xl flex-shrink-0 md:relative fixed bottom-14 md:bottom-auto left-0 right-0 z-30">
136
  <div className="max-w-4xl mx-auto relative">
137
  {/* File Preview */}
138
  {selectedFile && (
 
193
 
194
  <form
195
  onSubmit={handleSubmit}
196
+ className="flex items-center gap-2 bg-white/5 backdrop-blur-md p-1.5 rounded-2xl border border-white/5 focus-within:ring-1 focus-within:ring-white/10 transition-all shadow-lg"
197
  >
198
  <input
199
  type="file"
 
203
  accept="image/*,.pdf,.txt,.doc,.docx"
204
  />
205
 
206
+ <div className="flex items-center gap-1 pl-1">
207
+ <button
208
+ type="button"
209
+ onClick={() => fileInputRef.current?.click()}
210
+ className={cn(
211
+ "p-2 rounded-xl transition-all active:scale-90",
212
+ selectedFile ? "text-indigo-400 bg-indigo-500/10" : "text-slate-400 hover:text-white"
213
+ )}
214
+ >
215
+ <Paperclip className="w-5 h-5" />
216
+ </button>
217
 
218
+ <button
219
+ type="button"
220
+ onClick={startRecording}
221
+ className={cn(
222
+ "p-2 rounded-xl transition-all active:scale-90",
223
+ isRecording ? "text-red-500 bg-red-500/10 animate-pulse" : "text-slate-400 hover:text-white"
224
+ )}
225
+ disabled={!!selectedFile}
226
+ >
227
+ <Mic className="w-5 h-5" />
228
+ </button>
229
+ </div>
230
 
231
  <textarea
232
  value={value}
233
  onChange={(e) => onChange(e.target.value)}
234
  onKeyDown={handleKeyDown}
235
  placeholder="Сообщение..."
236
+ className="flex-1 bg-transparent border-none focus:ring-0 resize-none max-h-32 py-2 px-3 text-sm text-white placeholder:text-slate-500"
237
  rows={1}
238
  style={{ minHeight: '40px' }}
239
  disabled={disabled || isRecording}
 
244
  type="submit"
245
  disabled={(!value.trim() && !selectedFile) || isSending || disabled}
246
  className={cn(
247
+ "p-2.5 rounded-xl transition-all duration-300",
248
  ((value.trim() || selectedFile) && !isSending && !disabled)
249
+ ? "bg-white text-black hover:scale-105 active:scale-95 shadow-[0_0_20px_rgba(255,255,255,0.2)]"
250
+ : "text-slate-600 opacity-50 grayscale"
251
  )}
252
  >
253
  {isSending ? (
frontend/components/MobileBottomNav.tsx CHANGED
@@ -51,7 +51,7 @@ export function MobileBottomNav() {
51
  animate={{ y: 0 }}
52
  exit={{ y: '100%' }}
53
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
54
- className="fixed bottom-0 left-0 right-0 z-40 bg-gradient-to-t from-black/80 via-black/40 to-transparent backdrop-blur-xl safe-area-bottom"
55
  >
56
  <div className="flex items-center justify-around h-14 px-4">
57
  {/* Главная */}
 
51
  animate={{ y: 0 }}
52
  exit={{ y: '100%' }}
53
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
54
+ className="fixed bottom-0 left-0 right-0 z-40 bg-gradient-to-t from-black to-black/90 backdrop-blur-xl safe-area-bottom"
55
  >
56
  <div className="flex items-center justify-around h-14 px-4">
57
  {/* Главная */}
frontend/components/MobileNav.tsx CHANGED
@@ -51,7 +51,7 @@ export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
51
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
52
 
53
  return (
54
- <div className="flex items-center justify-between px-4 py-3 bg-gradient-to-b from-black/80 to-black/60 backdrop-blur-xl text-white sticky top-0 z-[60]">
55
  {/* Left: Logo + Brand Name */}
56
  <Link href="/dashboard" className="flex items-center gap-2">
57
  <img src="/logo-v2.png" alt="Logo" className="w-8 h-8 object-contain" />
@@ -134,8 +134,14 @@ export function MobileSidebarWrapper({ children }: { children: React.ReactNode }
134
  // Close on route change
135
  useEffect(() => {
136
  setIsOpen(false)
 
137
  }, [pathname])
138
 
 
 
 
 
 
139
  return (
140
  <div className="md:hidden">
141
  <AnimatePresence>
@@ -146,7 +152,7 @@ export function MobileSidebarWrapper({ children }: { children: React.ReactNode }
146
  initial={{ opacity: 0 }}
147
  animate={{ opacity: 1 }}
148
  exit={{ opacity: 0 }}
149
- onClick={() => setIsOpen(false)}
150
  className="fixed inset-0 bg-black/30 backdrop-blur-sm z-40"
151
  />
152
 
 
51
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
52
 
53
  return (
54
+ <div className="flex items-center justify-between px-4 h-16 bg-gradient-to-b from-black/80 to-black/60 backdrop-blur-xl text-white relative z-[60]">
55
  {/* Left: Logo + Brand Name */}
56
  <Link href="/dashboard" className="flex items-center gap-2">
57
  <img src="/logo-v2.png" alt="Logo" className="w-8 h-8 object-contain" />
 
134
  // Close on route change
135
  useEffect(() => {
136
  setIsOpen(false)
137
+ document.dispatchEvent(new CustomEvent('close-mobile-sidebar'))
138
  }, [pathname])
139
 
140
+ const closeSidebar = () => {
141
+ setIsOpen(false)
142
+ document.dispatchEvent(new CustomEvent('close-mobile-sidebar'))
143
+ }
144
+
145
  return (
146
  <div className="md:hidden">
147
  <AnimatePresence>
 
152
  initial={{ opacity: 0 }}
153
  animate={{ opacity: 1 }}
154
  exit={{ opacity: 0 }}
155
+ onClick={closeSidebar}
156
  className="fixed inset-0 bg-black/30 backdrop-blur-sm z-40"
157
  />
158