Skip to content

Commit 11c6ed1

Browse files
chore(mobile): merge main and preserve web banner behavior
2 parents 0eafc2f + 2daff8c commit 11c6ed1

44 files changed

Lines changed: 2243 additions & 1799 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/web/src/appearanceFonts.test.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import {
55
clampCodeFontSize,
66
clampInterfaceFontSize,
77
clampPromptFontSize,
8-
DEFAULT_CODE_FONT_STACK,
9-
DEFAULT_SANS_FONT_STACK,
10-
appearanceFontStack,
118
cssFontFamilies,
129
resolveDefaultFamilyLabel,
1310
resolveTerminalFontPreference,
@@ -58,18 +55,6 @@ describe("resolveDefaultFamilyLabel", () => {
5855
});
5956
});
6057

61-
describe("appearanceFontStack", () => {
62-
it("prepends the custom family to the default stack", () => {
63-
expect(appearanceFontStack("Fira Code", DEFAULT_CODE_FONT_STACK)).toBe(
64-
`"Fira Code", ${DEFAULT_CODE_FONT_STACK}`,
65-
);
66-
});
67-
68-
it("falls back to the default stack when unset", () => {
69-
expect(appearanceFontStack("", DEFAULT_SANS_FONT_STACK)).toBe(DEFAULT_SANS_FONT_STACK);
70-
});
71-
});
72-
7358
describe("resolveTerminalFontPreference", () => {
7459
it("inherits the code font in simple mode", () => {
7560
expect(

‎apps/web/src/appearanceFonts.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ export function cssFontFamilies(input: string): string | null {
7171
return families.length > 0 ? families.join(", ") : null;
7272
}
7373

74-
/** The full stack a preference resolves to: custom families before the default. */
75-
export function appearanceFontStack(custom: string, defaultStack: string): string {
76-
const families = cssFontFamilies(custom);
77-
return families === null ? defaultStack : `${families}, ${defaultStack}`;
78-
}
79-
8074
export interface AppearanceFontPreferences {
8175
readonly sans: string;
8276
readonly code: string;

‎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)