Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"]

[target.x86_64-linux-android]
rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"]
# BEGIN Mesh-LLM lld config
[target.aarch64-apple-darwin]
Comment thread
michaelneale marked this conversation as resolved.
Resolved
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/ld64.lld"]

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/ld64.lld"]
# END Mesh-LLM lld config
8 changes: 5 additions & 3 deletions crates/mesh-llm-ui/src/app/layout/RootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function RootLayout({ data = SHELL_HARNESS }: RootLayoutProps = {}) {
<>
<HeadContent />
<LiveStatusConnector />
<div className="min-h-screen">
<div className="flex h-dvh flex-col overflow-hidden">
<TopNav
enabledTabs={enabledTabs}
tab={activeTab === 'configuration' && !newConfigurationPageEnabled ? null : activeTab}
Expand Down Expand Up @@ -142,8 +142,10 @@ export function RootLayout({ data = SHELL_HARNESS }: RootLayoutProps = {}) {
/>
) : null}
<ChatSessionProvider>
<main className="density-shell mx-auto px-[var(--shell-pad-x)] pb-[var(--shell-pad-bottom)] pt-[var(--shell-pad-top)]">
<Outlet />
<main className="min-h-0 flex-1 overflow-y-auto">
<div className="density-shell mx-auto flex min-h-full flex-col px-[var(--shell-pad-x)] pb-[var(--shell-pad-bottom)] pt-[var(--shell-pad-top)]">
<Outlet />
</div>
</main>
</ChatSessionProvider>
<Footer
Expand Down
8 changes: 5 additions & 3 deletions crates/mesh-llm-ui/src/components/ui/InfoBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type InfoBannerProps = {
contentClassName?: string
descriptionClassName?: string
leadingIcon?: ReactNode
leadingIconClassName?: string
status?: ReactNode
titleId?: string
titleLevel?: 'h1' | 'h2' | 'h3'
Expand All @@ -25,6 +26,7 @@ export function InfoBanner({
contentClassName,
descriptionClassName,
leadingIcon,
leadingIconClassName,
status,
titleId,
titleLevel = 'h2'
Expand All @@ -35,15 +37,15 @@ export function InfoBanner({
<section
aria-labelledby={titleId}
className={cn(
'panel-shell flex items-center gap-4 rounded-[var(--radius-lg)] border border-border px-[19px] py-[15px]',
'panel-shell flex items-center gap-5 rounded-[var(--radius-lg)] border border-border px-5 py-4',
className
)}
style={{
background:
'linear-gradient(90deg, color-mix(in oklab, var(--color-accent) 10%, var(--color-panel)) 0%, var(--color-panel) 60%)'
}}
>
{leadingIcon ? <AccentIconFrame>{leadingIcon}</AccentIconFrame> : null}
{leadingIcon ? <AccentIconFrame className={leadingIconClassName}>{leadingIcon}</AccentIconFrame> : null}
<div className={cn('min-w-0 flex-1', contentClassName)}>
<div className="flex flex-wrap items-center gap-2">
<Heading
Expand All @@ -58,7 +60,7 @@ export function InfoBanner({
</Heading>
{status ? <div>{status}</div> : null}
</div>
<div className={cn('type-caption mt-1 text-fg-dim', descriptionClassName)}>{description}</div>
<div className={cn('type-caption mt-1.5 text-fg-dim', descriptionClassName)}>{description}</div>
</div>
{action ? (
<div className={cn('flex shrink-0 items-center justify-end self-center', actionClassName)}>{action}</div>
Expand Down
4 changes: 2 additions & 2 deletions crates/mesh-llm-ui/src/components/ui/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export function StatusBadge({ children, className, dot = false, size = 'label',
return (
<span
className={cn(
'inline-flex items-center gap-[5px] rounded-full px-2 py-px font-medium',
'inline-flex items-center gap-[5px] rounded-full px-2.5 py-0.5 font-medium',
sizeClass[size],
className
)}
style={statusBadgeStyle(tone)}
>
{dot ? <span className="size-[5px] rounded-full bg-current" /> : null}
{dot ? <span className="size-[6px] rounded-full bg-current" /> : null}
{children}
</span>
)
Expand Down
9 changes: 6 additions & 3 deletions crates/mesh-llm-ui/src/components/ui/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type TabPanelProps<TValue extends string = string> = {
iconClassName?: string
iconStrokeWidth?: number
listClassName?: string
stretchTabs?: boolean
tabBarAccessory?: ReactNode
tabBarClassName?: string
tabs: readonly TabPanelItem<TValue>[]
Expand Down Expand Up @@ -65,6 +66,7 @@ export function TabPanel<TValue extends string = string>({
iconClassName,
iconStrokeWidth = 1.6,
listClassName,
stretchTabs = false,
tabBarAccessory,
tabBarClassName,
tabs,
Expand Down Expand Up @@ -104,7 +106,7 @@ export function TabPanel<TValue extends string = string>({
<Tabs.List
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
className={cn('flex h-[56px] items-center gap-0 overflow-x-auto overflow-y-hidden', listClassName)}
className={cn('flex h-[56px] items-center gap-0 overflow-x-auto overflow-y-hidden', stretchTabs && 'w-full', listClassName)}
>
{tabs.map((item) => {
const active = currentValue === item.value
Expand All @@ -119,7 +121,8 @@ export function TabPanel<TValue extends string = string>({
const trigger = (
<Tabs.Trigger
className={cn(
'-mb-px inline-flex h-[44px] items-center gap-[7px] whitespace-nowrap border-b-2 px-[14px] text-[12.5px] font-medium leading-none tracking-[-0.05px] outline-none transition-[border-color,color] hover:text-fg-dim focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent disabled:cursor-not-allowed disabled:opacity-50',
'-mb-px inline-flex h-[44px] items-center gap-2 whitespace-nowrap border-b-2 px-[14px] text-[length:var(--density-type-control)] font-medium leading-none tracking-[-0.01em] outline-none transition-[border-color,color] hover:text-fg-dim focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent disabled:cursor-not-allowed disabled:opacity-50',
stretchTabs && 'flex-1 justify-center',
triggerClassName,
item.triggerClassName
)}
Expand All @@ -136,7 +139,7 @@ export function TabPanel<TValue extends string = string>({
) : Icon ? (
<Icon
aria-hidden={true}
className={cn('size-[13px] shrink-0', iconClassName, item.iconClassName)}
className={cn('size-[15px] shrink-0', iconClassName, item.iconClassName)}
strokeWidth={iconStrokeWidth}
/>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function AppHeader({

return (
<header className="shrink-0 border-b bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/80">
<div className="mx-auto flex h-14 w-full max-w-7xl items-center gap-2 px-3 md:h-16 md:gap-4 md:px-4">
<div className="mx-auto flex h-14 w-full max-w-screen-2xl items-center gap-2 px-3 md:h-16 md:gap-4 md:px-4">
<div className="flex min-w-0 items-center gap-0">
<div className="flex h-10 w-7 shrink-0 items-center justify-start">
<BrandIcon className="h-6 w-6 text-primary" />
Expand Down Expand Up @@ -457,7 +457,7 @@ export function AppHeader({
</div>
</div>
{statusError ? (
<div className="mx-auto w-full max-w-7xl px-4 pb-3">
<div className="mx-auto w-full max-w-screen-2xl px-4 pb-3">
<Alert variant="destructive">
<Loader2 className="h-4 w-4 animate-spin" />
<AlertTitle>Connection Interrupted</AlertTitle>
Expand Down
40 changes: 21 additions & 19 deletions crates/mesh-llm-ui/src/features/chat/components/ChatSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export function ChatSidebar({
label: 'Conversations',
icon: MessageSquare,
accessory: (
<span className="rounded-full border border-border-soft px-[5px] font-mono text-[length:var(--density-type-annotation)] text-fg-faint">
<span className="rounded-full border border-border-soft px-[5px] font-mono text-[length:var(--density-type-caption)] text-fg-faint">
{conversations.length}
</span>
),
Expand All @@ -291,29 +291,31 @@ export function ChatSidebar({
]

return (
<TabPanel
ariaLabel="Chat sidebar views"
className="panel-shell flex min-h-0 flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-panel"
contentClassName="flex-1 overflow-auto px-3.5 py-3"
iconClassName="size-3"
listClassName="min-w-0 flex-1"
onValueChange={(value) => {
onTabChange(value)
}}
tabBarAccessory={
tab === 'conversations' && onNewChat ? (
<div className="panel-shell flex min-h-0 flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-panel">
<TabPanel
ariaLabel="Chat sidebar views"
className="min-h-0 flex-1 overflow-hidden"
contentClassName="flex-1 overflow-auto px-3.5 py-3"
listClassName="min-w-0 flex-1"
stretchTabs
onValueChange={(value) => {
onTabChange(value)
}}
tabBarClassName="border-border-soft pl-0 pr-0"
tabs={tabItems}
value={tab}
/>
{onNewChat ? (
<div className="border-t border-border-soft px-3 pb-3 pt-2.5">
<button
onClick={onNewChat}
type="button"
className="ui-control inline-flex h-7 items-center gap-1.5 rounded-[var(--radius)] border px-3 text-[length:var(--density-type-control-lg)] font-medium outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
className="ui-control inline-flex w-full items-center justify-center gap-2 rounded-[var(--radius)] border px-3 py-2 text-[length:var(--density-type-control-lg)] font-medium outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
>
<Plus className="size-3.5" /> New
</button>
) : null
}
tabBarClassName="border-border-soft pl-0 pr-2.5"
tabs={tabItems}
value={tab}
/>
</div>
) : null}
</div>
)
}
76 changes: 41 additions & 35 deletions crates/mesh-llm-ui/src/features/chat/components/MessageRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,7 @@ export function MessageRow({
const canRemoveQueued = isQueued && onRemoveQueued != null
const routeMetadata = showRouteMetadata && ((isUser && routeNode) || (isResponse && route))
const displayModel = isQueued ? 'Queued' : model
const rowClassName = cn(
'relative -mx-2 mb-5 block w-[calc(100%+16px)] select-none rounded-[var(--radius-lg)] border-0 bg-transparent px-2 py-1 text-left transition-[background,box-shadow] duration-150',
canInspect &&
'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent'
)
const rowClassName = 'relative -mx-2 mb-5 block w-[calc(100%+16px)] select-none rounded-[var(--radius-lg)] border-0 bg-transparent px-2 py-1 text-left transition-[background,box-shadow] duration-150'
const rowStyle: CSSProperties = {
...(inspected ? { background: 'color-mix(in oklab, var(--color-accent) 4%, transparent)' } : {})
}
Expand Down Expand Up @@ -362,12 +358,28 @@ export function MessageRow({
<>
<span>·</span>
{isUser && routeNode ? (
<span
className="inline-flex items-center gap-[5px]"
style={{ color: inspected ? 'var(--color-accent)' : 'var(--color-fg-dim)' }}
>
<Send className="size-[10px]" /> sent to <span className="font-mono">{routeNode}</span>
</span>
canInspect ? (
<button
type="button"
className="inline-flex items-center gap-[5px] outline-none transition-colors hover:text-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
style={{ color: inspected ? 'var(--color-accent)' : 'var(--color-fg-dim)' }}
aria-label={accessibleInspectLabel}
onClick={(event) => {
event.stopPropagation()
inspect?.()
}}
>
<Send className="size-[10px]" aria-hidden={true} /> sent to{' '}
<span className="font-mono">{routeNode}</span>
</button>
) : (
<span
className="inline-flex items-center gap-[5px]"
style={{ color: inspected ? 'var(--color-accent)' : 'var(--color-fg-dim)' }}
>
<Send className="size-[10px]" /> sent to <span className="font-mono">{routeNode}</span>
</span>
)
) : isResponse && route ? (
<span
className="inline-flex items-center gap-[5px]"
Expand All @@ -379,15 +391,17 @@ export function MessageRow({
) : null}
</>
) : null}
{canInspect && !hasAttachmentActions ? (
{canInspect && isUser && !routeNode ? (
<button
type="button"
className="ui-control ml-auto inline-flex h-7 items-center gap-1.5 rounded-[var(--radius)] border px-2 text-[length:var(--density-type-caption)] font-medium text-fg-muted outline-none transition-[background,color,box-shadow,transform] hover:text-fg focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
className="inline-flex items-center gap-1 text-fg-faint outline-none transition-colors hover:text-fg-dim focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
aria-label={accessibleInspectLabel}
title={accessibleInspectLabel}
onClick={inspect}
onClick={(event) => {
event.stopPropagation()
inspect?.()
}}
>
<Eye className="size-3.5" aria-hidden={true} />
<Eye className="size-3" aria-hidden={true} />
<span>Inspect</span>
</button>
) : null}
Expand Down Expand Up @@ -433,7 +447,14 @@ export function MessageRow({
) : null}
</div>
{isResponse && !isError ? (
<ResponseStatsBar tokens={tokens} tokPerSec={tokPerSec} ttft={ttft} stopped={isStopped} />
<ResponseStatsBar
tokens={tokens}
tokPerSec={tokPerSec}
ttft={ttft}
stopped={isStopped}
inspect={inspect}
inspectLabel={accessibleInspectLabel}
/>
) : null}
</>
)
Expand Down Expand Up @@ -462,24 +483,9 @@ export function MessageRow({
<X className="size-4" aria-hidden={true} strokeWidth={1.8} />
</button>
) : null}
{hasAttachmentActions ? (
<span className="flex shrink-0 flex-col items-end justify-center gap-1.5">
{inspect ? (
<button
type="button"
className="ui-control inline-flex h-8 max-w-[12rem] items-center gap-1.5 rounded-[var(--radius)] border px-2.5 text-[length:var(--density-type-caption)] font-medium text-fg-muted outline-none transition-[background,color,box-shadow,transform] hover:text-fg focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
aria-label={accessibleInspectLabel}
title={accessibleInspectLabel}
onClick={(event) => {
event.stopPropagation()
inspect()
}}
>
<Eye className="size-3.5" aria-hidden={true} />
<span className="truncate">Inspect</span>
</button>
) : null}
{attachments.map((attachment) => (
{hasAttachmentActions ? (
<span className="flex shrink-0 flex-col items-end justify-center gap-1.5">
{attachments.map((attachment) => (
<button
key={attachment.id}
type="button"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Eye } from 'lucide-react'
import { Fragment } from 'react'

type ResponseStatsBarProps = {
tokens?: string
tokPerSec?: string
ttft?: string
stopped?: boolean
inspect?: () => void
inspectLabel?: string
}

type ResponseStat = {
Expand All @@ -22,8 +25,15 @@ function splitNumericValue(value: string): { number: string; unit: string } {
return { number: match[1], unit: match[2] }
}

export function ResponseStatsBar({ tokens, tokPerSec, ttft, stopped = false }: ResponseStatsBarProps) {
if (!tokens && !tokPerSec && !ttft && !stopped) return null
export function ResponseStatsBar({
tokens,
tokPerSec,
ttft,
stopped = false,
inspect,
inspectLabel
}: ResponseStatsBarProps) {
if (!tokens && !tokPerSec && !ttft && !stopped && !inspect) return null

const stats: ResponseStat[] = [
{ label: 'tokens', value: tokens ?? '0 tok' },
Expand All @@ -49,6 +59,23 @@ export function ResponseStatsBar({ tokens, tokPerSec, ttft, stopped = false }: R
</Fragment>
)
})}
{inspect ? (
<>
<span aria-hidden="true">·</span>
<button
type="button"
className="inline-flex items-center gap-1 text-fg-faint outline-none transition-colors hover:text-fg-dim focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
aria-label={inspectLabel ?? 'Inspect message'}
onClick={(event) => {
event.stopPropagation()
inspect()
}}
>
<Eye className="size-3" aria-hidden={true} />
<span>Inspect</span>
</button>
</>
) : null}
</span>
)
}
Loading
Loading