Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

Refresh composer, agent icon, and composer trigger styling (#578)

bharat-tf347a7e730539
diff --git a/.changeset/20260901200000-composer-design-refresh.md b/.changeset/20260901200000-composer-design-refresh.md
new file mode 100644
index 000000000..a4767c765
--- /dev/null
+++ b/.changeset/20260901200000-composer-design-refresh.md
@@ -0,0 +1,5 @@
+---
+'@truefoundry/trueforge-ui': patch
+---
+
+Refresh composer and composer-trigger styling: 0.75rem composer corners with a light-theme primary-token gradient hairline (faded top → solid bottom) and a neutral hairline in dark, an icon-only tools trigger in place of the "Tools" caption and count badge, the shared `agent-2` glyph on the agents-library trigger, and squared-off chrome-action geometry on the save-agent trigger. Also fixes `agent-2.svg` to use `currentColor` so it is legible in dark mode.
diff --git a/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx b/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
index aad889a0c..19ea5c2f9 100644
--- a/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
+++ b/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
@@ -61,7 +61,7 @@ export function AgentsLibraryButton({ className, compact = false }: AgentsLibrar
})}
onClick={() => shell?.setLibraryOpen(true)}
>
- <Icon name="bot" size={compact ? 16 : undefined} />
+ <Icon name="agent-2" size={compact ? 16 : undefined} />
{compact ? (
<span className="text-center">Agents</span>
) : (
diff --git a/packages/trueforge-ui/src/atoms/ComposerShell.tsx b/packages/trueforge-ui/src/atoms/ComposerShell.tsx
index 115adce2a..fc9708673 100644
--- a/packages/trueforge-ui/src/atoms/ComposerShell.tsx
+++ b/packages/trueforge-ui/src/atoms/ComposerShell.tsx
@@ -43,7 +43,12 @@ export function ComposerShell({
<div
data-slot="aui_composer-shell"
className={cn(
- 'border-border/60 focus-within:border-focus-ring focus-within:ring-focus-ring/20 flex w-full flex-col gap-2 rounded-[var(--composer-radius,1.5rem)] border bg-input-box-bg p-[var(--composer-padding,8px)] shadow-sm transition-colors focus-within:ring-3',
+ 'focus-within:ring-focus-ring/20 flex w-full flex-col gap-2 rounded-[0.75rem] border border-transparent bg-card-bg p-[var(--composer-padding,0.5rem)] shadow-[0_1.25rem_1.875rem_-1.25rem_color-mix(in_oklab,var(--primary-button-bg)_8%,transparent)] transition-colors focus-within:ring-3',
+ // Gradient hairline from theme primary (faded at top → solid at bottom).
+ // padding-box paints the surface; border-box bleeds the ramp into the transparent border.
+ '[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--card-bg),var(--card-bg)),linear-gradient(to_bottom,color-mix(in_oklab,var(--primary-button-bg)_25%,transparent),var(--primary-button-bg))] [background-origin:border-box]',
+ // Gradient + glow are light-only; dark falls back to the palette's neutral hairline.
+ 'dark:border-border/60 dark:shadow-none dark:[background-clip:border-box] dark:[background-image:none]',
className,
)}
>
diff --git a/packages/trueforge-ui/src/atoms/SaveAgentButton.tsx b/packages/trueforge-ui/src/atoms/SaveAgentButton.tsx
index 748f3762d..47e17d33f 100644
--- a/packages/trueforge-ui/src/atoms/SaveAgentButton.tsx
+++ b/packages/trueforge-ui/src/atoms/SaveAgentButton.tsx
@@ -18,6 +18,7 @@ import type { AgentConfigEditor } from './draft/AgentConfigEditors.js';
import { DraftCatalogProvider, useDraftCatalog } from './draft/DraftCatalogProvider.js';
import { editableMountsFromSpec, withPreload } from './draft/agentConfigMounts.js';
import { auiButtonClass } from './lib/buttonClasses.js';
+import { cn } from './lib/cn.js';
import { CenteredModal } from './primitives/CenteredModal.js';
type SaveIntent = 'create' | 'update';
@@ -189,7 +190,14 @@ function SaveAgentButtonContent({
<button
type="button"
disabled={disabled || builder === null || agentSpec === null}
- className={auiButtonClass({ variant: 'outline', size: 'sm', className })}
+ className={auiButtonClass({
+ variant: 'outline',
+ size: 'sm',
+ // Chrome-action triggers use the squared-off header treatment: tight corners,
+ // roomier horizontal padding, and a card-surface fill rather than the grey
+ // secondary fill, so they read as controls layered on the topbar.
+ className: cn('gap-2 rounded-[0.125rem] bg-card-bg px-[0.625rem]', className),
+ })}
onClick={() => void show()}
>
<Icon name="save" className="size-3.5" />
diff --git a/packages/trueforge-ui/src/atoms/draft/DraftCompositeSelector.tsx b/packages/trueforge-ui/src/atoms/draft/DraftCompositeSelector.tsx
index facdf2cc1..0825bff7a 100644
--- a/packages/trueforge-ui/src/atoms/draft/DraftCompositeSelector.tsx
+++ b/packages/trueforge-ui/src/atoms/draft/DraftCompositeSelector.tsx
@@ -579,8 +579,10 @@ export function DraftCompositeSelector({ disabled, isRunning, onAttach }: DraftC
</>
);
+ // Gapless row: now that both triggers are icon-only, their ghost hover targets butt
+ // together as one toolbar cluster rather than reading as separate chips.
return (
- <div ref={containerRef} className="relative flex flex-wrap items-center gap-1.5">
+ <div ref={containerRef} className="relative flex flex-wrap items-center">
{hasValidModel ? (
<Tooltip content={toolsTooltip} className="max-w-xs whitespace-pre-line text-left" side="top">
<button
@@ -593,7 +595,7 @@ export function DraftCompositeSelector({ disabled, isRunning, onAttach }: DraftC
className={auiButtonClass({
variant: 'ghost',
size: 'sm',
- className: 'h-8 gap-1.5 rounded-md px-2 text-xs',
+ className: 'h-8 rounded-md px-2 text-xs',
})}
onClick={() => {
if (open) {
@@ -603,11 +605,9 @@ export function DraftCompositeSelector({ disabled, isRunning, onAttach }: DraftC
openPicker();
}}
>
+ {/* Icon-only trigger; the count and name reach assistive tech via aria-label
+ and sighted users via the tooltip, which lists the selected tools. */}
<Icon name="wrench" className="size-3.5" />
- <span>Tools</span>
- <span className="bg-primary-button-bg/10 text-primary-button-bg rounded px-1.5 py-0.5 text-[10px] font-semibold">
- {toolsCount}
- </span>
</button>
</Tooltip>
) : null}
diff --git a/packages/trueforge-ui/src/containers/ComposerContainer.tsx b/packages/trueforge-ui/src/containers/ComposerContainer.tsx
index 009d1f1ae..231d55a9e 100644
--- a/packages/trueforge-ui/src/containers/ComposerContainer.tsx
+++ b/packages/trueforge-ui/src/containers/ComposerContainer.tsx
@@ -56,7 +56,7 @@ function ComposerBody({ placeholder }: { placeholder: string }) {
<ComposerPrimitive.AttachmentDropzone
disabled={isBusy}
data-slot="aui_composer-attachment-dropzone"
- className="w-full rounded-[var(--composer-radius,1.5rem)] transition-[box-shadow] data-[dragging=true]:ring-focus-ring/20 data-[dragging=true]:ring-3"
+ className="w-full rounded-[0.75rem] transition-[box-shadow] data-[dragging=true]:ring-focus-ring/20 data-[dragging=true]:ring-3"
>
<ComposerPrimitive.Root
data-slot="aui_composer-root"
diff --git a/packages/trueforge-ui/src/icons/agent-2.svg b/packages/trueforge-ui/src/icons/agent-2.svg
index 18b5546b5..b8644a272 100644
--- a/packages/trueforge-ui/src/icons/agent-2.svg
+++ b/packages/trueforge-ui/src/icons/agent-2.svg
@@ -1,3 +1,3 @@
<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8 0C8.40158 8.28071e-05 8.72754 0.325937 8.72754 0.727539V2.90918H12.3623C13.5671 2.90921 14.5437 3.88607 14.5439 5.09082V7.27246H15.2725C15.6741 7.27253 16 7.59839 16 8C15.9999 8.40155 15.674 8.72747 15.2725 8.72754H14.5439V10.9092C14.5437 12.1139 13.5671 13.0908 12.3623 13.0908H3.63477C2.43015 13.0906 1.45334 12.1138 1.45312 10.9092V8.72754H0.727539C0.325964 8.7275 7.21982e-05 8.40157 0 8C0 7.59837 0.32592 7.2725 0.727539 7.27246H1.45312V5.09082C1.45335 3.8862 2.43015 2.90942 3.63477 2.90918H7.27246V1.45508H5.09082C4.68943 1.4549 4.36346 1.12893 4.36328 0.727539C4.36328 0.325997 4.68932 0.00017902 5.09082 0H8ZM3.63477 4.36426C3.23346 4.3645 2.90843 4.68951 2.9082 5.09082V7.99023C2.90824 7.99344 2.90918 7.99678 2.90918 8C2.90918 8.00326 2.90825 8.00651 2.9082 8.00977V10.9092C2.90841 11.3105 3.23345 11.6365 3.63477 11.6367H12.3623C12.7638 11.6367 13.0896 11.3106 13.0898 10.9092V5.09082C13.0896 4.68937 12.7638 4.36428 12.3623 4.36426H3.63477ZM5.81738 6.54492C6.21902 6.54492 6.54489 6.87084 6.54492 7.27246V8.72656C6.54492 9.12822 6.21904 9.4541 5.81738 9.4541C5.41587 9.45393 5.08984 9.12811 5.08984 8.72656V7.27246C5.08988 6.87094 5.41589 6.54509 5.81738 6.54492ZM10.1816 6.54492C10.5831 6.54514 10.9091 6.87097 10.9092 7.27246V8.72656C10.9092 9.12808 10.5831 9.45388 10.1816 9.4541C9.77999 9.4541 9.4541 9.12822 9.4541 8.72656V7.27246C9.45413 6.87084 9.78001 6.54492 10.1816 6.54492Z" fill="#000"/>
+<path d="M8 0C8.40158 8.28071e-05 8.72754 0.325937 8.72754 0.727539V2.90918H12.3623C13.5671 2.90921 14.5437 3.88607 14.5439 5.09082V7.27246H15.2725C15.6741 7.27253 16 7.59839 16 8C15.9999 8.40155 15.674 8.72747 15.2725 8.72754H14.5439V10.9092C14.5437 12.1139 13.5671 13.0908 12.3623 13.0908H3.63477C2.43015 13.0906 1.45334 12.1138 1.45312 10.9092V8.72754H0.727539C0.325964 8.7275 7.21982e-05 8.40157 0 8C0 7.59837 0.32592 7.2725 0.727539 7.27246H1.45312V5.09082C1.45335 3.8862 2.43015 2.90942 3.63477 2.90918H7.27246V1.45508H5.09082C4.68943 1.4549 4.36346 1.12893 4.36328 0.727539C4.36328 0.325997 4.68932 0.00017902 5.09082 0H8ZM3.63477 4.36426C3.23346 4.3645 2.90843 4.68951 2.9082 5.09082V7.99023C2.90824 7.99344 2.90918 7.99678 2.90918 8C2.90918 8.00326 2.90825 8.00651 2.9082 8.00977V10.9092C2.90841 11.3105 3.23345 11.6365 3.63477 11.6367H12.3623C12.7638 11.6367 13.0896 11.3106 13.0898 10.9092V5.09082C13.0896 4.68937 12.7638 4.36428 12.3623 4.36426H3.63477ZM5.81738 6.54492C6.21902 6.54492 6.54489 6.87084 6.54492 7.27246V8.72656C6.54492 9.12822 6.21904 9.4541 5.81738 9.4541C5.41587 9.45393 5.08984 9.12811 5.08984 8.72656V7.27246C5.08988 6.87094 5.41589 6.54509 5.81738 6.54492ZM10.1816 6.54492C10.5831 6.54514 10.9091 6.87097 10.9092 7.27246V8.72656C10.9092 9.12808 10.5831 9.45388 10.1816 9.4541C9.77999 9.4541 9.4541 9.12822 9.4541 8.72656V7.27246C9.45413 6.87084 9.78001 6.54492 10.1816 6.54492Z" fill="currentColor"/>
</svg>
diff --git a/packages/trueforge-ui/src/layouts/SidebarLayout.tsx b/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
index 6c97494a2..a0950618a 100644
--- a/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
+++ b/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
@@ -109,11 +109,11 @@ function SidebarRail({
}}
{...dialogProps}
>
- <div className="flex h-14 w-full shrink-0 items-center justify-center border-b border-border text-text-primary">
+ <div className="flex h-14 w-full shrink-0 items-center justify-center text-text-primary">
<BrandLogo variant={chrome.collapsedVariant} className={brandLogoClassName} />
</div>
<SidebarNav />
- <footer className="flex shrink-0 flex-col items-center border-t border-border p-2">
+ <footer className="flex shrink-0 flex-col items-center border-border p-2">
<ShellActions labeled className="flex-col" />
</footer>
</aside>
@@ -170,13 +170,14 @@ export function SidebarLayout({ className }: { className?: string }) {
<SidebarRail className="hidden md:flex" />
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-primary-bg">
- {/* Mobile ShellActions stay mounted while Settings is open so host overrides (e.g. logout) do not remount.
- Desktop keeps shell chrome in the rail footer (always mounted). */}
+ {/* Desktop keeps shell chrome in the rail footer (always mounted, including
+ when visually hidden on small screens so host action-slot state persists).
+ Mobile reaches theme/settings via the nav drawer rail. */}
<header
className={cn(
'flex shrink-0 items-center gap-1 border-b border-border bg-topbar-bg px-2 py-1.5',
// Desktop: hide when settings/idle or the thread header has nothing to show
- // (empty untitled draft). Mobile still needs menu + ShellActions.
+ // (empty untitled draft). Mobile still needs the menu button.
(overlayOpen || shell?.agentConfigOpen || isIdle || !hasChatHeaderContent) && 'md:hidden',
)}
>
@@ -200,9 +201,6 @@ export function SidebarLayout({ className }: { className?: string }) {
) : (
<span className="min-w-0 flex-1" />
)}
- <div key="mobile-shell-actions" className="md:hidden">
- <ShellActions />
- </div>
</header>
<div ref={mainRef} className="min-h-0 min-w-0 flex-1">
diff --git a/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx b/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
index 9c46f169d..d956a8db4 100644
--- a/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
+++ b/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
@@ -456,14 +456,14 @@ describe('SidebarLayout', () => {
</SlotsProvider>,
);
- expect(screen.getAllByRole('button', { name: 'Settings' })).toHaveLength(2);
+ expect(screen.getAllByRole('button', { name: 'Settings' })).toHaveLength(1);
expect(await screen.findAllByRole('button', { name: 'Agents' })).not.toHaveLength(0);
const [themeButton] = screen.getAllByRole('button', { name: /Switch to (light|dark) theme/ });
if (themeButton === undefined) {
throw new Error('Expected theme toggle');
}
fireEvent.click(themeButton);
- expect(screen.getAllByRole('button', { name: /Switch to (light|dark) theme/ })).toHaveLength(2);
+ expect(screen.getAllByRole('button', { name: /Switch to (light|dark) theme/ })).toHaveLength(1);
// Settings stays available with a locked agentName when catalog is present.
rerender(
@@ -479,7 +479,7 @@ describe('SidebarLayout', () => {
</ServerProvider>
</SlotsProvider>,
);
- expect(screen.getAllByRole('button', { name: 'Settings' })).toHaveLength(2);
+ expect(screen.getAllByRole('button', { name: 'Settings' })).toHaveLength(1);
const [settingsButton] = screen.getAllByRole('button', { name: 'Settings' });
if (settingsButton === undefined) {
throw new Error('Expected settings button');
@@ -532,7 +532,7 @@ describe('SidebarLayout', () => {
</SlotsProvider>,
);
expect(screen.queryByRole('button', { name: 'Settings' })).not.toBeInTheDocument();
- expect(screen.getAllByRole('button', { name: /Switch to (light|dark) theme/ })).toHaveLength(2);
+ expect(screen.getAllByRole('button', { name: /Switch to (light|dark) theme/ })).toHaveLength(1);
});
});
diff --git a/packages/trueforge-ui/vitest.config.ts b/packages/trueforge-ui/vitest.config.ts
index f4c1b692f..ff0296e3c 100644
--- a/packages/trueforge-ui/vitest.config.ts
+++ b/packages/trueforge-ui/vitest.config.ts
@@ -1,9 +1,17 @@
/** Vitest: jsdom for React containers; MUI alias for CJS/ESM dual-package quirk. */
+import process from 'node:process';
import { fileURLToPath } from 'node:url';
import svgr from 'vite-plugin-svgr';
import { defineConfig } from 'vitest/config';
+// Node 25+ installs a stub Web Storage global that shadows jsdom's localStorage
+// (no clear/getItem/setItem), so ThemeProvider / ShellMode tests crash. Disable
+// it on the worker so jsdom owns the global. Flag does not exist on Node < 25.
+// See https://github.com/vitest-dev/vitest/issues/8757
+const nodeMajor = Number.parseInt(process.versions.node.split('.')[0] ?? '0', 10);
+const execArgv = nodeMajor >= 25 ? ['--no-webstorage'] : [];
+
export default defineConfig({
plugins: [
svgr({
@@ -32,6 +40,7 @@ export default defineConfig({
include: ['test/**/*.test.{ts,tsx}'],
globals: true,
setupFiles: ['./test/testSetup.ts'],
+ execArgv,
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],