Skip to content

Commit 4455a54

Browse files
authored
fix(chat): align composer controls and source presentation (#8274)
* fix(chat): align composer control shape and color * fix(chat): align source typography and improve favicon fidelity * fix(chat): keep source title tokens consistent * fix(chat): omit referrers from source favicon requests
1 parent 60d0e1c commit 4455a54

6 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎apps/sim/app/o/[organizationId]/home/components/composer/composer.test.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ it('shows Build with a chevron in the shared chip and text-only modes in its men
626626
mode.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
627627
)
628628
const search = [...document.querySelectorAll<HTMLElement>('[role="menuitem"]')].find(
629-
(item) => item.textContent === 'Ask'
629+
(item) => item.textContent === 'Search'
630630
)!
631631
expect(search.querySelector('svg')).toBeNull()
632632
expect(document.querySelector('[role="tooltip"]')).toBeNull()
@@ -730,12 +730,12 @@ it.each(['skill', 'file'] as const)(
730730
mode.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
731731
)
732732
const search = [...document.querySelectorAll<HTMLElement>('[role="menuitem"]')].find(
733-
(item) => item.textContent === 'Ask'
733+
(item) => item.textContent === 'Search'
734734
)!
735735
await act(async () => search.click())
736736
expect(onModeChange).not.toHaveBeenCalled()
737737
expect(info).toHaveBeenCalledWith(
738-
'Remove resource and skill mentions and non-image attachments before switching to Ask.'
738+
'Remove resource and skill mentions and non-image attachments before switching to Search.'
739739
)
740740
expect(
741741
container.querySelector<HTMLInputElement | HTMLTextAreaElement>('[aria-label="Ask Sim"]')!
@@ -787,7 +787,7 @@ describe('Search levels', () => {
787787
expect(
788788
row.querySelector<HTMLInputElement | HTMLTextAreaElement>('[aria-label="Ask Sim"]')
789789
).not.toBeNull()
790-
expect(mode.textContent).toBe('Ask')
790+
expect(mode.textContent).toBe('Search')
791791
expect(mode.querySelectorAll('svg')).toHaveLength(1)
792792
expect(mode.parentElement?.nextElementSibling).toBeNull()
793793
expect(row.querySelector('[aria-label="Search level"]')).toBeNull()

‎apps/sim/app/o/[organizationId]/home/components/composer/composer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export function Composer({
231231
files.attachedFiles.some((file) => !isAssistantImageType(file.type)))
232232
) {
233233
toast.info(
234-
'Remove resource and skill mentions and non-image attachments before switching to Ask.'
234+
'Remove resource and skill mentions and non-image attachments before switching to Search.'
235235
)
236236
return
237237
}

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/source-card/source-card.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { Check, Link as LinkIcon, MoreHorizontal, Sparkles } from '@sim/emcn/icons'
1919
import { formatDate } from '@sim/utils/formatting'
2020
import { findTermMatches, queryTerms } from '@/lib/knowledge/search/snippet'
21+
import { inter } from '@/app/_styles/fonts/inter/inter'
2122
import {
2223
SourceIcon,
2324
sourceLabel,
@@ -29,7 +30,8 @@ import type { SourceTagData } from '@/app/workspace/[workspaceId]/home/component
2930
const SOURCE_ROW_CLASSES = cn(
3031
'not-prose flex items-start gap-2 px-2 py-2 transition-colors focus-within:bg-[var(--surface-hover)]',
3132
chipHoverSurfaceClass,
32-
chipRadiusClass
33+
chipRadiusClass,
34+
inter.className
3335
)
3436
const SOURCE_ROW_MARK_CLASSES = cn(chipIconSlotClass, 'mt-0.5')
3537

@@ -140,7 +142,7 @@ export function SourceCard({ source, query, onSummarize, dense = false }: Source
140142
</a>
141143
<OverflowText
142144
label={meta.join(' · ')}
143-
className='max-w-[40%] shrink-0 text-[var(--text-muted)] text-caption'
145+
className='max-w-[40%] shrink-0 text-[var(--text-tertiary)] text-caption'
144146
/>
145147
<SourceActions source={source} />
146148
</div>
@@ -171,7 +173,7 @@ export function SourceCard({ source, query, onSummarize, dense = false }: Source
171173
<div className='flex min-w-0 flex-col gap-1 pl-6'>
172174
<OverflowText
173175
label={meta.join(' · ')}
174-
className='text-[var(--text-muted)] text-caption'
176+
className='text-[var(--text-tertiary)] text-caption'
175177
/>
176178
{source.snippet && (
177179
<p className='text-[var(--text-body)] text-small [overflow-wrap:anywhere]'>

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/source-chip/source-icon.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ export function SourceIcon({ source, size = 'default' }: SourceIconProps) {
3838
if (hostname && failedHostname !== hostname) {
3939
return (
4040
<img
41-
src={faviconUrl(hostname, 32)}
41+
src={faviconUrl(hostname, 64)}
4242
alt=''
43+
referrerPolicy='no-referrer'
4344
className={cn(className, 'rounded-sm')}
4445
onError={() => setFailedHostname(hostname)}
4546
/>

‎apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/conversation-mode-selector.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function ConversationModeSelector({
2020
const planEnabled = useFeatureFlag('mothership-plan-mode')
2121
const [open, setOpen] = useState(false)
2222
const options = [
23-
...(searchEnabled ? [{ value: 'assistant', label: 'Ask' }] : []),
23+
...(searchEnabled ? [{ value: 'assistant', label: 'Search' }] : []),
2424
{ value: 'agent', label: 'Build' },
2525
...(planEnabled ? [{ value: 'plan', label: 'Plan' }] : []),
2626
]

‎apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/model-setting-trigger.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ComponentType } from 'react'
2-
import { Chip, chipContentLabelClass, DropdownMenuTrigger, OverflowText, Tooltip } from '@sim/emcn'
2+
import { Chip, DropdownMenuTrigger, OverflowText, Tooltip } from '@sim/emcn'
33
import { ChevronDown } from '@sim/emcn/icons'
44

55
interface ModelSettingTriggerProps {
@@ -21,6 +21,7 @@ export function ModelSettingTrigger({
2121
<Tooltip.Trigger asChild>
2222
<DropdownMenuTrigger asChild>
2323
<Chip
24+
shape='round'
2425
aria-label={label}
2526
aria-description={valueLabel}
2627
leftAdornment={
@@ -29,7 +30,7 @@ export function ModelSettingTrigger({
2930
<span className='flex @max-[320px]/input-toolbar:hidden min-w-0 items-center gap-2'>
3031
<OverflowText
3132
label={valueLabel}
32-
className={chipContentLabelClass}
33+
className='text-[var(--text-icon)] text-sm'
3334
focusTarget='nearest-interactive'
3435
/>
3536
{showChevron && (

0 commit comments

Comments
 (0)