Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/app/src/components/pickers/ModelReasoningPicker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function renderPicker({
modelLoadError = null,
compact = false,
splitPane = false,
muted = false,
}: {
onSelectedProviderChange?: ((value: string) => void) | null;
onModelChange?: (value: string) => void;
Expand All @@ -176,6 +177,7 @@ function renderPicker({
modelLoadError?: SystemExecutionOptionsModelLoadError | null;
compact?: boolean;
splitPane?: boolean;
muted?: boolean;
} = {}) {
const { queryClient, wrapper } = createQueryClientTestHarness();
queryClient.setQueryData(
Expand Down Expand Up @@ -215,6 +217,7 @@ function renderPicker({
fastModeEnabled={false}
onFastModeChange={vi.fn()}
showFastModeToggle={false}
muted={muted}
modal={false}
/>
<button type="button">Composer action</button>
Expand Down Expand Up @@ -248,6 +251,17 @@ afterEach(() => {
});

describe("ModelReasoningPicker", () => {
it("uses the lower-emphasis chrome token for the composer caret", () => {
renderPicker({ muted: true });

const trigger = screen.getByRole("button", {
name: "Provider, model and reasoning",
});
expect(
trigger.querySelector('[data-icon="ChevronDown"]')?.classList,
).toContain("text-subtle-foreground/75");
});

it("gives a non-SVG provider mark the same 16px trigger size as button SVGs", () => {
renderPicker({
pickerProviderOptions: [
Expand Down
5 changes: 4 additions & 1 deletion apps/app/src/components/pickers/ModelReasoningPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,10 @@ export function ModelReasoningPicker({
{disabled ? null : (
<Icon
name="ChevronDown"
className="size-3.5 shrink-0 text-muted-foreground"
className={cn(
"size-3.5 shrink-0",
muted ? "text-subtle-foreground/75" : "text-muted-foreground",
)}
/>
)}
<AppCommandShortcutHint
Expand Down
12 changes: 9 additions & 3 deletions apps/app/src/components/promptbox/FollowUpPromptBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ import {
getFollowUpPromptPlaceholder,
getCompactFollowUpPromptPlaceholder,
} from "@/components/promptbox/follow-up-placeholder";
import {
getEnvironmentWorkspaceSummaryDisplay,
} from "@/lib/environment-workspace-display";
import { getEnvironmentWorkspaceSummaryDisplay } from "@/lib/environment-workspace-display";
import {
INERT_TYPEAHEAD_COMMAND_CONFIG,
type AttachmentsConfig,
Expand Down Expand Up @@ -848,6 +846,14 @@ function StackedCardsWithPillsRow() {
);
}

export function ControlEmphasis() {
return (
<div className="mx-auto flex min-h-[28rem] w-full max-w-3xl items-end p-4">
<Row submitMode={{ kind: "ready" }} />
</div>
);
}

export function Overview() {
return (
<StoryCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ describe("PromptBoxActionsMenu", () => {
const onAttach = vi.fn();
render(<PromptBoxActionsMenu onAction={() => {}} onAttach={onAttach} />);

fireEvent.pointerDown(
screen.getByRole("button", { name: "Prompt actions" }),
{ button: 0 },
);
const trigger = screen.getByRole("button", { name: "Prompt actions" });
expect(trigger.classList).toContain("text-subtle-foreground/75");
fireEvent.pointerDown(trigger, { button: 0 });
fireEvent.click(
await screen.findByRole("menuitem", { name: "Attach files" }),
);
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/components/promptbox/PromptBoxActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useResolvedComposerPlusMenuItems } from "@/components/plugin/composer-s
import { useOptionalPluginComposerView } from "@/components/plugin/plugin-composer-host";
import { Icon, type IconName } from "@bb/shared-ui/icon";
import { COARSE_POINTER_PROMPT_ICON_ACTION_BUTTON_CLASS } from "@bb/shared-ui/coarse-pointer-sizing";
import { CHROME_SUBTLE_ICON_BUTTON_FOREGROUND_CLASS } from "@bb/shared-ui/chrome-style-tokens";
import { CREATE_PLUGIN_PROMPT } from "@bb/client-core";
import type { ProviderPromptActionCommand } from "@bb/client-core";

Expand Down Expand Up @@ -181,6 +182,7 @@ export function PromptBoxActionsMenu({
aria-label="Prompt actions"
className={cn(
COARSE_POINTER_PROMPT_ICON_ACTION_BUTTON_CLASS,
CHROME_SUBTLE_ICON_BUTTON_FOREGROUND_CLASS,
"-ml-1.5",
)}
>
Expand Down
8 changes: 5 additions & 3 deletions apps/app/src/components/promptbox/PromptBoxInternal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,11 @@ describe("PromptBoxInternal size controls", () => {
expect(
screen.queryByRole("button", { name: /Make prompt box/u }),
).toBeNull();
fireEvent.click(
screen.getByRole("button", { name: "Collapse prompt box" }),
);
const collapseButton = screen.getByRole("button", {
name: "Collapse prompt box",
});
expect(collapseButton.classList).toContain("text-subtle-foreground/75");
fireEvent.click(collapseButton);

expect(onCollapse).toHaveBeenCalledOnce();
expect(document.activeElement).not.toBe(getPromptEditorElement());
Expand Down
3 changes: 2 additions & 1 deletion apps/app/src/components/promptbox/PromptBoxInternal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {
COARSE_POINTER_PROMPT_ACTION_BUTTON_CLASS,
COARSE_POINTER_PROMPT_ICON_ACTION_BUTTON_CLASS,
} from "@bb/shared-ui/coarse-pointer-sizing";
import { CHROME_SUBTLE_ICON_BUTTON_FOREGROUND_CLASS } from "@bb/shared-ui/chrome-style-tokens";
import { usePointerCoarse } from "@bb/shared-ui/hooks/use-pointer-coarse";
import {
getMediaQuerySnapshot,
Expand Down Expand Up @@ -3030,7 +3031,7 @@ export function PromptBoxInternal({
onClick={collapsePromptBox}
aria-label="Collapse prompt box"
className={cn(
"text-subtle-foreground hover:text-muted-foreground",
CHROME_SUBTLE_ICON_BUTTON_FOREGROUND_CLASS,
COARSE_POINTER_PROMPT_ICON_ACTION_BUTTON_CLASS,
)}
>
Expand Down
Loading