mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 10:48:20 +01:00
fix(thoughts): mobile scroll affordance for tag filter row
Fifth horizontal-scroll surface to get the treatment, but the first
one to use the extracted <ScrollAffordance> primitive (0429728)
instead of re-inlining the relative+chevron+fade pattern. Live audit
at 414px on cockpitapp.vercel.app/thoughts caught the tag filter row
("All / agents / ai / architecture / automation / a…") cut off mid-
word with neither a chevron nor a fade mask.
Also missing ui-scroll-fade-right (every other scroll surface had it
even before the chevron landed); added for consistency with the
other four sites.
Net: 5 of 5 horizontal-scroll surfaces now have the same affordance
treatment, and the most recent one shows the extracted primitive
paying for itself — single-line wrap, no copy-paste.
This commit is contained in:
1 file changed
+23
-16
@@ -3,6 +3,7 @@
|
||||
import Link from "next/link";
|
||||
import { useMemo, useState } from "react";
|
||||
import { Search, BookOpen } from "lucide-react";
|
||||
import { ScrollAffordance } from "@/components/ui/scroll-affordance";
|
||||
import type { ThoughtMeta } from "@/lib/thoughts-content";
|
||||
|
||||
type ThoughtArticle = ThoughtMeta & { body: string };
|
||||
@@ -84,26 +85,32 @@ export function ThoughtsLibrary({
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Single scrollable row — no wrapping */}
|
||||
<div className="flex gap-2 overflow-x-auto pb-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTag("all")}
|
||||
className={`shrink-0 ${activeTag === "all" ? "ui-chip-filter-active" : "ui-chip-filter"}`}
|
||||
>
|
||||
All
|
||||
</button>
|
||||
{tags.map((tag) => (
|
||||
{/* Single scrollable row — no wrapping. Fifth horizontal-scroll
|
||||
surface in the codebase; uses the extracted ScrollAffordance
|
||||
(0429728) for the mobile chevron + fade rather than re-inlining
|
||||
the pattern. Adds ui-scroll-fade-right that was previously
|
||||
missing here too. */}
|
||||
<ScrollAffordance childCount={tags.length + 1} threshold={4}>
|
||||
<div className="flex gap-2 overflow-x-auto ui-scroll-fade-right pb-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden">
|
||||
<button
|
||||
key={tag}
|
||||
type="button"
|
||||
onClick={() => setActiveTag(tag)}
|
||||
className={`shrink-0 ${activeTag === tag ? "ui-chip-filter-active" : "ui-chip-filter"}`}
|
||||
onClick={() => setActiveTag("all")}
|
||||
className={`shrink-0 ${activeTag === "all" ? "ui-chip-filter-active" : "ui-chip-filter"}`}
|
||||
>
|
||||
{tag}
|
||||
All
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{tags.map((tag) => (
|
||||
<button
|
||||
key={tag}
|
||||
type="button"
|
||||
onClick={() => setActiveTag(tag)}
|
||||
className={`shrink-0 ${activeTag === tag ? "ui-chip-filter-active" : "ui-chip-filter"}`}
|
||||
>
|
||||
{tag}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</ScrollAffordance>
|
||||
</div>
|
||||
|
||||
{filtered.length === 0 ? (
|
||||
|
||||
Reference in new issue
Block a user