Skip to content

Commit 6aa5498

Browse files
committed
revert(web): restore previous composer banners
1 parent 1f8ed54 commit 6aa5498

33 files changed

Lines changed: 2094 additions & 1506 deletions

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
MenuTrigger,
4141
} from "./ui/menu";
4242
import { Separator } from "./ui/separator";
43-
import { ComposerSurface } from "./chat/ComposerSurface";
4443

4544
interface BranchToolbarProps {
4645
environmentId: EnvironmentId;
@@ -467,9 +466,10 @@ export const BranchToolbar = memo(function BranchToolbar({
467466
if (!hasActiveThread || !activeProject) return null;
468467

469468
return (
470-
<ComposerSurface.ContextStrip
469+
<div
471470
ref={setStripElement}
472471
data-compact={labelsOverflow ? "" : undefined}
472+
className="chat-composer-context-strip group/composer-context -mt-4 mx-auto flex w-[calc(100%-2.75rem)] max-w-[calc(48rem-2.75rem)] items-center gap-2 overflow-x-clip overflow-y-visible ps-1 pe-2 pt-5 pb-1"
473473
>
474474
{isMobile && showGitControls ? (
475475
<MobileRunContextSelector
@@ -534,6 +534,6 @@ export const BranchToolbar = memo(function BranchToolbar({
534534
{...(onComposerFocusRequest ? { onComposerFocusRequest } : {})}
535535
/>
536536
) : null}
537-
</ComposerSurface.ContextStrip>
537+
</div>
538538
);
539539
});

‎apps/web/src/components/ChatView.logic.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
resolveSendEnvMode,
3333
resolveDraftHeroState,
3434
scheduleEnvironmentReconnectWarning,
35+
shoulderTabReserve,
3536
startNewThreadForProject,
3637
shouldDockDraftHeroForSubmission,
3738
shouldReleaseTimelineAnchorForToolActivity,
@@ -45,6 +46,24 @@ const projectId = ProjectId.make("project-1");
4546
const threadId = ThreadId.make("thread-1");
4647
const now = "2026-03-29T00:00:00.000Z";
4748

49+
describe("shoulderTabReserve", () => {
50+
it("ignores the top drawer when measuring the shoulder tab band", () => {
51+
const elementAt = (top: number) => ({ getBoundingClientRect: () => ({ top }) }) as HTMLElement;
52+
const elements = new Map<string, HTMLElement>([
53+
['[data-chat-composer-form="true"]', elementAt(20)],
54+
[".chat-composer-shoulder-tab", elementAt(100)],
55+
['[data-chat-composer-main-surface="true"]', elementAt(128)],
56+
]);
57+
const overlay = {
58+
querySelector: (selector: string) => elements.get(selector) ?? null,
59+
} as HTMLElement;
60+
61+
expect(shoulderTabReserve(overlay)).toBe(28);
62+
elements.set(".chat-composer-tasks-tab", elementAt(100));
63+
expect(shoulderTabReserve(overlay)).toBe(0);
64+
});
65+
});
66+
4867
describe("draft hero submission transition", () => {
4968
it("does not dock the composer before a background submission", () => {
5069
expect(

‎apps/web/src/components/ChatView.logic.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ export const ENVIRONMENT_RECONNECT_WARNING_GRACE_MS = 2_000;
3939

4040
export const LastInvokedScriptByProjectSchema = Schema.Record(ProjectId, Schema.String);
4141

42+
export function shoulderTabReserve(overlay: HTMLElement): number {
43+
if (overlay.querySelector(".chat-composer-tasks-tab")) return 0;
44+
const tab = overlay.querySelector<HTMLElement>(".chat-composer-shoulder-tab");
45+
const surface = overlay.querySelector<HTMLElement>('[data-chat-composer-main-surface="true"]');
46+
if (!tab || !surface) return 0;
47+
return Math.max(
48+
0,
49+
Math.round(surface.getBoundingClientRect().top - tab.getBoundingClientRect().top),
50+
);
51+
}
52+
4253
export function shouldDockDraftHeroForSubmission(input: {
4354
isDraftHeroState: boolean;
4455
activeThreadKey: string | null;

0 commit comments

Comments
 (0)