Simplify the global post composer to a fixed black modal with restrained accent styling and floating non-expanding mention suggestions

Hop-State: A_06FPGBD668M4WJRVYHAM020
Hop-Proposal: R_06FPGBCMGHADXWXMCD7PQFG
Hop-Task: T_06FPGASKBG6WDSYPSD8X8J8
Hop-Attempt: AT_06FPGASKBJGWGHWHTV17JYG
This commit is contained in:
2026-07-15 16:47:29 -07:00
committed by Hop
parent 35b698e55a
commit a6861b6fa2
2 changed files with 52 additions and 167 deletions
+49 -139
View File
@@ -1079,77 +1079,48 @@ a.btn-primary:visited {
z-index: 11000; z-index: 11000;
display: grid; display: grid;
place-items: center; place-items: center;
overflow-y: auto; padding: 24px;
padding: 32px 24px; background: rgba(0, 0, 0, 0.82);
background: backdrop-filter: blur(10px);
radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.055), transparent 38%), -webkit-backdrop-filter: blur(10px);
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; animation: globalComposeFadeIn 0.16s ease-out;
} }
.global-compose-modal { .global-compose-modal {
position: relative; position: relative;
isolation: isolate; isolation: isolate;
width: min(680px, 100%); width: min(620px, 100%);
overflow: visible; overflow: visible;
border: 1px solid color-mix(in srgb, var(--border-hover) 72%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 16%, #242424);
border-radius: 26px; border-radius: 16px;
background: linear-gradient(180deg, #141414 0%, #0d0d0d 100%); background: #050505;
box-shadow: box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
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; animation: globalComposeRiseIn 0.2s ease-out;
} }
.global-compose-modal::before { .global-compose-modal::before {
content: ''; content: '';
position: absolute; position: absolute;
z-index: -1; inset: -1px 16px auto;
inset: 0 12% auto; height: 2px;
height: 1px; border-radius: 999px;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent); background: var(--accent);
opacity: 0.8;
} }
.global-compose-header { .global-compose-header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 20px 22px 18px; padding: 15px 18px;
border-bottom: 1px solid rgba(255, 255, 255, 0.075); border-bottom: 1px solid #1d1d1d;
} }
.global-compose-header h2 { .global-compose-header h2 {
margin: 0; margin: 0;
font-size: 17px; font-size: 16px;
font-weight: 650; font-weight: 600;
letter-spacing: -0.01em; letter-spacing: -0.015em;
}
.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 { .global-compose-close {
@@ -1163,116 +1134,59 @@ a.btn-primary:visited {
border-radius: 50%; border-radius: 50%;
color: var(--foreground-secondary); color: var(--foreground-secondary);
border: 1px solid transparent; border: 1px solid transparent;
background: rgba(255, 255, 255, 0.025); background: transparent;
cursor: pointer; cursor: pointer;
} }
.global-compose-close:hover { .global-compose-close:hover {
color: var(--foreground); color: var(--accent);
border-color: var(--border); border-color: color-mix(in srgb, var(--accent) 22%, transparent);
background: rgba(255, 255, 255, 0.07); background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.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 { .global-compose-modal .compose {
padding: 8px 24px 22px; padding: 18px;
border-bottom: 0; border-bottom: 0;
} }
.global-compose-modal .compose-mention-field { .global-compose-modal .compose-mention-field {
border: 1px solid rgba(255, 255, 255, 0.09); position: relative;
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 { .global-compose-modal .compose-input {
min-height: 142px; min-height: 150px;
padding: 18px; padding: 6px 4px 12px;
font-size: 18px; font-size: 17px;
line-height: 1.5; line-height: 1.55;
caret-color: var(--accent);
} }
.global-compose-modal .compose-mention-suggestions { .global-compose-modal .compose-mention-suggestions {
position: relative; position: absolute;
inset: auto; z-index: 5;
z-index: 1; top: calc(100% + 8px);
max-height: min(272px, 36dvh); left: 0;
margin: -4px 10px 10px; right: 0;
border-color: rgba(255, 255, 255, 0.1); max-height: min(238px, 34dvh);
border-radius: 13px; margin: 0;
background: #101010; border-color: color-mix(in srgb, var(--accent) 18%, #242424);
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); border-radius: 12px;
background: #080808;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72);
} }
.global-compose-modal .compose-footer { .global-compose-modal .compose-footer {
margin-top: 18px; margin-top: 8px;
padding-top: 17px; padding-top: 14px;
border-top: 1px solid rgba(255, 255, 255, 0.07); border-top: 1px solid #1d1d1d;
} }
.global-compose-modal .compose-actions .btn-primary { .global-compose-modal .compose-actions .btn-primary {
min-width: 88px; min-width: 88px;
padding: 9px 20px; padding: 8px 20px;
border-radius: 999px; border-radius: 999px;
font-weight: 650; font-weight: 600;
box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 10%, transparent);
} }
@keyframes globalComposeFadeIn { @keyframes globalComposeFadeIn {
@@ -1303,15 +1217,11 @@ a.btn-primary:visited {
} }
.global-compose-header { .global-compose-header {
padding: 16px 16px 14px; padding: 14px 16px;
}
.global-compose-identity {
padding: 16px 18px 0;
} }
.global-compose-modal .compose { .global-compose-modal .compose {
padding: 6px 18px 18px; padding: 16px;
} }
.global-compose-modal .compose-input { .global-compose-modal .compose-input {
+3 -28
View File
@@ -1,9 +1,8 @@
'use client'; 'use client';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { PenLine, Plus, X } from 'lucide-react'; import { Plus, X } from 'lucide-react';
import { Compose } from '@/components/Compose'; import { Compose } from '@/components/Compose';
import { AvatarImage } from '@/components/AvatarImage';
import { signedAPI } from '@/lib/api/signed-fetch'; import { signedAPI } from '@/lib/api/signed-fetch';
import { useAuth } from '@/lib/contexts/AuthContext'; import { useAuth } from '@/lib/contexts/AuthContext';
import { useToast } from '@/lib/contexts/ToastContext'; import { useToast } from '@/lib/contexts/ToastContext';
@@ -96,18 +95,9 @@ export function GlobalPostComposer() {
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
aria-labelledby="global-compose-title" aria-labelledby="global-compose-title"
aria-describedby="global-compose-description"
> >
<header className="global-compose-header"> <header className="global-compose-header">
<div className="global-compose-heading"> <h2 id="global-compose-title">Create post</h2>
<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 <button
type="button" type="button"
className="global-compose-close" className="global-compose-close"
@@ -117,24 +107,9 @@ export function GlobalPostComposer() {
<X size={22} /> <X size={22} />
</button> </button>
</header> </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 <Compose
autoFocus autoFocus
placeholder="What do you want to share?" placeholder="What's happening?"
onPost={handlePost} onPost={handlePost}
onPosted={() => { onPosted={() => {
setOpenForUserId(null); setOpenForUserId(null);