Improve stream sidebar experience and avatar affordance #284
@@ -16,7 +16,7 @@ function ScrollArea({
|
|||||||
>
|
>
|
||||||
<ScrollAreaPrimitive.Viewport
|
<ScrollAreaPrimitive.Viewport
|
||||||
data-slot="scroll-area-viewport"
|
data-slot="scroll-area-viewport"
|
||||||
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:!w-full"
|
||||||
>
|
>
|
||||||
|
|
|||||||
{children}
|
{children}
|
||||||
</ScrollAreaPrimitive.Viewport>
|
</ScrollAreaPrimitive.Viewport>
|
||||||
|
|||||||
@@ -41,13 +41,12 @@ export function StreamListSidebar({
|
|||||||
}, [currentIndex]);
|
}, [currentIndex]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className="dark flex w-96 shrink-0 flex-col border-l border-white/10 bg-zinc-950">
|
<aside className="dark flex max-w-60 shrink-0 flex-col border-l border-white/10 bg-zinc-950">
|
||||||
<div className="flex shrink-0 items-center gap-2 border-b border-white/10 px-4 py-3">
|
<div className="flex shrink-0 items-center gap-2 border-b border-white/10 px-4 py-3">
|
||||||
<List className="size-3.5 text-white/40" />
|
<List className="size-3.5 text-white/40" />
|
||||||
<span className="truncate text-sm font-medium text-white/90">
|
<span className="truncate text-sm font-medium text-white/90 mr-auto">
|
||||||
{streamName}
|
{items.length} messages
|
||||||
</span>
|
</span>
|
||||||
<span className="ml-auto text-xs text-white/40">{items.length}</span>
|
|
||||||
<KeyHint
|
<KeyHint
|
||||||
keys="L"
|
keys="L"
|
||||||
onClick={onToggle}
|
onClick={onToggle}
|
||||||
@@ -144,7 +143,7 @@ function ChatRowContent({ particle }: { particle: Particle }) {
|
|||||||
switch (particle.type) {
|
switch (particle.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
return (
|
return (
|
||||||
<p className="line-clamp-3 text-xs leading-relaxed whitespace-pre-line text-white/70">
|
<p className="line-clamp-2 text-xs leading-relaxed whitespace-pre-line text-white/70">
|
||||||
{particle.properties.content}
|
{particle.properties.content}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,20 +14,11 @@ function decideMode(
|
|||||||
return caughtUp ? 'list' : 'player';
|
return caughtUp ? 'list' : 'player';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Which mode a stream opens in: the player (autoplay catch-up) when there's
|
|
||||||
* unseen content, the browsable list when the user is fully caught up.
|
|
||||||
* Decided once on entry from the playback marker vs. the stream's last
|
|
||||||
* activity — browsing afterwards advances the marker, but the mode only
|
|
||||||
* changes via the user's toggle.
|
|
||||||
*/
|
|
||||||
export function useStreamViewMode(
|
export function useStreamViewMode(
|
||||||
streamParticle: Particle & { type: 'stream' },
|
streamParticle: Particle & { type: 'stream' },
|
||||||
userId: string | undefined,
|
userId: string | undefined,
|
||||||
): { mode: StreamViewMode; toggle: () => void } {
|
): { mode: StreamViewMode; toggle: () => void } {
|
||||||
const [mode, setMode] = useState<StreamViewMode>(() =>
|
const [mode, setMode] = useState<StreamViewMode>('player');
|
||||||
decideMode(streamParticle, userId),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Re-decide when navigating between streams without an unmount.
|
// Re-decide when navigating between streams without an unmount.
|
||||||
const [prevStreamId, setPrevStreamId] = useState(streamParticle.id);
|
const [prevStreamId, setPrevStreamId] = useState(streamParticle.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user
⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
🌐 Web query:
Tailwind CSS v4 important modifier syntax arbitrary variants💡 Result:
In Tailwind CSS v4, the syntax and handling for important modifiers and arbitrary variants have been updated to align with standard CSS conventions and a CSS-first configuration approach. Important Modifier Syntax In Tailwind v4, the important modifier (!) is placed at the end of the utility class, mirroring native CSS where!important follows the declaration [1][2][3]. - Example: Instead of!text-blue-500 (v3 style), use text-blue-500! [4][2][3]. - This applies to utilities in HTML as well as those used within
@applydirectives in CSS [5][3]. - Global important: To apply!important to all utility classes globally, add the important keyword to the Tailwind import statement in your CSS:@import"tailwindcss" important; [6][7]. You can also wrap all utilities in a custom selector by specifying it, for example:@import"tailwindcss" important(#app); [6]. Arbitrary Variants Arbitrary variants allow for on-the-fly selector modification directly in your HTML using square bracket notation, similar to arbitrary values [8][9]. - Syntax: They are written as [selector], where the ampersand (&) represents the current element [10]. - Example: [@custom-variantdirective in CSS, which allows you to define reusable variant selectors without requiring JavaScript plugins [11][12]. Top Results: [4][6][2][8][3]Citations:
Fix Tailwind v4 important modifier placement in
scroll-area.tsx.In Tailwind v4,
!must come after the utility (even inside arbitrary variants), so[&>div]:w-full!instead of[&>div]:!w-full.🔧 Proposed fix
🤖 Prompt for AI Agents