Skip to content
Open
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
6 changes: 3 additions & 3 deletions apps/desktop/src/app/chat/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ export function ChatSidebar({
return (
<Sidebar
className={cn(
'relative h-full min-w-0 overflow-hidden border-t-0 border-b-0 text-foreground transition-none',
'relative h-full min-w-0 overflow-hidden border-t-0 border-b-0 text-sidebar-foreground transition-none',
panesFlipped ? 'border-l border-r-0' : 'border-r border-l-0',
sidebarOpen
? 'border-(--sidebar-edge-border) bg-(--ui-sidebar-surface-background) opacity-100'
Expand Down Expand Up @@ -1214,9 +1214,9 @@ export function ChatSidebar({
// resolved region has been observed to swallow clicks on the
// top rows. Same carve-out as USER_BUBBLE_BASE_CLASS in
// thread.tsx.
'flex h-7 w-full justify-start gap-2 rounded-md border border-transparent px-2 text-left text-[0.8125rem] font-medium text-(--ui-text-secondary) transition-colors duration-100 ease-out [-webkit-app-region:no-drag] hover:bg-(--ui-control-hover-background) hover:text-foreground hover:transition-none',
'flex h-7 w-full justify-start gap-2 rounded-md border border-transparent px-2 text-left text-[0.8125rem] font-semibold text-(--ui-sidebar-nav-foreground) transition-colors duration-100 ease-out [-webkit-app-region:no-drag] hover:bg-(--ui-control-hover-background) hover:text-(--ui-sidebar-heading) hover:transition-none',
active &&
'border-(--ui-stroke-tertiary) bg-(--ui-control-active-background) text-foreground shadow-none hover:border-(--ui-stroke-tertiary)!',
'border-(--ui-stroke-tertiary) bg-(--ui-control-active-background) text-(--ui-sidebar-heading) shadow-none hover:border-(--ui-stroke-tertiary)!',
!isInteractive &&
'cursor-default hover:border-transparent hover:bg-transparent hover:text-inherit'
)}
Expand Down
7 changes: 6 additions & 1 deletion apps/desktop/src/app/chat/sidebar/session-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ export function SidebarSessionRow({
/>
</Tip>
) : null}
<SidebarRowLabel className="flex-1 font-normal group-hover:text-foreground group-data-[working=true]:text-foreground/90">
<SidebarRowLabel
className={cn(
'flex-1 font-normal text-(--ui-sidebar-session-foreground) group-hover:text-sidebar-foreground group-data-[working=true]:text-sidebar-foreground',
isSelected && 'text-sidebar-foreground'
)}
>
{title}
</SidebarRowLabel>
</SidebarRowBody>
Expand Down
9 changes: 9 additions & 0 deletions apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export function useStatusbarItems({
label,
onSelect: () => openUpdateOverlayFor('client'),
title: tooltip || undefined,
tone: 'version',
variant: 'action'
}
}, [
Expand Down Expand Up @@ -259,6 +260,7 @@ export function useStatusbarItems({
label,
onSelect: () => openUpdateOverlayFor('backend'),
title: tooltip || undefined,
tone: 'version',
variant: 'action'
}
}, [
Expand Down Expand Up @@ -297,6 +299,7 @@ export function useStatusbarItems({
menuClassName: 'w-72',
menuContent: gatewayMenuContent,
title: inferenceStatus?.reason || copy.gatewayTitle,
tone: inferenceReady || gatewayRestarting ? 'gateway' : undefined,
variant: 'menu'
},
{
Expand All @@ -322,13 +325,15 @@ export function useStatusbarItems({
label: copy.agents,
onSelect: openAgents,
title: agentsOpen ? copy.closeAgents : copy.openAgents,
tone: subagentsFailed > 0 ? undefined : 'agents',
variant: 'action'
},
{
icon: <Clock className="size-3" />,
id: 'cron',
label: copy.cron,
title: copy.openCron,
tone: 'cron',
to: CRON_ROUTE,
variant: 'action'
}
Expand Down Expand Up @@ -367,6 +372,7 @@ export function useStatusbarItems({
id: 'context-usage',
label: contextUsage,
title: copy.contextUsage,
tone: 'context',
variant: 'text'
},
{
Expand All @@ -375,6 +381,7 @@ export function useStatusbarItems({
id: 'session-timer',
label: copy.session,
title: copy.runtimeSessionElapsed,
tone: 'session',
variant: 'text'
},
{
Expand All @@ -388,6 +395,7 @@ export function useStatusbarItems({
id: 'yolo',
onSelect: modifiers => void toggleYolo(modifiers),
title: yoloActive ? copy.yoloOn : copy.yoloOff,
tone: 'yolo',
variant: 'action'
},
{
Expand All @@ -397,6 +405,7 @@ export function useStatusbarItems({
id: 'terminal',
onSelect: () => setTerminalTakeover(!$terminalTakeover.get()),
title: terminalTakeover ? copy.hideTerminal : copy.showTerminal,
tone: 'terminal',
variant: 'action'
},
clientVersionItem,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/shell/sidebar-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function SidebarPanelLabel({ children, className, dotClassName, ...props
return (
<span
className={cn(
'flex min-w-0 items-center gap-2 pl-2 text-[0.64rem] font-semibold uppercase tracking-[0.16em] text-(--theme-primary)',
'flex min-w-0 items-center gap-2 pl-2 text-[0.64rem] font-semibold uppercase tracking-[0.16em] text-(--ui-sidebar-heading)',
className
)}
{...props}
Expand Down
24 changes: 21 additions & 3 deletions apps/desktop/src/app/shell/statusbar-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface StatusbarItem {
onSelect?: (modifiers: StatusbarSelectModifiers) => void
title?: string
to?: string
tone?: 'agents' | 'context' | 'cron' | 'gateway' | 'session' | 'terminal' | 'version' | 'yolo'
variant?: 'action' | 'link' | 'menu' | 'text'
}

Expand Down Expand Up @@ -92,7 +93,11 @@ function StatusbarItemView({ item, navigate }: { item: StatusbarItem; navigate:
<>
{item.icon}
{item.label && <span className="truncate">{item.label}</span>}
{item.detail && <span className="truncate text-muted-foreground/80">{item.detail}</span>}
{item.detail && (
<span className="truncate text-muted-foreground/80" data-slot="statusbar-detail">
{item.detail}
</span>
)}
</>
)

Expand All @@ -101,7 +106,12 @@ function StatusbarItemView({ item, navigate }: { item: StatusbarItem; navigate:
<Tip label={item.title}>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button className={cn(STATUSBAR_ACTION_CLASS, item.className)} disabled={item.disabled} type="button">
<button
className={cn(STATUSBAR_ACTION_CLASS, item.className)}
data-statusbar-tone={item.tone}
disabled={item.disabled}
type="button"
>
{content}
</button>
</DropdownMenuTrigger>
Expand Down Expand Up @@ -160,6 +170,7 @@ function StatusbarItemView({ item, navigate }: { item: StatusbarItem; navigate:
'inline-flex h-full items-center gap-1 px-1.5 text-[0.6875rem] text-(--ui-text-tertiary)',
item.className
)}
data-statusbar-tone={item.tone}
>
{content}
</div>
Expand All @@ -170,7 +181,13 @@ function StatusbarItemView({ item, navigate }: { item: StatusbarItem; navigate:
if (item.href || item.variant === 'link') {
return (
<Tip label={item.title}>
<a className={cn(STATUSBAR_ACTION_CLASS, item.className)} href={item.href} rel="noreferrer" target="_blank">
<a
className={cn(STATUSBAR_ACTION_CLASS, item.className)}
data-statusbar-tone={item.tone}
href={item.href}
rel="noreferrer"
target="_blank"
>
{content}
</a>
</Tip>
Expand All @@ -181,6 +198,7 @@ function StatusbarItemView({ item, navigate }: { item: StatusbarItem; navigate:
<Tip label={item.title}>
<button
className={cn(STATUSBAR_ACTION_CLASS, item.className)}
data-statusbar-tone={item.tone}
disabled={item.disabled}
onClick={event => {
if (item.to) {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/components/Backdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function Backdrop() {
className="pointer-events-none absolute inset-0 z-2"
style={{
mixBlendMode: statue.blendMode as CSSProperties['mixBlendMode'],
opacity: statue.opacity
opacity: `calc(${statue.opacity} * var(--ui-backdrop-opacity, 1))`
}}
>
<img
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/components/assistant-ui/markdown-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ const HEADING_SIZES: Record<'h1' | 'h2' | 'h3' | 'h4', string> = {
const MARKDOWN_CONTAINER_CLASS_NAME = cn(
'aui-md prose w-full max-w-none overflow-hidden text-[length:var(--conversation-text-font-size)] leading-(--dt-line-height) text-foreground',
'prose-p:leading-(--dt-line-height) prose-li:leading-(--dt-line-height)',
'prose-headings:text-foreground prose-strong:text-foreground',
'prose-headings:text-(--ui-emphasis-foreground) prose-strong:text-(--ui-emphasis-foreground)',
'prose-a:break-words prose-p:[overflow-wrap:anywhere]',
'prose-li:marker:text-muted-foreground/70',
'prose-code:rounded-[0.25rem] prose-code:px-[0.1875rem] prose-code:py-px prose-code:font-mono prose-code:text-[0.9em] prose-code:font-normal prose-code:before:content-none prose-code:after:content-none',
Expand Down
13 changes: 12 additions & 1 deletion apps/desktop/src/components/chat/shiki-highlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ExpandableBlock } from '@/components/chat/expandable-block'
import { CopyButton } from '@/components/ui/copy-button'
import { useI18n } from '@/i18n'
import { codiconForLanguage, isLikelyProseCodeBlock, sanitizeLanguageTag } from '@/lib/markdown-code'
import { useTheme } from '@/themes/context'

/**
* Streamdown's code adapter renders header + body as inline siblings, so we
Expand Down Expand Up @@ -122,8 +123,18 @@ export const SyntaxHighlighter: FC<HermesSyntaxHighlighterProps> = ({
defer = false
}) => {
const { t } = useI18n()
const { theme } = useTheme()
const trimmed = (code ?? '').replace(/^\n+/, '').trimEnd()

// Resolve the Shiki theme: the active skin may override either mode; each
// missing side falls back to the app default. `defaultColor="light-dark()"`
// then picks the right side from the document's color-scheme. Omitting
// `shikiTheme` (every built-in today) keeps the exact GitHub defaults.
const shikiTheme = {
dark: theme.shikiTheme?.dark ?? SHIKI_THEME.dark,
light: theme.shikiTheme?.light ?? SHIKI_THEME.light
}

// Streaming may hand us empty/incomplete fences — render nothing rather
// than a transient empty card.
if (!trimmed.trim()) {
Expand Down Expand Up @@ -169,7 +180,7 @@ export const SyntaxHighlighter: FC<HermesSyntaxHighlighterProps> = ({
delay={120}
language={language || 'text'}
showLanguage={false}
theme={SHIKI_THEME}
theme={shikiTheme}
>
{trimmed}
</ShikiHighlighter>
Expand Down
66 changes: 62 additions & 4 deletions apps/desktop/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,27 @@
--ui-inline-code-background: color-mix(in srgb, #141414 5%, transparent);
--ui-inline-code-foreground: color-mix(in srgb, #141414 88%, transparent);
--ui-selection-background: color-mix(in srgb, #ffd24a 55%, transparent);
/* Emphasis (chat markdown headings + bold). Defaults to the body foreground
so existing themes render identically; a theme can set it (via
`emphasisForeground`) to make headings/bold a brighter/separate color —
e.g. terminal-style "bold brightens". */
--ui-emphasis-foreground: var(--dt-foreground);
/* Sidebar section headers ("PINNED", "SESSIONS"). Defaults to the brand
accent (prior behavior); a theme can override (via
`sidebarHeadingForeground`) for e.g. white headers. */
--ui-sidebar-heading: var(--theme-primary);
--ui-sidebar-nav-foreground: var(--sidebar-foreground);
--ui-sidebar-workspace-foreground: var(--ui-text-secondary);
--ui-sidebar-session-foreground: var(--ui-text-secondary);
--ui-backdrop-opacity: 1;
--ui-status-gateway-foreground: var(--ui-text-tertiary);
--ui-status-agents-foreground: var(--ui-text-tertiary);
--ui-status-cron-foreground: var(--ui-text-tertiary);
--ui-status-context-foreground: var(--ui-text-tertiary);
--ui-status-session-foreground: var(--ui-text-tertiary);
--ui-status-yolo-foreground: var(--ui-text-tertiary);
--ui-status-terminal-foreground: var(--ui-text-tertiary);
--ui-status-version-foreground: var(--ui-text-tertiary);

--dt-background: var(--ui-bg-chrome);
--dt-foreground: var(--ui-text-primary);
Expand Down Expand Up @@ -478,11 +499,11 @@
pointer-transparent. Auto-resets on mouse-out, no JS.

- data-suppress-pane-reveal → kills BOTH edges (use for small regions
like the thread timeline).
like the thread timeline).
- data-suppress-pane-reveal-side → kills only the hovered region's OWN side
(side read from its [data-pane-side]
pane ancestor), so the opposite sidebar
stays summonable while you work a pane. */
(side read from its [data-pane-side]
pane ancestor), so the opposite sidebar
stays summonable while you work a pane. */
[data-pane-shell]:has([data-suppress-pane-reveal]:hover) [data-pane-reveal-trigger] {
pointer-events: none;
}
Expand All @@ -496,6 +517,43 @@
pointer-events: none;
}

[data-statusbar-tone='gateway'] {
color: var(--ui-status-gateway-foreground) !important;
}

[data-statusbar-tone='agents'] {
color: var(--ui-status-agents-foreground) !important;
}

[data-statusbar-tone='cron'] {
color: var(--ui-status-cron-foreground) !important;
}

[data-statusbar-tone='context'] {
color: var(--ui-status-context-foreground) !important;
}

[data-statusbar-tone='session'] {
color: var(--ui-status-session-foreground) !important;
}

[data-statusbar-tone='yolo'] {
color: var(--ui-status-yolo-foreground) !important;
}

[data-statusbar-tone='terminal'] {
color: var(--ui-status-terminal-foreground) !important;
}

[data-statusbar-tone='version'] {
color: var(--ui-status-version-foreground) !important;
}

[data-statusbar-tone] [data-slot='statusbar-detail'] {
color: currentColor;
opacity: 0.82;
}

:root:not([style*='--theme-asset-bg:']) .theme-default-filler {
display: block;
}
Expand Down
34 changes: 34 additions & 0 deletions apps/desktop/src/themes/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,40 @@ function applyTheme(theme: DesktopTheme, mode: 'light' | 'dark') {
root.style.setProperty(k, v)
}

// Inline-code tokens are opt-in per theme. Set when present, REMOVE when not,
// so switching from a theme that customizes them back to one that doesn't
// restores the styles.css :root / :root.dark default instead of leaking the
// previous skin's values. Same pattern for emphasis (chat headings/bold) and
// the two sidebar tokens (section headers + entry text).
const optionalTokens: Record<string, string | undefined> = {
'--ui-inline-code-foreground': c.inlineCodeForeground,
'--ui-inline-code-background': c.inlineCodeBackground,
'--ui-inline-code-border': c.inlineCodeBorder,
'--ui-emphasis-foreground': c.emphasisForeground,
'--ui-sidebar-heading': c.sidebarHeadingForeground,
'--sidebar-foreground': c.sidebarForeground,
'--ui-sidebar-nav-foreground': c.sidebarNavForeground,
'--ui-sidebar-workspace-foreground': c.sidebarWorkspaceForeground,
'--ui-sidebar-session-foreground': c.sidebarSessionForeground,
'--ui-backdrop-opacity': c.backdropOpacity,
'--ui-status-gateway-foreground': c.statusGatewayForeground,
'--ui-status-agents-foreground': c.statusAgentsForeground,
'--ui-status-cron-foreground': c.statusCronForeground,
'--ui-status-context-foreground': c.statusContextForeground,
'--ui-status-session-foreground': c.statusSessionForeground,
'--ui-status-yolo-foreground': c.statusYoloForeground,
'--ui-status-terminal-foreground': c.statusTerminalForeground,
'--ui-status-version-foreground': c.statusVersionForeground
}

for (const [k, v] of Object.entries(optionalTokens)) {
if (v) {
root.style.setProperty(k, v)
} else {
root.style.removeProperty(k)
}
}

const chromeBg = chromeBackground(c.background, isDark)

window.hermesDesktop?.setTitleBarTheme?.({
Expand Down
Loading
Loading