GeezerVison is showing github.com — fix(web): separate the sidebar handle and timeline minimap · pingdotgg/t3code@644cf64
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/ChatView.tsx +14-1Lines changed: 14 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,7 +109,15 @@ import { resolveProjectSettings } from "@t3tools/shared/projectSettings"; | 109 | 109 | import { resolveThreadReferenceCopyTarget } from "@t3tools/client-runtime/thread-reference"; | 110 | 110 | import { resolveTerminalSessionLabel } from "@t3tools/shared/terminalLabels"; | 111 | 111 | import { useAtomValue } from "@effect/atom-react"; | 112 | | -import { type SetStateAction, use, useEffect, useLayoutEffect, useRef, useState } from "react"; | | 112 | +import { | | 113 | + type CSSProperties, | | 114 | + type SetStateAction, | | 115 | + use, | | 116 | + useEffect, | | 117 | + useLayoutEffect, | | 118 | + useRef, | | 119 | + useState, | | 120 | +} from "react"; | 113 | 121 | import { BackgroundThreadContext } from "./chat/backgroundThread"; | 114 | 122 | import { useLocation, useNavigate } from "@tanstack/react-router"; | 115 | 123 | import { assistantCitationFromLocation } from "../lib/assistantCitationNavigation"; | @@ -3298,6 +3306,11 @@ export default function ChatView(props: ChatViewProps) { | 3298 | 3306 | )} | 3299 | 3307 | data-chat-column-maximized-away={rightPanelMaximized ? "true" : "false"} | 3300 | 3308 | data-chat-column | | 3309 | + style={ | | 3310 | + { | | 3311 | + "--chat-header-height": embedded ? "0px" : "var(--workspace-topbar-height)", | | 3312 | + } as CSSProperties | | 3313 | + } | 3301 | 3314 | inert={rightPanelMaximized} | 3302 | 3315 | > | 3303 | 3316 | {embedded ? null : ( | |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.logic.test.ts +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,10 +30,25 @@ import { | 30 | 30 | deriveMessagesTimelineRowsWithState, | 31 | 31 | shouldCollapseUserMessage, | 32 | 32 | resolveAssistantMessageCopyState, | | 33 | + resolveTimelineMinimapHitStripWidth, | 33 | 34 | type MessagesTimelineRow, | 34 | 35 | workEntryDisplayLabel, | 35 | 36 | } from "./MessagesTimeline.logic"; | 36 | 37 |
| | 38 | +describe("resolveTimelineMinimapHitStripWidth", () => { | | 39 | + it.each([ | | 40 | + { viewport: 1280, content: 768, expected: 40 }, | | 41 | + { viewport: 768, content: 672, expected: 16 }, | | 42 | + { viewport: 768, content: 704, expected: 0 }, | | 43 | + { viewport: 768, content: 720, expected: 0 }, | | 44 | + ])( | | 45 | + "keeps the minimap inside the gutter at $viewport/$content", | | 46 | + ({ viewport, content, expected }) => { | | 47 | + expect(resolveTimelineMinimapHitStripWidth(viewport, content)).toBe(expected); | | 48 | + }, | | 49 | + ); | | 50 | +}); | | 51 | + | 37 | 52 | describe("resolveAssistantMessageCopyState", () => { | 38 | 53 | it("copies the rendered representation of Codex directives", () => { | 39 | 54 | expect( | |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/chat/MessagesTimeline.logic.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -438,7 +438,7 @@ export function resolveTimelineMinimapHasPersistentGutter( | 438 | 438 | ); | 439 | 439 | } | 440 | 440 |
| 441 | | -const TIMELINE_MINIMAP_HIT_STRIP_LEFT = 12; | | 441 | +const TIMELINE_MINIMAP_HIT_STRIP_LEFT = 32; | 442 | 442 | const TIMELINE_MINIMAP_HIT_STRIP_MAX_WIDTH = 40; | 443 | 443 | const TIMELINE_MINIMAP_EXPANDED_HIT_STRIP_WIDTH = "22rem"; | 444 | 444 |
| |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/chat/TimelineMinimap.tsx +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -115,7 +115,7 @@ export function TimelineMinimap({ | 115 | 115 | return ( | 116 | 116 | <div | 117 | 117 | className={cn( | 118 | | - "group/minimap pointer-events-none absolute inset-y-0 left-0 z-40 hidden w-18 [@media(pointer:fine)]:block", | | 118 | + "group/minimap pointer-events-none absolute bottom-0 left-0 top-[calc(-1*var(--chat-header-height,0px))] z-40 hidden w-18 [@media(pointer:fine)]:block", | 119 | 119 | hasPersistentGutter | 120 | 120 | ? "opacity-100" | 121 | 121 | : "opacity-0 transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100", | @@ -127,7 +127,7 @@ export function TimelineMinimap({ | 127 | 127 | <div className="relative h-full w-full select-none"> | 128 | 128 | <div | 129 | 129 | className={cn( | 130 | | - "absolute top-1/2 left-3 -translate-y-1/2", | | 130 | + "absolute top-1/2 left-8 -translate-y-1/2", | 131 | 131 | hitStripWidth > 0 && !passThrough ? "pointer-events-auto" : "pointer-events-none", | 132 | 132 | )} | 133 | 133 | onMouseDown={() => { | |
|