Skip to content

Commit 77e7b36

Browse files
Restore chat timeline minimap behavior
- Expand composer and toolbar to the shared 3xl width - Reduce the minimap gutter and show it only on fine pointers - Keep minimap focus from sticking after selection
1 parent 7f42657 commit 77e7b36

7 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎apps/web/src/components/BranchToolbar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export const BranchToolbar = memo(function BranchToolbar({
239239
if (!hasActiveThread || !activeProject) return null;
240240

241241
return (
242-
<div className="mx-auto flex w-full max-w-208 items-center gap-2 px-2.5 pb-3 pt-1 sm:px-3">
242+
<div className="mx-auto flex w-full max-w-3xl items-center gap-2 px-2.5 pb-3 pt-1 sm:px-3">
243243
{isMobile ? (
244244
<MobileRunContextSelector
245245
envLocked={envLocked}

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5133,7 +5133,7 @@ function ChatViewContent(props: ChatViewProps) {
51335133
aria-hidden="true"
51345134
className="chat-composer-horizontal-inset pointer-events-none absolute inset-x-0 top-1.5 bottom-0 z-0 sm:top-2"
51355135
>
5136-
<div className="relative mx-auto h-full w-full max-w-208 overflow-clip rounded-t-[20px]">
5136+
<div className="relative mx-auto h-full w-full max-w-3xl overflow-clip rounded-t-[20px]">
51375137
<div className="chat-composer-shared-blur absolute -inset-8" />
51385138
</div>
51395139
</div>

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
20442044
<form
20452045
ref={composerFormRef}
20462046
onSubmit={submitComposer}
2047-
className="mx-auto w-full min-w-0 max-w-208"
2047+
className="mx-auto w-full min-w-0 max-w-3xl"
20482048
data-chat-composer-form="true"
20492049
>
20502050
<div

‎apps/web/src/components/chat/ComposerBannerStack.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function ComposerBannerStack({ className, items }: ComposerBannerStackPro
8282
};
8383

8484
return (
85-
<div className={cn("group/banner-stack mx-auto mb-2 max-w-208", className)}>
85+
<div className={cn("group/banner-stack mx-auto mb-2 max-w-3xl", className)}>
8686
<div
8787
className={cn(
8888
"relative",

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const TIMELINE_MINIMAP_ITEM_SPACING = 8;
1414
export const TIMELINE_MINIMAP_MIN_ITEMS = 2;
1515
export const TIMELINE_MINIMAP_MAX_HEIGHT_CSS = "calc(100vh - 18rem)";
1616
export const TIMELINE_CONTENT_MAX_WIDTH = 768;
17-
export const TIMELINE_MINIMAP_PERSISTENT_GUTTER = 72;
17+
export const TIMELINE_MINIMAP_PERSISTENT_GUTTER = 48;
1818

1919
export interface TimelineEndState {
2020
readonly isAtEnd?: boolean;

‎apps/web/src/components/chat/MessagesTimeline.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ describe("MessagesTimeline", () => {
252252
}),
253253
).toBe(100);
254254
expect(resolveTimelineMinimapHasPersistentGutter(832)).toBe(false);
255-
expect(resolveTimelineMinimapHasPersistentGutter(911)).toBe(false);
256-
expect(resolveTimelineMinimapHasPersistentGutter(912)).toBe(true);
255+
expect(resolveTimelineMinimapHasPersistentGutter(863)).toBe(false);
256+
expect(resolveTimelineMinimapHasPersistentGutter(864)).toBe(true);
257257
});
258258

259259
it("anchors a sent attachment message using its measured height", async () => {

‎apps/web/src/components/chat/MessagesTimeline.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ function TimelineMinimap({
671671
return (
672672
<div
673673
className={cn(
674-
"group/minimap pointer-events-auto absolute top-0 left-0 z-40 hidden w-18 md:block",
674+
"group/minimap pointer-events-auto absolute top-0 left-0 z-40 hidden w-18 [@media(pointer:fine)]:block",
675675
hasPersistentGutter
676676
? "opacity-100"
677677
: "opacity-0 transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100",
@@ -691,6 +691,7 @@ function TimelineMinimap({
691691
if (nextItem) {
692692
onSelect(nextItem);
693693
}
694+
event.currentTarget.blur();
694695
}}
695696
onFocus={() => setActiveIndex((current) => current ?? 0)}
696697
onKeyDown={(event) => {
@@ -715,6 +716,9 @@ function TimelineMinimap({
715716
}}
716717
onMouseLeave={() => setActiveIndex(null)}
717718
onMouseMove={updateActiveIndexFromPointer}
719+
onMouseDown={(event) => {
720+
event.preventDefault();
721+
}}
718722
style={{ height: resolveTimelineMinimapHeightStyle(items.length) }}
719723
type="button"
720724
>

0 commit comments

Comments
 (0)