Skip to content

Commit cb5933e

Browse files
authored
fix(app): restore composer action labels (anomalyco#1068)
* fix(app): restore composer action labels * fix(app): truncate composer model label on mobile
1 parent f240f04 commit cb5933e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎apps/app/src/app/components/session/composer.tsx‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ export default function Composer(props: ComposerProps) {
486486
const [variantMenuOpen, setVariantMenuOpen] = createSignal(false);
487487
const [showInboxUploadAction, setShowInboxUploadAction] = createSignal(false);
488488
const activeVariant = createMemo(() => props.modelVariant ?? "none");
489+
const compactModelLabel = createMemo(() =>
490+
props.selectedModelLabel.length > 20 ? `${props.selectedModelLabel.slice(0, 20)}...` : props.selectedModelLabel,
491+
);
489492
const attachmentsDisabled = createMemo(() => !props.attachmentsEnabled);
490493
const hasDraftContent = createMemo(() => draftText().trim().length > 0 || attachments().length > 0);
491494

@@ -1919,7 +1922,8 @@ export default function Composer(props: ComposerProps) {
19191922
onClick={props.onModelClick}
19201923
disabled={props.busy}
19211924
>
1922-
<span>{props.selectedModelLabel}</span>
1925+
<span class="md:hidden">{compactModelLabel()}</span>
1926+
<span class="hidden md:inline">{props.selectedModelLabel}</span>
19231927
<ChevronDown size={14} class="shrink-0" />
19241928
</button>
19251929
<div class="relative hidden md:block" ref={(el) => (variantPickerRef = el)}>
@@ -1973,23 +1977,25 @@ export default function Composer(props: ComposerProps) {
19731977
type="button"
19741978
disabled={!hasDraftContent()}
19751979
onClick={sendDraft}
1976-
class={`inline-flex items-center gap-2 rounded-full p-1.5 text-[13px] font-medium transition-colors ${!hasDraftContent()
1980+
class={`inline-flex items-center gap-2 rounded-full px-4 py-2.5 text-[13px] font-medium transition-colors ${!hasDraftContent()
19771981
? "bg-gray-4 text-gray-10"
19781982
: "bg-dls-accent text-white hover:bg-[var(--dls-accent-hover)]"
19791983
}`}
19801984
title="Run task"
19811985
>
19821986
<ArrowUp size={16} />
1987+
<span>Run task</span>
19831988
</button>
19841989
}
19851990
>
19861991
<button
19871992
type="button"
19881993
onClick={() => props.onStop()}
1989-
class="inline-flex items-center gap-2 rounded-full bg-gray-12 p-1.5 text-[13px] font-medium text-gray-1 transition-colors hover:bg-gray-11"
1994+
class="inline-flex items-center gap-2 rounded-full bg-gray-12 px-4 py-2.5 text-[13px] font-medium text-gray-1 transition-colors hover:bg-gray-11"
19901995
title="Stop"
19911996
>
19921997
<Square size={13} fill="currentColor" />
1998+
<span>Stop</span>
19931999
</button>
19942000
</Show>
19952001
</div>

0 commit comments

Comments
 (0)