mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
fix(coach): scroll the Coach with the same scrollbar as every other surface
This commit is contained in:
1 parent
950395da42
commit
6ff24cf2cf
5 files changed
-33
No files matched your search
@@ -17,7 +17,6 @@ import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PageHeader } from "@/components/ui/page-header";
|
||||
import { QueryErrorCard } from "@/components/ui/query-error-card";
|
||||
import { COACH_SCROLLBAR } from "@/components/insights/coach-panel/message-thread";
|
||||
import { ConversationRename } from "@/components/insights/coach-panel/conversation-rename";
|
||||
import { ConversationTranscript } from "@/components/insights/coach-panel/conversation-transcript";
|
||||
import {
|
||||
@@ -170,7 +169,6 @@ function CoachConversationsBody({ readOnly }: { readOnly: boolean }) {
|
||||
data-slot="coach-conversations-list"
|
||||
className={cn(
|
||||
"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-1",
|
||||
COACH_SCROLLBAR,
|
||||
)}
|
||||
>
|
||||
{isLoading && visible.length === 0 ? (
|
||||
|
||||
@@ -17,7 +17,6 @@ import { PageHeader } from "@/components/ui/page-header";
|
||||
import { QueryErrorCard } from "@/components/ui/query-error-card";
|
||||
import { EmptyState } from "@/components/ui/empty-state";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { COACH_SCROLLBAR } from "@/components/insights/coach-panel/message-thread";
|
||||
import {
|
||||
useCoachPlans,
|
||||
useCoachPlanMutations,
|
||||
@@ -238,7 +237,6 @@ function CoachPlansBody({ readOnly }: { readOnly: boolean }) {
|
||||
data-slot="coach-plans-list"
|
||||
className={cn(
|
||||
"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-1",
|
||||
COACH_SCROLLBAR,
|
||||
)}
|
||||
>
|
||||
{query.isError ? (
|
||||
|
||||
@@ -383,7 +383,6 @@ export function CoachInput({
|
||||
"order-1 w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed outline-none sm:pointer-fine:text-sm",
|
||||
"px-2 py-1.5",
|
||||
"max-h-[9.5rem] overflow-auto",
|
||||
"[scrollbar-width:thin] [scrollbar-color:color-mix(in_srgb,var(--primary)_35%,transparent)_transparent]",
|
||||
"placeholder:text-muted-foreground aria-disabled:opacity-60",
|
||||
"placeholder:overflow-hidden placeholder:text-ellipsis placeholder:whitespace-nowrap",
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,6 @@ import { useLoadMoreSentinel } from "@/hooks/use-load-more-sentinel";
|
||||
import type { CoachConversationDTO } from "@/lib/ai/coach/types";
|
||||
import { groupConversationsByRecency } from "@/lib/insights/coach-conversation-groups";
|
||||
|
||||
import { COACH_SCROLLBAR } from "./message-thread";
|
||||
import { ConversationRename } from "./conversation-rename";
|
||||
import {
|
||||
useCoachConversationHistory,
|
||||
@@ -153,7 +152,6 @@ export function HistoryRail({
|
||||
// `pb-20` keeps the last row clear of the panel's floating New
|
||||
// chat button; it pads this list's own scroll area, not `main`.
|
||||
"-mx-1 flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto overscroll-contain px-1 pb-20",
|
||||
COACH_SCROLLBAR,
|
||||
)}
|
||||
>
|
||||
{isLoading && visible.length === 0 ? (
|
||||
|
||||
@@ -365,28 +365,6 @@ export function placeInterleaved(
|
||||
return { before, beforeOptimistic, tail };
|
||||
}
|
||||
|
||||
/**
|
||||
* v1.18.7 — shared thin/rounded/subtle scrollbar styling for the Coach
|
||||
* scroll regions (the message thread + the history list). Kept as a
|
||||
* Tailwind-arbitrary class string so the styling is component-scoped —
|
||||
* the parallel agent owns `globals.css` and we must not touch it.
|
||||
*
|
||||
* Firefox: `scrollbar-width: thin` + a tinted thumb on a transparent
|
||||
* track. WebKit: an 8 px overlay-style thumb with a fully rounded
|
||||
* radius and no arrow buttons, brightening on hover. The Dracula purple
|
||||
* is mixed down so the bar reads as a hairline accent, not a hard edge.
|
||||
*/
|
||||
export const COACH_SCROLLBAR = cn(
|
||||
"[scrollbar-color:color-mix(in_srgb,var(--primary)_30%,transparent)_transparent] [scrollbar-width:thin]",
|
||||
"[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar]:h-2",
|
||||
"[&::-webkit-scrollbar-track]:bg-transparent",
|
||||
"[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:size-0",
|
||||
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
||||
"[&::-webkit-scrollbar-thumb]:border-[3px] [&::-webkit-scrollbar-thumb]:border-transparent [&::-webkit-scrollbar-thumb]:bg-clip-content",
|
||||
"[&::-webkit-scrollbar-thumb]:bg-[color-mix(in_srgb,var(--primary)_30%,transparent)]",
|
||||
"hover:[&::-webkit-scrollbar-thumb]:bg-[color-mix(in_srgb,var(--primary)_45%,transparent)]",
|
||||
);
|
||||
|
||||
/**
|
||||
* The wrapper every assistant turn renders in, streaming or persisted, so a
|
||||
* turn keeps one element through the swap. While it streams it is the live
|
||||
@@ -686,10 +664,6 @@ export function MessageThread({
|
||||
// the cap only bites on the wide page surface.
|
||||
"[&>*]:mx-auto [&>*]:w-full [&>*]:max-w-2xl",
|
||||
"scroll-smooth",
|
||||
// v1.18.7 — thin, rounded, subtle scrollbar (WebKit + Firefox),
|
||||
// component-scoped via Tailwind arbitrary variants so globals.css
|
||||
// stays untouched. Replaces the default boxy/angular track.
|
||||
COACH_SCROLLBAR,
|
||||
)}
|
||||
>
|
||||
{[
|
||||
|
||||
Reference in new issue
Block a user