Spaces:
Running
Running
axeronis commited on
Commit ·
53900e6
1
Parent(s): 6e3a1f6
fix(ui): global mobile layout padding, fixed headers, and chat swipe gestures
Browse files
frontend/app/chats/page.tsx
CHANGED
|
@@ -333,7 +333,7 @@ function ChatsContent() {
|
|
| 333 |
animate={{ opacity: 1 }}
|
| 334 |
exit={{ opacity: 0 }}
|
| 335 |
onClick={() => { setIsSummaryOpen(false); setSummaryLead(undefined); }}
|
| 336 |
-
className="fixed right-0 top-
|
| 337 |
/>
|
| 338 |
|
| 339 |
<motion.div
|
|
@@ -350,7 +350,7 @@ function ChatsContent() {
|
|
| 350 |
animate={{ x: 0, opacity: 1 }}
|
| 351 |
exit={{ x: '100%', opacity: 0 }}
|
| 352 |
transition={{ type: 'spring', damping: 30, stiffness: 250, mass: 0.8 }}
|
| 353 |
-
className="fixed right-0 top-
|
| 354 |
style={{ willChange: 'transform', transform: 'translateZ(0)' }}
|
| 355 |
>
|
| 356 |
|
|
|
|
| 333 |
animate={{ opacity: 1 }}
|
| 334 |
exit={{ opacity: 0 }}
|
| 335 |
onClick={() => { setIsSummaryOpen(false); setSummaryLead(undefined); }}
|
| 336 |
+
className="fixed right-0 top-[var(--header-height-mobile)] md:top-0 bottom-[var(--footer-height-mobile)] md:bottom-0 bg-black/40 backdrop-blur-[4px] z-[15] left-0 md:left-[320px]"
|
| 337 |
/>
|
| 338 |
|
| 339 |
<motion.div
|
|
|
|
| 350 |
animate={{ x: 0, opacity: 1 }}
|
| 351 |
exit={{ x: '100%', opacity: 0 }}
|
| 352 |
transition={{ type: 'spring', damping: 30, stiffness: 250, mass: 0.8 }}
|
| 353 |
+
className="fixed right-0 top-[var(--header-height-mobile)] md:top-0 bottom-[var(--footer-height-mobile)] md:bottom-0 w-[88%] max-w-[380px] bg-[#050510]/95 backdrop-blur-xl border-l border-white/10 z-[16] flex flex-col shadow-[0_0_50px_rgba(0,0,0,0.5)] rounded-l-2xl md:rounded-l-[32px] overflow-hidden"
|
| 354 |
style={{ willChange: 'transform', transform: 'translateZ(0)' }}
|
| 355 |
>
|
| 356 |
|
frontend/app/globals.css
CHANGED
|
@@ -162,6 +162,10 @@ html {
|
|
| 162 |
--md-sys-elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
|
| 163 |
--md-sys-elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
|
| 164 |
--md-sys-elevation-5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
|
| 167 |
body {
|
|
|
|
| 162 |
--md-sys-elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
|
| 163 |
--md-sys-elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
|
| 164 |
--md-sys-elevation-5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
|
| 165 |
+
|
| 166 |
+
/* Mobile Layout Constants */
|
| 167 |
+
--header-height-mobile: calc(64px + env(safe-area-inset-top, 0px));
|
| 168 |
+
--footer-height-mobile: calc(56px + env(safe-area-inset-bottom, 0px));
|
| 169 |
}
|
| 170 |
|
| 171 |
body {
|
frontend/app/layout.tsx
CHANGED
|
@@ -104,8 +104,8 @@ export default function RootLayout({
|
|
| 104 |
pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
|
| 105 |
)}
|
| 106 |
style={{
|
| 107 |
-
paddingTop:
|
| 108 |
-
paddingBottom: '
|
| 109 |
}}
|
| 110 |
>
|
| 111 |
{children}
|
|
|
|
| 104 |
pathname?.startsWith('/chats') ? "overflow-y-hidden" : "overflow-y-auto"
|
| 105 |
)}
|
| 106 |
style={{
|
| 107 |
+
paddingTop: pathname?.startsWith('/chats') ? '0px' : 'var(--header-height-mobile)',
|
| 108 |
+
paddingBottom: 'var(--footer-height-mobile)'
|
| 109 |
}}
|
| 110 |
>
|
| 111 |
{children}
|
frontend/components/ChatWindow.tsx
CHANGED
|
@@ -366,11 +366,8 @@ export function ChatWindow({
|
|
| 366 |
|
| 367 |
return (
|
| 368 |
<motion.div
|
| 369 |
-
drag="x"
|
| 370 |
-
dragConstraints={{ left: 0, right: 0 }}
|
| 371 |
-
dragElastic={0.2}
|
| 372 |
onDragEnd={(_, info) => {
|
| 373 |
-
const threshold =
|
| 374 |
if (info.offset.x > threshold) {
|
| 375 |
// Swipe Right -> Back to list
|
| 376 |
onBack?.()
|
|
@@ -379,7 +376,11 @@ export function ChatWindow({
|
|
| 379 |
onOpenMobileDrawer?.()
|
| 380 |
}
|
| 381 |
}}
|
| 382 |
-
className="flex flex-col h-full bg-[#050510] font-['Inter'] relative overflow-hidden touch-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
>
|
| 384 |
{/* Background Atmosphere - Synced with Main Layout */}
|
| 385 |
<div className="absolute inset-0 pointer-events-none overflow-hidden -z-10">
|
|
|
|
| 366 |
|
| 367 |
return (
|
| 368 |
<motion.div
|
|
|
|
|
|
|
|
|
|
| 369 |
onDragEnd={(_, info) => {
|
| 370 |
+
const threshold = 60 // Lowered threshold for better response
|
| 371 |
if (info.offset.x > threshold) {
|
| 372 |
// Swipe Right -> Back to list
|
| 373 |
onBack?.()
|
|
|
|
| 376 |
onOpenMobileDrawer?.()
|
| 377 |
}
|
| 378 |
}}
|
| 379 |
+
className="flex flex-col h-full bg-[#050510] font-['Inter'] relative overflow-hidden touch-pan-y"
|
| 380 |
+
style={{
|
| 381 |
+
paddingTop: 'var(--header-height-mobile)',
|
| 382 |
+
paddingBottom: 'var(--footer-height-mobile)'
|
| 383 |
+
}}
|
| 384 |
>
|
| 385 |
{/* Background Atmosphere - Synced with Main Layout */}
|
| 386 |
<div className="absolute inset-0 pointer-events-none overflow-hidden -z-10">
|
frontend/components/MobileBottomNav.tsx
CHANGED
|
@@ -58,10 +58,10 @@ export function MobileBottomNav() {
|
|
| 58 |
<div className="flex items-center justify-around h-14 px-4">
|
| 59 |
{/* Главная */}
|
| 60 |
<Link
|
| 61 |
-
href="/
|
| 62 |
className={cn(
|
| 63 |
"flex flex-col items-center justify-center p-2 rounded-xl transition-all",
|
| 64 |
-
isActive('/
|
| 65 |
? "text-indigo-400 bg-indigo-500/10"
|
| 66 |
: "text-slate-500 active:bg-white/5"
|
| 67 |
)}
|
|
|
|
| 58 |
<div className="flex items-center justify-around h-14 px-4">
|
| 59 |
{/* Главная */}
|
| 60 |
<Link
|
| 61 |
+
href="/settings/brain"
|
| 62 |
className={cn(
|
| 63 |
"flex flex-col items-center justify-center p-2 rounded-xl transition-all",
|
| 64 |
+
isActive('/settings/brain')
|
| 65 |
? "text-indigo-400 bg-indigo-500/10"
|
| 66 |
: "text-slate-500 active:bg-white/5"
|
| 67 |
)}
|