Keep mention suggestions beneath the sticky feed header and redesign the global composer with unclipped in-flow suggestions, posting identity, and a refined premium surface
Hop-State: A_06FPG91R98C050VWTAKGRKG Hop-Proposal: R_06FPG915QD4SR4VFHHX53D0 Hop-Task: T_06FPG7TG5B2731WFT0VWGW8 Hop-Attempt: AT_06FPG7TG58Z084M8ZE6VEP0
This commit is contained in:
+192
-24
@@ -804,7 +804,7 @@ a.btn-primary:visited {
|
||||
|
||||
.compose-mention-suggestions {
|
||||
position: absolute;
|
||||
z-index: 40;
|
||||
z-index: 30;
|
||||
top: calc(100% + 4px);
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
@@ -1079,41 +1079,77 @@ a.btn-primary:visited {
|
||||
z-index: 11000;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
background: rgba(0, 0, 0, 0.72);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
overflow-y: auto;
|
||||
padding: 32px 24px;
|
||||
background:
|
||||
radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.055), transparent 38%),
|
||||
rgba(0, 0, 0, 0.78);
|
||||
backdrop-filter: blur(16px) saturate(0.8);
|
||||
-webkit-backdrop-filter: blur(16px) saturate(0.8);
|
||||
animation: globalComposeFadeIn 0.16s ease-out;
|
||||
}
|
||||
|
||||
.global-compose-modal {
|
||||
width: min(640px, 100%);
|
||||
max-height: calc(100dvh - 48px);
|
||||
overflow-y: auto;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 24px;
|
||||
background: var(--background-secondary);
|
||||
box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
width: min(680px, 100%);
|
||||
overflow: visible;
|
||||
border: 1px solid color-mix(in srgb, var(--border-hover) 72%, transparent);
|
||||
border-radius: 26px;
|
||||
background: linear-gradient(180deg, #141414 0%, #0d0d0d 100%);
|
||||
box-shadow:
|
||||
0 36px 120px rgba(0, 0, 0, 0.78),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.025) inset;
|
||||
animation: globalComposeRiseIn 0.2s ease-out;
|
||||
}
|
||||
|
||||
.global-compose-modal::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
inset: 0 12% auto;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
|
||||
}
|
||||
|
||||
.global-compose-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16px 18px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: color-mix(in srgb, var(--background-secondary) 94%, transparent);
|
||||
backdrop-filter: blur(14px);
|
||||
padding: 20px 22px 18px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.075);
|
||||
}
|
||||
|
||||
.global-compose-header h2 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
font-size: 17px;
|
||||
font-weight: 650;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.global-compose-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.global-compose-heading-icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
flex: 0 0 38px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 12px;
|
||||
color: var(--foreground);
|
||||
background: rgba(255, 255, 255, 0.055);
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
|
||||
}
|
||||
|
||||
.global-compose-heading p {
|
||||
margin: 2px 0 0;
|
||||
color: var(--foreground-tertiary);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.global-compose-close {
|
||||
@@ -1126,13 +1162,117 @@ a.btn-primary:visited {
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--foreground-secondary);
|
||||
background: transparent;
|
||||
border: 1px solid transparent;
|
||||
background: rgba(255, 255, 255, 0.025);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.global-compose-close:hover {
|
||||
color: var(--foreground);
|
||||
border-color: var(--border);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
}
|
||||
|
||||
.global-compose-identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
padding: 20px 24px 0;
|
||||
}
|
||||
|
||||
.global-compose-avatar {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
flex: 0 0 42px;
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
border-radius: 50%;
|
||||
background: var(--background-tertiary);
|
||||
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.025);
|
||||
}
|
||||
|
||||
.global-compose-avatar img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.global-compose-identity-copy {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.global-compose-identity-copy > span {
|
||||
overflow: hidden;
|
||||
font-size: 14px;
|
||||
font-weight: 650;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.global-compose-identity-copy small {
|
||||
overflow: hidden;
|
||||
color: var(--foreground-tertiary);
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.global-compose-audience {
|
||||
padding: 5px 9px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
color: var(--foreground-secondary);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
background: rgba(255, 255, 255, 0.025);
|
||||
}
|
||||
|
||||
.global-compose-modal .compose {
|
||||
padding: 8px 24px 22px;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-mention-field {
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
border-radius: 17px;
|
||||
background: rgba(0, 0, 0, 0.22);
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-input {
|
||||
min-height: 142px;
|
||||
padding: 18px;
|
||||
font-size: 18px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-mention-suggestions {
|
||||
position: relative;
|
||||
inset: auto;
|
||||
z-index: 1;
|
||||
max-height: min(272px, 36dvh);
|
||||
margin: -4px 10px 10px;
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 13px;
|
||||
background: #101010;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-footer {
|
||||
margin-top: 18px;
|
||||
padding-top: 17px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.07);
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-actions .btn-primary {
|
||||
min-width: 88px;
|
||||
padding: 9px 20px;
|
||||
border-radius: 999px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
@keyframes globalComposeFadeIn {
|
||||
@@ -1154,14 +1294,42 @@ a.btn-primary:visited {
|
||||
|
||||
.global-compose-overlay {
|
||||
align-items: end;
|
||||
padding: 12px;
|
||||
padding: 12px 10px max(12px, env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.global-compose-modal {
|
||||
width: 100%;
|
||||
max-height: calc(100dvh - 24px);
|
||||
border-radius: 22px;
|
||||
}
|
||||
|
||||
.global-compose-header {
|
||||
padding: 16px 16px 14px;
|
||||
}
|
||||
|
||||
.global-compose-identity {
|
||||
padding: 16px 18px 0;
|
||||
}
|
||||
|
||||
.global-compose-modal .compose {
|
||||
padding: 6px 18px 18px;
|
||||
}
|
||||
|
||||
.global-compose-modal .compose-input {
|
||||
min-height: 116px;
|
||||
font-size: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep feed autocomplete beneath the sticky navigation as the page scrolls. */
|
||||
.home-feed-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(10, 10, 10, 0.94);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
/* Feed toggle + meta */
|
||||
|
||||
+1
-9
@@ -220,15 +220,7 @@ export default function Home() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<header style={{
|
||||
padding: '16px',
|
||||
borderBottom: '1px solid var(--border)',
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
background: 'rgba(10, 10, 10, 0.95)',
|
||||
zIndex: 10,
|
||||
backdropFilter: 'blur(12px)',
|
||||
}}>
|
||||
<header className="home-feed-header">
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', flexWrap: 'wrap' }}>
|
||||
<h1 style={{ fontSize: '20px', fontWeight: 600 }}>Home</h1>
|
||||
<div className="feed-toggle">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Plus, X } from 'lucide-react';
|
||||
import { PenLine, Plus, X } from 'lucide-react';
|
||||
import { Compose } from '@/components/Compose';
|
||||
import { AvatarImage } from '@/components/AvatarImage';
|
||||
import { signedAPI } from '@/lib/api/signed-fetch';
|
||||
import { useAuth } from '@/lib/contexts/AuthContext';
|
||||
import { useToast } from '@/lib/contexts/ToastContext';
|
||||
@@ -10,7 +11,8 @@ import { useToast } from '@/lib/contexts/ToastContext';
|
||||
export function GlobalPostComposer() {
|
||||
const { user, did, handle } = useAuth();
|
||||
const { showToast } = useToast();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [openForUserId, setOpenForUserId] = useState<string | null>(null);
|
||||
const open = Boolean(user && openForUserId === user.id);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
@@ -19,7 +21,7 @@ export function GlobalPostComposer() {
|
||||
document.body.style.overflow = 'hidden';
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === 'Escape') setOpen(false);
|
||||
if (event.key === 'Escape') setOpenForUserId(null);
|
||||
};
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
|
||||
@@ -29,10 +31,6 @@ export function GlobalPostComposer() {
|
||||
};
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!user) setOpen(false);
|
||||
}, [user]);
|
||||
|
||||
if (!user) return null;
|
||||
|
||||
const handlePost = async (
|
||||
@@ -78,7 +76,7 @@ export function GlobalPostComposer() {
|
||||
<button
|
||||
type="button"
|
||||
className="global-compose-fab"
|
||||
onClick={() => setOpen(true)}
|
||||
onClick={() => setOpenForUserId(user.id)}
|
||||
aria-label="Create a post"
|
||||
title="Create a post"
|
||||
>
|
||||
@@ -90,7 +88,7 @@ export function GlobalPostComposer() {
|
||||
<div
|
||||
className="global-compose-overlay"
|
||||
onMouseDown={(event) => {
|
||||
if (event.target === event.currentTarget) setOpen(false);
|
||||
if (event.target === event.currentTarget) setOpenForUserId(null);
|
||||
}}
|
||||
>
|
||||
<section
|
||||
@@ -98,23 +96,48 @@ export function GlobalPostComposer() {
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="global-compose-title"
|
||||
aria-describedby="global-compose-description"
|
||||
>
|
||||
<header className="global-compose-header">
|
||||
<h2 id="global-compose-title">Create post</h2>
|
||||
<div className="global-compose-heading">
|
||||
<span className="global-compose-heading-icon" aria-hidden="true">
|
||||
<PenLine size={18} strokeWidth={2} />
|
||||
</span>
|
||||
<div>
|
||||
<h2 id="global-compose-title">New post</h2>
|
||||
<p id="global-compose-description">Share something with your network</p>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="global-compose-close"
|
||||
onClick={() => setOpen(false)}
|
||||
onClick={() => setOpenForUserId(null)}
|
||||
aria-label="Close post composer"
|
||||
>
|
||||
<X size={22} />
|
||||
</button>
|
||||
</header>
|
||||
<div className="global-compose-identity">
|
||||
<span className="global-compose-avatar">
|
||||
<AvatarImage
|
||||
avatarUrl={user.avatarUrl}
|
||||
seed={user.handle}
|
||||
isNsfw={user.isNsfw}
|
||||
alt=""
|
||||
/>
|
||||
</span>
|
||||
<div className="global-compose-identity-copy">
|
||||
<span>{user.displayName || user.handle}</span>
|
||||
<small>@{user.handle}</small>
|
||||
</div>
|
||||
<span className="global-compose-audience">Public</span>
|
||||
</div>
|
||||
<Compose
|
||||
autoFocus
|
||||
placeholder="What do you want to share?"
|
||||
onPost={handlePost}
|
||||
onPosted={() => {
|
||||
setOpen(false);
|
||||
setOpenForUserId(null);
|
||||
showToast('Post published.', 'success');
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user