Skip to content

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

Chore/gv/new sidebar and feedback changes (#571)

Govinda Vashishtha788636d13aeb
diff --git a/.changeset/schedule-isnew-drawer.md b/.changeset/schedule-isnew-drawer.md
new file mode 100644
index 000000000..9082c2255
--- /dev/null
+++ b/.changeset/schedule-isnew-drawer.md
@@ -0,0 +1,5 @@
+---
+"@truefoundry/trueforge-ui": patch
+---
+
+Open the create schedule drawer when Agents "+ Schedule" navigates with `isNew=true`, then clear the flag from the URL.
diff --git a/.changeset/schedules-side-drawer.md b/.changeset/schedules-side-drawer.md
index bca28f0e8..0d866b0ca 100644
--- a/.changeset/schedules-side-drawer.md
+++ b/.changeset/schedules-side-drawer.md
@@ -2,4 +2,4 @@
"@truefoundry/trueforge-ui": minor
---
-Add global Schedules page at `/schedules` with listing, popover-based filters, and create/edit drawer wired to the schedule API. New schedules save as paused, open a Test Schedule review with MCP connect status, and support Activate Anyway. List schedules uses server token pagination and multi-agent filters. Agents Library shows a Schedules count column (warning when any are paused) loaded via a batched list for on-screen agents. Add Table primitives with client-side and token pagination plus portal DropdownMenu so row actions are not clipped by overflow. Export a reusable popover select with single- and multi-select modes.
+Add global Schedules page at `/schedules` with listing, popover-based filters, and create/edit drawer wired to the schedule API. New schedules save as paused, open a Test Schedule review with MCP connect status, and support Activate Anyway. List schedules uses server token pagination and multi-agent filters. Agents shows a Schedules count column (warning when any are paused) loaded via a batched list for on-screen agents. Add Table primitives with client-side and token pagination plus portal DropdownMenu so row actions are not clipped by overflow. Export a reusable popover select with single- and multi-select modes.
diff --git a/.changeset/sidebar-icon-rail.md b/.changeset/sidebar-icon-rail.md
new file mode 100644
index 000000000..1960bc434
--- /dev/null
+++ b/.changeset/sidebar-icon-rail.md
@@ -0,0 +1,5 @@
+---
+"@truefoundry/trueforge-ui": minor
+---
+
+Sidebar layout is a permanent icon+label nav rail (no expand/collapse). Recent chats are hidden from the sidebar and mobile drawer; the drawer shows nav actions only.
diff --git a/docs/agent-library.mdx b/docs/agent-library.mdx
index 76557ed98..88b59aff9 100644
--- a/docs/agent-library.mdx
+++ b/docs/agent-library.mdx
@@ -1,13 +1,13 @@
---
-title: 'Agents Library'
-sidebarTitle: 'Agents Library'
+title: 'Agents'
+sidebarTitle: 'Agents'
description: 'Browse, edit, and try saved agents from one place.'
---
-The **Agents Library** is where saved agents live. Open it from the chat UI to search agents, edit their configuration, or start a conversation with **Try**.
+**Agents** is where saved agents live. Open it from the chat UI to search agents, edit their configuration, or start a conversation with **Try**.
-<Frame caption="Agents Library — search, edit, and try saved agents.">
- <img src="/images/agents-library.png" alt="Agents Library modal listing saved agents with Edit and Try actions" />
+<Frame caption="Agents — search, edit, and try saved agents.">
+ <img src="/images/agents-library.png" alt="Agents modal listing saved agents with Edit and Try actions" />
</Frame>
From the library you can:
diff --git a/docs/introduction.mdx b/docs/introduction.mdx
index 2aa7a863a..db4a5e387 100644
--- a/docs/introduction.mdx
+++ b/docs/introduction.mdx
@@ -103,7 +103,7 @@ The agent features are identical in both modes — only the backend around the s
Configure models, MCP servers, skills, and sandbox — and customize the shipped catalogs.
</Card>
<Card title="Create an Agent" icon="robot" href="/create-agent/overview">
- Select a model, attach connectors and skills, then save to the Agents Library.
+ Select a model, attach connectors and skills, then save under Agents.
</Card>
<Card title="Harness Capabilities" icon="layer-group" href="/key-features/overview">
Sandbox-as-tool, subagents, deferred tools, code mode, compaction, and human checkpoints.
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx
index 49c6967a7..bd80f898a 100644
--- a/docs/quickstart.mdx
+++ b/docs/quickstart.mdx
@@ -235,11 +235,11 @@ With TrueForge open in your browser, this walkthrough takes you from an empty wo
</Frame>
</Step>
- <Step title="Find it in the Agents Library">
- Open **Agents Library** from the sidebar. Your saved agent is there — click **Try** to start a fresh chat with the same setup, or **Edit** to tweak it. See [Agent Library](/agent-library) for shared-visibility notes in hosted mode.
+ <Step title="Find it under Agents">
+ Open **Agents** from the sidebar. Your saved agent is there — click **Try** to start a fresh chat with the same setup, or **Edit** to tweak it. See [Agents](/agent-library) for shared-visibility notes in hosted mode.
<Frame>
- ![The Agents Library listing the saved web-research-brief agent with Edit and Try actions](/images/quickstart-agents-library.png)
+ ![Agents listing the saved web-research-brief agent with Edit and Try actions](/images/quickstart-agents-library.png)
</Frame>
</Step>
</Steps>
diff --git a/docs/ui-sdk/concepts/agent-modes.mdx b/docs/ui-sdk/concepts/agent-modes.mdx
index 8d91226ef..3dfffa9ab 100644
--- a/docs/ui-sdk/concepts/agent-modes.mdx
+++ b/docs/ui-sdk/concepts/agent-modes.mdx
@@ -30,8 +30,8 @@ The default is `{ mode: "AgentLibraryWithComposer" }`.
<Accordion title="AgentLibrary">
Users pick from agents your `searchAgents` implementation returns, but cannot author a new one. Note that "new chat" is disabled in this mode only.
- <Frame caption="The Agents Library: users pick from the agents your `searchAgents` returns.">
- ![The Agents Library dialog listing saved agents to choose from](/images/agent-registry.png)
+ <Frame caption="Agents: users pick from the agents your `searchAgents` returns.">
+ ![Agents dialog listing saved agents to choose from](/images/agent-registry.png)
</Frame>
</Accordion>
diff --git a/packages/trueforge-ui/README.md b/packages/trueforge-ui/README.md
index 459467205..c23572e81 100644
--- a/packages/trueforge-ui/README.md
+++ b/packages/trueforge-ui/README.md
@@ -400,12 +400,12 @@ show the title text (see [Custom layouts](#custom-layouts)).
| Mode | Layout chrome | Agent selection / New Chat |
| -------------------------------------- | ------------------------------- | --------------------------------------------------------- |
-| `AgentLibraryWithComposer` _(default)_ | Agents Library + draft builder | New Chat opens draft; library picks a named agent |
+| `AgentLibraryWithComposer` _(default)_ | Agents + draft builder | New Chat opens draft; library picks a named agent |
| `SingleAgent` | Named-only, plain composer | Locked to `name`; New Chat / Clear Chat = new thread |
-| `AgentLibrary` | Agents Library only (no draft) | Empty until pick; no New Chat; Clear Chat after selection |
+| `AgentLibrary` | Agents only (no draft) | Empty until pick; no New Chat; Clear Chat after selection |
| `AgentComposer` | Draft builder only (no library) | Always draft; New Chat / Clear Chat = fresh draft |
-In library modes, picking an agent from the Agents Library switches to a named chat for that agent **and remounts the runtime** so the new agent starts from a clean conversation. Draft chats can be promoted via **Save agent** (`server.saveAgent` on the resolved `AgentUIServer`). **Clear Chat** (thread header) resets the current named or draft session.
+In library modes, picking an agent from Agents switches to a named chat for that agent **and remounts the runtime** so the new agent starts from a clean conversation. Draft chats can be promoted via **Save agent** (`server.saveAgent` on the resolved `AgentUIServer`). **Clear Chat** (thread header) resets the current named or draft session.
Mutable composers expose **Agent Config** for live model parameters, instructions, runtime behavior, per-connector MCP tools, and skills. The compact Tools picker contains only Connectors and Skills. The Save Agent dialog keeps a local editable copy of the same configuration and shares the same selector dialogs; cancelling it leaves the active draft unchanged. Model context and output limits render when the server supplies that optional catalog metadata.
@@ -438,7 +438,7 @@ Mutable composers expose **Agent Config** for live model parameters, instruction
/>;
```
-> _Screenshot: Agents Library open; selecting an agent resets the thread._
+> _Screenshot: Agents open; selecting an agent resets the thread._
---
diff --git a/packages/trueforge-ui/docs/customization.md b/packages/trueforge-ui/docs/customization.md
index 43909dca1..bafb62448 100644
--- a/packages/trueforge-ui/docs/customization.md
+++ b/packages/trueforge-ui/docs/customization.md
@@ -100,7 +100,7 @@ Places mirrored to the URL:
- `/sessions` — all-user Sessions browser (named agents and drafts)
- `/sessions/:sessionId` — a specific chat session
- `/settings` — settings overlay (closing navigates to the chat place below it)
-- `/library` — Agents Library
+- `/library` — Agents
- `/library/:agentId` — agent details. `?tab=overview|sessions|code|metrics` selects the tab (default Overview);
Metrics is available when the server provides the optional `metrics` port
diff --git a/packages/trueforge-ui/docs/server.md b/packages/trueforge-ui/docs/server.md
index 3c44e60e6..bc201cf10 100644
--- a/packages/trueforge-ui/docs/server.md
+++ b/packages/trueforge-ui/docs/server.md
@@ -144,7 +144,7 @@ interface AgentBuilderServer<
getModels(): Promise<TModel[]>;
getSkills(): Promise<TSkill[]>;
getMcp(): Promise<TMcp[]>;
- /** Search / list named agents for the Agents Library. */
+ /** Search / list named agents for the Agents. */
searchAgents(req?: { query?: string; limit?: number; offset?: number }): Promise<TAgent[]>;
/** Promote draft AgentSpec → named agent */
saveAgent(req: { agentName: string; agentSpec: AgentSpec; draftSessionId?: string }): Promise<TSave>;
diff --git a/packages/trueforge-ui/src/atoms/AgentsLibrary.tsx b/packages/trueforge-ui/src/atoms/AgentsLibrary.tsx
index 8364d5e82..42524d290 100644
--- a/packages/trueforge-ui/src/atoms/AgentsLibrary.tsx
+++ b/packages/trueforge-ui/src/atoms/AgentsLibrary.tsx
@@ -34,6 +34,7 @@ export type AgentLibraryRowProps = {
showEdit: boolean;
scheduleSummary?: AgentScheduleSummary | null;
onOpenSchedules?: () => void;
+ onCreateSchedule?: () => void;
onOpen?: () => void;
onTry: () => void;
onEdit: () => void;
@@ -98,6 +99,7 @@ export function AgentLibraryRow({
showEdit,
scheduleSummary,
onOpenSchedules,
+ onCreateSchedule,
onOpen,
onTry,
onEdit,
@@ -169,7 +171,7 @@ export function AgentLibraryRow({
{scheduleSummary != null && scheduleSummary.count > 0 ? (
<AgentSchedulesBadge summary={scheduleSummary} agentName={agent.name} onOpen={onOpenSchedules} />
) : scheduleSummary != null ? (
- <AgentSchedulesEmptyState agentName={agent.name} onOpen={onOpenSchedules} />
+ <AgentSchedulesEmptyState agentName={agent.name} onOpen={onCreateSchedule} />
) : (
<span className="text-text-secondary text-sm" aria-label={`Schedule count unavailable for ${agent.name}`}>
—
@@ -316,7 +318,7 @@ export function AgentsLibrary({ onSelectAgent }: AgentsLibraryProps) {
};
}, [agents, open, scheduleServer, agentsListEpoch]);
- const openSchedulesForAgent = (agentId: string) => {
+ const openSchedulesForAgent = ({ agentId, isNew }: { agentId: string; isNew?: boolean }) => {
const url = new URL(window.location.href);
writeSessionShareSearch(url.searchParams, {
sessionId: null,
@@ -325,7 +327,12 @@ export function AgentsLibrary({ onSelectAgent }: AgentsLibraryProps) {
view: null,
timeRange: null,
});
- writeScheduleShareSearch(url.searchParams, { agent: agentId, status: null, q: null });
+ writeScheduleShareSearch(url.searchParams, {
+ agent: agentId,
+ status: null,
+ q: null,
+ isNew: isNew === true ? true : null,
+ });
window.history.replaceState(window.history.state, '', url);
shell.setLibraryOpen(false);
shell.setSchedulesOpen(true);
@@ -359,7 +366,7 @@ export function AgentsLibrary({ onSelectAgent }: AgentsLibraryProps) {
<header className="flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-4 py-2.5 md:px-6">
<div className="flex min-w-0 items-center gap-2">
<Icon name="bot" className="text-text-primary size-4" />
- <h1 className="text-text-primary truncate text-md font-semibold">Agents Library</h1>
+ <h1 className="text-text-primary truncate text-md font-semibold">Agents</h1>
</div>
<div className="ml-auto w-56 shrink-0">
<SearchInput query={query} setQuery={setQuery} placeholder="Search agents" />
@@ -419,7 +426,8 @@ export function AgentsLibrary({ onSelectAgent }: AgentsLibraryProps) {
{...(summary !== undefined ? { scheduleSummary: summary } : {})}
{...(showSchedulesColumn
? {
- onOpenSchedules: () => openSchedulesForAgent(id),
+ onOpenSchedules: () => openSchedulesForAgent({ agentId: id }),
+ onCreateSchedule: () => openSchedulesForAgent({ agentId: id, isNew: true }),
}
: {})}
{...(sessionsServer != null && agentId != null
diff --git a/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx b/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
index 72a105cae..aad889a0c 100644
--- a/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
+++ b/packages/trueforge-ui/src/atoms/AgentsLibraryButton.tsx
@@ -24,8 +24,7 @@ export function AgentsLibraryButton({ className, compact = false }: AgentsLibrar
const agentsListEpoch = shell?.agentsListEpoch ?? 0;
useEffect(() => {
- // Compact trigger has no count badge; skip so SidebarLayout can keep both
- // collapsed + expanded trees mounted without a duplicate catalog request.
+ // Compact rail has no count badge; skip the catalog request.
if (!enabled || !server || compact) return;
let cancelled = false;
void server
@@ -44,32 +43,36 @@ export function AgentsLibraryButton({ className, compact = false }: AgentsLibrar
if (!enabled) return null;
return (
- <div className={cn('relative min-w-0', compact ? 'w-8' : 'w-full', className)}>
+ <div className={cn('relative min-w-0 w-full', className)}>
<button
type="button"
- aria-label={compact ? 'Agents Library' : undefined}
- title={compact ? 'Agents Library' : undefined}
+ aria-label={compact ? 'Agents' : undefined}
+ title={compact ? 'Agents' : undefined}
aria-current={libraryOpen ? 'page' : undefined}
className={auiButtonClass({
variant: 'ghost',
className: cn(
- 'h-8 rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
- compact ? 'w-8 !justify-center p-0' : 'w-full !justify-start px-2.5',
+ 'rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
+ compact
+ ? 'h-auto w-full flex-col gap-0.5 whitespace-normal px-1 py-1.5 text-[10px] leading-tight !justify-center'
+ : 'h-8 w-full !justify-start px-2.5',
libraryOpen && 'bg-dropdown-selected-item-bg text-dropdown-selected-item-text',
),
})}
onClick={() => shell?.setLibraryOpen(true)}
>
- <Icon name="bot" />
- {!compact ? (
+ <Icon name="bot" size={compact ? 16 : undefined} />
+ {compact ? (
+ <span className="text-center">Agents</span>
+ ) : (
<>
<span className="truncate">
- Agents Library
+ Agents
{countLabel != null ? <span className="text-text-secondary"> ({countLabel})</span> : null}
</span>
<Icon name="chevron-right" className="ml-auto size-3.5 shrink-0 opacity-60" />
</>
- ) : null}
+ )}
</button>
</div>
);
diff --git a/packages/trueforge-ui/src/atoms/SchedulesButton.tsx b/packages/trueforge-ui/src/atoms/SchedulesButton.tsx
index d89cf651d..c9c21bd33 100644
--- a/packages/trueforge-ui/src/atoms/SchedulesButton.tsx
+++ b/packages/trueforge-ui/src/atoms/SchedulesButton.tsx
@@ -21,7 +21,7 @@ export function SchedulesButton({ className, compact = false }: SchedulesButtonP
if (!enabled) return null;
return (
- <div className={cn('relative min-w-0', compact ? 'w-8' : 'w-full', className)}>
+ <div className={cn('relative min-w-0 w-full', className)}>
<button
type="button"
aria-label={compact ? 'Schedules' : undefined}
@@ -30,20 +30,24 @@ export function SchedulesButton({ className, compact = false }: SchedulesButtonP
className={auiButtonClass({
variant: 'ghost',
className: cn(
- 'h-8 rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
- compact ? 'w-8 !justify-center p-0' : 'w-full !justify-start px-2.5',
+ 'rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
+ compact
+ ? 'h-auto w-full flex-col gap-0.5 whitespace-normal px-1 py-1.5 text-[10px] leading-tight !justify-center'
+ : 'h-8 w-full !justify-start px-2.5',
open && 'bg-dropdown-selected-item-bg text-dropdown-selected-item-text',
),
})}
onClick={() => shell.setSchedulesOpen(!open)}
>
- <Icon name="calendar-clock" />
- {!compact ? (
+ <Icon name="calendar-clock" size={compact ? 16 : undefined} />
+ {compact ? (
+ <span className="text-center">Schedules</span>
+ ) : (
<>
<span className="truncate">Schedules</span>
<Icon name="chevron-right" className="ml-auto size-3.5 shrink-0 opacity-60" />
</>
- ) : null}
+ )}
</button>
</div>
);
diff --git a/packages/trueforge-ui/src/atoms/SessionsBrowserButton.tsx b/packages/trueforge-ui/src/atoms/SessionsBrowserButton.tsx
index c6c527b4b..7d791d0a1 100644
--- a/packages/trueforge-ui/src/atoms/SessionsBrowserButton.tsx
+++ b/packages/trueforge-ui/src/atoms/SessionsBrowserButton.tsx
@@ -22,7 +22,7 @@ export function SessionsBrowserButton({ className, compact = false }: SessionsBr
if (sessionsServer == null || shell == null) return null;
return (
- <div className={cn('relative min-w-0', compact ? 'w-8' : 'w-full', className)}>
+ <div className={cn('relative min-w-0 w-full', className)}>
<button
type="button"
aria-label={compact ? 'Sessions' : undefined}
@@ -31,8 +31,10 @@ export function SessionsBrowserButton({ className, compact = false }: SessionsBr
className={auiButtonClass({
variant: 'ghost',
className: cn(
- 'h-8 rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
- compact ? 'w-8 !justify-center p-0' : 'w-full !justify-start px-2.5',
+ 'rounded-md text-sm font-medium text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
+ compact
+ ? 'h-auto w-full flex-col gap-0.5 whitespace-normal px-1 py-1.5 text-[10px] leading-tight !justify-center'
+ : 'h-8 w-full !justify-start px-2.5',
sessionsOpen && 'bg-dropdown-selected-item-bg text-dropdown-selected-item-text',
),
})}
@@ -49,13 +51,15 @@ export function SessionsBrowserButton({ className, compact = false }: SessionsBr
shell.setSessionsOpen(true);
}}
>
- <Icon name="message-square-text" />
- {!compact ? (
+ <Icon name="message-square-text" size={compact ? 16 : undefined} />
+ {compact ? (
+ <span className="text-center">Sessions</span>
+ ) : (
<>
<span className="truncate">Sessions</span>
<Icon name="chevron-right" className="ml-auto size-3.5 shrink-0 opacity-60" />
</>
- ) : null}
+ )}
</button>
</div>
);
diff --git a/packages/trueforge-ui/src/atoms/ShellActions.tsx b/packages/trueforge-ui/src/atoms/ShellActions.tsx
index d255d940d..3ab289112 100644
--- a/packages/trueforge-ui/src/atoms/ShellActions.tsx
+++ b/packages/trueforge-ui/src/atoms/ShellActions.tsx
@@ -8,23 +8,39 @@ import { useTheme } from '../theme/ThemeProvider.js';
import { auiButtonClass } from './lib/buttonClasses.js';
import { cn } from './lib/cn.js';
-export function ShellActions({ className }: { className?: string }) {
+export function ShellActions({ className, labeled = false }: { className?: string; labeled?: boolean }) {
const shell = useOptionalShellMode();
const catalog = useOptionalCatalogServer();
const capabilities = useServerCapabilities();
const { mode, setTheme } = useTheme();
const ActionSlot = useSlot('ShellActionsActionSlot');
+ const isDark = mode === 'dark';
+ const themeLabel = isDark ? 'Light' : 'Dark';
+
+ const labeledButtonClass =
+ 'h-auto w-full flex-col gap-0.5 whitespace-normal px-1 py-1.5 text-[10px] leading-tight !justify-center';
return (
- <div className={cn('flex shrink-0 items-center gap-1 text-text-primary', className)}>
+ <div
+ className={cn(
+ 'flex shrink-0 items-center gap-1 text-text-primary',
+ labeled && 'w-full flex-col gap-2',
+ className,
+ )}
+ >
<button
type="button"
- aria-label={mode === 'dark' ? 'Switch to light theme' : 'Switch to dark theme'}
- title={mode === 'dark' ? 'Light theme' : 'Dark theme'}
- className={auiButtonClass({ variant: 'ghost', size: 'icon' })}
- onClick={() => setTheme(mode === 'dark' ? 'light' : 'dark')}
+ aria-label={isDark ? 'Switch to light theme' : 'Switch to dark theme'}
+ title={isDark ? 'Light theme' : 'Dark theme'}
+ className={auiButtonClass({
+ variant: 'ghost',
+ size: labeled ? undefined : 'icon',
+ className: labeled ? labeledButtonClass : undefined,
+ })}
+ onClick={() => setTheme(isDark ? 'light' : 'dark')}
>
- <Icon name={mode === 'dark' ? 'sun' : 'moon'} />
+ <Icon name={isDark ? 'sun' : 'moon'} size={labeled ? 16 : undefined} />
+ {labeled ? <span className="text-center">{themeLabel}</span> : null}
</button>
{shell != null && catalog != null && capabilities?.settings?.enabled !== false ? (
<button
@@ -32,10 +48,15 @@ export function ShellActions({ className }: { className?: string }) {
aria-label="Settings"
title="Settings"
aria-expanded={shell.settingsOpen}
- className={auiButtonClass({ variant: 'ghost', size: 'icon' })}
+ className={auiButtonClass({
+ variant: 'ghost',
+ size: labeled ? undefined : 'icon',
+ className: labeled ? labeledButtonClass : undefined,
+ })}
onClick={() => shell.setSettingsOpen(true)}
>
- <Icon name="settings" />
+ <Icon name="settings" size={labeled ? 16 : undefined} />
+ {labeled ? <span className="text-center">Settings</span> : null}
</button>
) : null}
<ActionSlot />
diff --git a/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsHeader.tsx b/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsHeader.tsx
index ee2ba7a34..4781b90b0 100644
--- a/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsHeader.tsx
+++ b/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsHeader.tsx
@@ -33,8 +33,8 @@ export function AgentDetailsHeader({ agentId, detail, onBack }: AgentDetailsHead
<div className="flex min-w-0 flex-wrap items-center gap-2 px-3 py-2">
<button
type="button"
- aria-label="Back to Agents Library"
- title="Back to Agents Library"
+ aria-label="Back to Agents"
+ title="Back to Agents"
className={auiButtonClass({ variant: 'ghost', size: 'icon' })}
onClick={onBack}
>
@@ -43,7 +43,7 @@ export function AgentDetailsHeader({ agentId, detail, onBack }: AgentDetailsHead
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-1 text-xs text-text-secondary">
<button type="button" className="cursor-pointer truncate hover:text-text-primary" onClick={onBack}>
- Agents Library
+ Agents
</button>
<Icon name="chevron-right" className="size-3 shrink-0" />
<span className="truncate">{detail?.name ?? agentId}</span>
diff --git a/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsUnavailable.tsx b/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsUnavailable.tsx
index a634576cc..9cc5cbcfe 100644
--- a/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsUnavailable.tsx
+++ b/packages/trueforge-ui/src/atoms/agent-details/AgentDetailsUnavailable.tsx
@@ -16,7 +16,7 @@ export function AgentDetailsUnavailable({ onBack, reason }: AgentDetailsUnavaila
</div>
<button type="button" className={auiButtonClass({ variant: 'outline', size: 'sm' })} onClick={onBack}>
<Icon name="arrow-left" className="size-3.5" />
- Back to Agents Library
+ Back to Agents
</button>
</div>
);
diff --git a/packages/trueforge-ui/src/atoms/schedules/SchedulesPage.tsx b/packages/trueforge-ui/src/atoms/schedules/SchedulesPage.tsx
index 2d59b6f7a..575f48359 100644
--- a/packages/trueforge-ui/src/atoms/schedules/SchedulesPage.tsx
+++ b/packages/trueforge-ui/src/atoms/schedules/SchedulesPage.tsx
@@ -142,6 +142,7 @@ export function SchedulesPage() {
const [nextPageToken, setNextPageToken] = useState<string | undefined>(undefined);
const [prevTokenStack, setPrevTokenStack] = useState<string[]>([]);
const loadGenRef = useRef(0);
+ const didConsumeIsNewRef = useRef(false);
const loadRunsForSchedules = useCallback(
async ({ rows, gen }: { rows: Schedule[]; gen: number }) => {
@@ -211,7 +212,7 @@ export function SchedulesPage() {
[agentFilter, loadSchedules, pageSize],
);
- // Keep filters in the URL so deep links and Agents Library → Schedules work.
+ // Keep filters in the URL so deep links and Agents → Schedules work.
useEffect(() => {
replaceScheduleShareSearch({
agent: agentFilter === 'all' ? null : agentFilter,
@@ -220,6 +221,19 @@ export function SchedulesPage() {
});
}, [agentFilter, statusFilter, nameQuery]);
+ // One-shot: Agents "+ Schedule" lands with isNew=true; open create then strip the flag.
+ useEffect(() => {
+ if (didConsumeIsNewRef.current) return;
+ const share = readScheduleShareSearch(window.location.search);
+ if (!share.isNew) return;
+ didConsumeIsNewRef.current = true;
+ setDrawer({
+ kind: 'create',
+ ...(share.agent != null ? { agentId: share.agent } : {}),
+ });
+ replaceScheduleShareSearch({ isNew: null });
+ }, []);
+
useEffect(() => {
const syncFromUrl = () => {
const next = filtersFromSearch(window.location.search);
diff --git a/packages/trueforge-ui/src/layouts/SidebarLayout.tsx b/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
index f97f2e289..6c97494a2 100644
--- a/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
+++ b/packages/trueforge-ui/src/layouts/SidebarLayout.tsx
@@ -1,6 +1,15 @@
'use client';
-import { lazy, Suspense, useEffect, useRef, useState } from 'react';
+import {
+ lazy,
+ Suspense,
+ useEffect,
+ useRef,
+ useState,
+ type ComponentPropsWithoutRef,
+ type ReactNode,
+ type Ref,
+} from 'react';
import { useAui } from '../assistant-ui.js';
import { auiButtonClass } from '../atoms/lib/buttonClasses.js';
@@ -10,11 +19,10 @@ import { Spinner } from '../atoms/primitives/Spinner.js';
import { ShellActions } from '../atoms/ShellActions.js';
import { AgentConfigDrawerContainer } from '../containers/AgentConfigDrawerContainer.js';
import { Thread } from '../containers/Thread.js';
-import { ThreadListContainer } from '../containers/ThreadListContainer.js';
import { useChatHeaderContentVisible } from '../hooks/useChatChromeActionsVisible.js';
import { Icon } from '../icons/Icon.js';
import { useOptionalShellMode } from '../server/ShellModeContext.js';
-import { resolveBrandChrome, useBrandName } from '../theme/brand.js';
+import { resolveBrandChrome } from '../theme/brand.js';
import { useSlot } from '../theme/SlotsProvider.js';
import { useBrand } from '../theme/ThemeProvider.js';
@@ -23,38 +31,106 @@ const SchedulesPage = lazy(() =>
import('../atoms/schedules/SchedulesPage.js').then(m => ({ default: m.SchedulesPage })),
);
-// Survives ChatProvider remounts when openDraft / selectAgent bumps runtimeKey.
-let desktopCollapsed = false;
+const brandLogoClassName = 'h-5 w-5 max-w-40 shrink-0 object-contain';
+const railWidthClassName = 'w-20';
-const brandLogoClassName = 'h-5 max-w-40 shrink-0 object-contain';
-
-export function SidebarLayout({ className }: { className?: string }) {
+function SidebarNav(): ReactNode {
const aui = useAui();
const shell = useOptionalShellMode();
+ const AgentsLibraryButton = useSlot('AgentsLibraryButton');
+ const SessionsBrowserButton = useSlot('SessionsBrowserButton');
+ const SchedulesButton = useSlot('SchedulesButton');
+
+ const handleNewChat = () => {
+ shell?.setLibraryOpen(false);
+ shell?.setSessionsOpen(false);
+ if (shell?.isComposerEnabled) {
+ shell.openDraft();
+ return;
+ }
+ shell?.setSettingsOpen(false);
+ shell?.setSchedulesOpen(false);
+ void Promise.resolve(aui.threads().switchToNewThread()).catch(() => undefined);
+ };
+
+ return (
+ <nav className="flex min-h-0 flex-1 flex-col items-center gap-2 p-2" aria-label="Sidebar">
+ {shell?.isNewChatEnabled !== false ? (
+ <button
+ type="button"
+ aria-label="Start new chat"
+ title="New chat"
+ className={auiButtonClass({
+ variant: 'ghost',
+ className:
+ 'h-auto w-full flex-col gap-1 whitespace-normal px-1 py-1.5 text-[10px] leading-tight !justify-center text-text-primary shadow-none hover:bg-ghost-button-hover hover:text-ghost-button-text',
+ })}
+ onClick={handleNewChat}
+ >
+ <Icon name="square-pen" size={16} />
+ <span className="text-center">New Chat</span>
+ </button>
+ ) : null}
+ <AgentsLibraryButton compact />
+ <SessionsBrowserButton compact />
+ <SchedulesButton compact />
+ </nav>
+ );
+}
+
+/** Shared desktop + mobile icon+label rail (brand, nav, footer actions). */
+function SidebarRail({
+ onNavigate,
+ className,
+ railRef,
+ ...dialogProps
+}: {
+ onNavigate?: () => void;
+ className?: string;
+ railRef?: Ref<HTMLElement>;
+} & Omit<ComponentPropsWithoutRef<'aside'>, 'children' | 'className'>): ReactNode {
const brand = useBrand();
- const brandName = useBrandName();
const chrome = resolveBrandChrome(brand);
const BrandLogo = useSlot('BrandLogo');
+
+ return (
+ <aside
+ ref={railRef}
+ className={cn(
+ railWidthClassName,
+ 'flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar-bg',
+ className,
+ )}
+ onClick={event => {
+ if (onNavigate == null) return;
+ const target = event.target;
+ if (!(target instanceof Element)) return;
+ if (target.closest('button') != null) onNavigate();
+ }}
+ {...dialogProps}
+ >
+ <div className="flex h-14 w-full shrink-0 items-center justify-center border-b border-border 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">
+ <ShellActions labeled className="flex-col" />
+ </footer>
+ </aside>
+ );
+}
+
+export function SidebarLayout({ className }: { className?: string }) {
+ const shell = useOptionalShellMode();
const AgentDetailsPage = useSlot('AgentDetailsPage');
const AgentsLibrary = useSlot('AgentsLibrary');
- const AgentsLibraryButton = useSlot('AgentsLibraryButton');
- const SessionsBrowserButton = useSlot('SessionsBrowserButton');
const SessionsPage = useSlot('SessionsPage');
- const SchedulesButton = useSlot('SchedulesButton');
const ClearChatButton = useSlot('ClearChatButton');
const SaveAgentButton = useSlot('SaveAgentButton');
const SelectAgentEmptyState = useSlot('SelectAgentEmptyState');
- const [collapsed, setCollapsed] = useState(desktopCollapsed);
- const setDesktopCollapsed = (value: boolean | ((prev: boolean) => boolean)) => {
- setCollapsed(prev => {
- const next = typeof value === 'function' ? value(prev) : value;
- desktopCollapsed = next;
- return next;
- });
- };
const [mobileNavOpen, setMobileNavOpen] = useState(false);
const menuBtnRef = useRef<HTMLButtonElement>(null);
- const dialogRef = useRef<HTMLDivElement>(null);
+ const dialogRef = useRef<HTMLElement>(null);
const mainRef = useRef<HTMLDivElement>(null);
const wasOpen = useRef(false);
const isIdle = shell?.mode.status === 'idle';
@@ -89,90 +165,18 @@ export function SidebarLayout({ className }: { className?: string }) {
}
}, [mobileNavOpen]);
- const handleNewChat = () => {
- shell?.setLibraryOpen(false);
- shell?.setSessionsOpen(false);
- if (shell?.isComposerEnabled) {
- shell.openDraft();
- return;
- }
- shell?.setSettingsOpen(false);
- shell?.setSchedulesOpen(false);
- void Promise.resolve(aui.threads().switchToNewThread()).catch(() => undefined);
- };
-
return (
<div className={cn('relative flex h-full min-h-0 w-full min-w-0', className)}>
- {/* Desktop sidebar */}
- <aside
- className={cn(
- 'hidden min-h-0 shrink-0 flex-col border-r border-border bg-sidebar-bg transition-[width] duration-300 ease-in-out md:flex',
- collapsed ? 'w-16' : 'w-64',
- )}
- >
- <div
- className={cn('flex shrink-0 items-center px-3 py-3', collapsed ? 'flex-col gap-3' : 'justify-between gap-2')}
- >
- <div className={cn('flex min-w-0 items-center text-text-primary', collapsed ? 'justify-center' : 'gap-2')}>
- <BrandLogo
- variant={collapsed ? chrome.collapsedVariant : chrome.expandedVariant}
- className={cn(brandLogoClassName, (collapsed || chrome.expandedVariant === 'icon') && 'w-5')}
- />
- {!collapsed && chrome.showTitle && brandName != null ? (
- <span className="truncate text-lg font-semibold tracking-tight">{brandName}</span>
- ) : null}
- </div>
- <button
- type="button"
- aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
- title={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
- aria-expanded={!collapsed}
- className={auiButtonClass({ variant: 'ghost', size: 'icon' })}
- onClick={() => setDesktopCollapsed(value => !value)}
- >
- <Icon name={collapsed ? 'panel-left-open' : 'panel-left-close'} />
- </button>
- </div>
-
- {/* Keep both trees mounted; toggle with `hidden` so AgentsLibraryButton does not remount. */}
- <nav className="flex min-h-0 flex-1 flex-col items-center gap-2 px-3" hidden={!collapsed} aria-label="Sidebar">
- {shell?.isNewChatEnabled !== false ? (
- <button
- type="button"
- aria-label="Start new chat"
- title="New chat"
- className={auiButtonClass({ variant: 'ghost', size: 'icon' })}
- onClick={handleNewChat}
- >
- <Icon name="square-pen" />
- </button>
- ) : null}
- <AgentsLibraryButton compact />
- <SessionsBrowserButton compact />
- <SchedulesButton compact />
- </nav>
- <div className="flex min-h-0 flex-1 flex-col overflow-hidden" hidden={collapsed}>
- <ThreadListContainer />
- </div>
-
- <footer
- className={cn(
- 'flex shrink-0 border-t border-border px-3 py-2',
- collapsed ? 'flex-col items-center gap-2' : 'items-center gap-1',
- )}
- >
- <ShellActions className={collapsed ? 'flex-col' : undefined} />
- </footer>
- </aside>
+ <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 aside footer (always mounted). */}
+ Desktop keeps shell chrome in the rail footer (always mounted). */}
<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 Sessions + ShellActions.
+ // (empty untitled draft). Mobile still needs menu + ShellActions.
(overlayOpen || shell?.agentConfigOpen || isIdle || !hasChatHeaderContent) && 'md:hidden',
)}
>
@@ -181,7 +185,7 @@ export function SidebarLayout({ className }: { className?: string }) {
<button
ref={menuBtnRef}
type="button"
- aria-label="Sessions"
+ aria-label="Navigation"
aria-expanded={mobileNavOpen}
className={cn(auiButtonClass({ variant: 'ghost', size: 'icon' }), 'md:hidden')}
onClick={() => setMobileNavOpen(true)}
@@ -258,33 +262,23 @@ export function SidebarLayout({ className }: { className?: string }) {
</aside>
) : null}
- {/* Mobile sessions drawer */}
+ {/* Mobile: same narrow rail as desktop */}
{mobileNavOpen ? (
<>
<button
type="button"
- aria-label="Close sessions"
+ aria-label="Close navigation"
className="absolute inset-0 z-[9] cursor-pointer bg-[var(--overlay)] md:hidden"
onClick={() => setMobileNavOpen(false)}
/>
- <div
- ref={dialogRef}
- className="absolute inset-y-0 left-0 z-10 flex w-full max-w-80 flex-col border-r border-border bg-sidebar-bg shadow-lg outline-none md:hidden"
+ <SidebarRail
+ railRef={dialogRef}
role="dialog"
- aria-label="Sessions"
+ aria-label="Navigation"
tabIndex={-1}
- >
- <div className="flex shrink-0 items-center gap-2 border-b border-border px-3 py-3 text-text-primary">
- <BrandLogo
- variant={chrome.expandedVariant}
- className={cn(brandLogoClassName, chrome.expandedVariant === 'icon' && 'w-5')}
- />
- {chrome.showTitle && brandName != null ? (
- <span className="truncate text-lg font-semibold tracking-tight">{brandName}</span>
- ) : null}
- </div>
- <ThreadListContainer onThreadOpen={() => setMobileNavOpen(false)} />
- </div>
+ onNavigate={() => setMobileNavOpen(false)}
+ className="absolute inset-y-0 left-0 z-10 shadow-lg outline-none md:hidden"
+ />
</>
) : null}
</div>
diff --git a/packages/trueforge-ui/src/routing/types.ts b/packages/trueforge-ui/src/routing/types.ts
index 655ab387e..ff79cefd1 100644
--- a/packages/trueforge-ui/src/routing/types.ts
+++ b/packages/trueforge-ui/src/routing/types.ts
@@ -27,7 +27,7 @@ export type RoutesConfig = {
root?: string;
/** Settings overlay. `false` keeps settings overlay-only (no URL). Default `'/settings'`. */
settings?: string | false;
- /** Agents Library overlay. `false` keeps library overlay-only (no URL). Default `'/library'`. */
+ /** Agents overlay. `false` keeps library overlay-only (no URL). Default `'/library'`. */
library?: string | false;
/** Agent detail under the library. Default `'/library/:agentId'`. */
libraryAgent?: string | false;
diff --git a/packages/trueforge-ui/src/server/ShellModeContext.tsx b/packages/trueforge-ui/src/server/ShellModeContext.tsx
index 6d188c85d..8d165446e 100644
--- a/packages/trueforge-ui/src/server/ShellModeContext.tsx
+++ b/packages/trueforge-ui/src/server/ShellModeContext.tsx
@@ -59,7 +59,7 @@ type ShellModeContextValue = {
mode: ShellMode;
/** Host agentConfig mode (capabilities source). */
agentConfigMode: AgentConfig['mode'];
- /** Agents Library chrome. */
+ /** Agents chrome. */
isLibraryEnabled: boolean;
/** Mutable composer / Save Agent chrome (host capability). */
isComposerEnabled: boolean;
@@ -70,7 +70,7 @@ type ShellModeContextValue = {
setSettingsOpen: (open: boolean, section?: SettingsSection) => void;
agentConfigOpen: boolean;
setAgentConfigOpen: (open: boolean) => void;
- /** Agents Library main-pane overlay (sidebar layout). */
+ /** Agents main-pane overlay (sidebar layout). */
libraryOpen: boolean;
libraryAgentId: string | null;
setLibraryAgentId: (id: string | null) => void;
@@ -83,7 +83,7 @@ type ShellModeContextValue = {
schedulesOpen: boolean;
setSchedulesOpen: (open: boolean) => void;
/**
- * Bind from the Agents Library (Try = immutable, Edit = mutable + agentSpec).
+ * Bind from Agents (Try = immutable, Edit = mutable + agentSpec).
* Prefer this over `selectAgent` / `openDraft` when both fields are available.
*/
selectLibraryAgent: (req: SelectLibraryAgentRequest) => void;
@@ -107,7 +107,7 @@ type ShellModeContextValue = {
openHistorySession: (req: { sessionId: string; agentName?: string; isMutable?: boolean }) => void;
/** Reset current chat; no-op when idle. */
clearChat: () => void;
- /** Return pure Agents Library to its idle landing; no-op in other modes. */
+ /** Return library-only mode to its idle landing; no-op in other modes. */
openLibraryHome: () => void;
/** Remount key for the chat runtime when binding changes. */
runtimeKey: string;
@@ -122,7 +122,7 @@ type ShellModeContextValue = {
/** Session to open after a binding remount (history click across mutability). */
pendingSessionId: string | undefined;
/**
- * Bumped when the Agents Library catalog may have changed (e.g. after saveAgent).
+ * Bumped when the Agents catalog may have changed (e.g. after saveAgent).
* Library chrome should re-fetch when this changes.
*/
agentsListEpoch: number;
@@ -505,7 +505,7 @@ export function ShellModeProvider({
}, [effectiveMode, bumpEpoch]);
const openLibraryHome = useCallback(() => {
- // Only pure Agents Library has an idle landing; other modes root via openDraft / clearChat.
+ // Only library-only mode has an idle landing; other modes root via openDraft / clearChat.
if (!isLibraryEnabled || isComposerEnabled) return;
setPendingSessionId(undefined);
setSettingsOpen(false);
diff --git a/packages/trueforge-ui/src/utils/scheduleShareUrl.ts b/packages/trueforge-ui/src/utils/scheduleShareUrl.ts
index ddc9e13dc..333f6a4c6 100644
--- a/packages/trueforge-ui/src/utils/scheduleShareUrl.ts
+++ b/packages/trueforge-ui/src/utils/scheduleShareUrl.ts
@@ -3,6 +3,7 @@ import type { ScheduleStatus } from '../server/types.js';
export const SCHEDULE_AGENT_QUERY = 'agent';
export const SCHEDULE_STATUS_QUERY = 'status';
export const SCHEDULE_NAME_QUERY = 'q';
+export const SCHEDULE_IS_NEW_QUERY = 'isNew';
export const SCHEDULE_SHARE_CHANGE_EVENT = 'trueforge-schedule-share';
@@ -13,12 +14,15 @@ export type ScheduleShareSearch = {
status: ScheduleStatus | null;
/** Name search; `null` when empty. */
q: string | null;
+ /** One-shot flag to open the create schedule drawer. */
+ isNew: boolean;
};
export type ScheduleShareWrite = {
agent?: string | null;
status?: ScheduleStatus | null;
q?: string | null;
+ isNew?: boolean | null;
};
function nonEmpty(value: string | null): string | null {
@@ -36,6 +40,7 @@ export function readScheduleShareSearch(search: string): ScheduleShareSearch {
agent: nonEmpty(params.get(SCHEDULE_AGENT_QUERY)),
status: parseStatus(params.get(SCHEDULE_STATUS_QUERY)),
q: nonEmpty(params.get(SCHEDULE_NAME_QUERY)),
+ isNew: params.get(SCHEDULE_IS_NEW_QUERY) === 'true',
};
}
@@ -46,6 +51,8 @@ export function writeScheduleShareSearch(params: URLSearchParams, next: Schedule
else if (next.status != null) params.set(SCHEDULE_STATUS_QUERY, next.status);
if (next.q === null) params.delete(SCHEDULE_NAME_QUERY);
else if (next.q != null) params.set(SCHEDULE_NAME_QUERY, next.q);
+ if (next.isNew === null || next.isNew === false) params.delete(SCHEDULE_IS_NEW_QUERY);
+ else if (next.isNew === true) params.set(SCHEDULE_IS_NEW_QUERY, 'true');
}
/** Drop all schedules-owned query keys (used when leaving the schedules place). */
@@ -53,6 +60,7 @@ export function clearScheduleShareSearch(params: URLSearchParams): void {
params.delete(SCHEDULE_AGENT_QUERY);
params.delete(SCHEDULE_STATUS_QUERY);
params.delete(SCHEDULE_NAME_QUERY);
+ params.delete(SCHEDULE_IS_NEW_QUERY);
}
export function replaceScheduleShareSearch(next: ScheduleShareWrite): string {
diff --git a/packages/trueforge-ui/test/atoms/AgentsLibrary.test.tsx b/packages/trueforge-ui/test/atoms/AgentsLibrary.test.tsx
index 5b8d27d45..37ca7fcee 100644
--- a/packages/trueforge-ui/test/atoms/AgentsLibrary.test.tsx
+++ b/packages/trueforge-ui/test/atoms/AgentsLibrary.test.tsx
@@ -145,7 +145,7 @@ describe('AgentsLibrary', () => {
renderLibrary(<LibraryHarness onSelectAgent={onSelectAgent} />, { server });
fireEvent.click(screen.getByRole('button', { name: 'Open library' }));
- expect(screen.getByRole('heading', { name: 'Agents Library' })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: 'Agents' })).toBeInTheDocument();
await waitFor(() => {
expect(screen.getByRole('button', { name: 'Try agent alpha-agent' })).toBeInTheDocument();
});
@@ -153,7 +153,7 @@ describe('AgentsLibrary', () => {
fireEvent.click(screen.getByRole('button', { name: 'Try agent beta-agent' }));
expect(onSelectAgent).toHaveBeenCalledWith('beta-agent');
await waitFor(() => {
- expect(screen.queryByRole('heading', { name: 'Agents Library' })).not.toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Agents' })).not.toBeInTheDocument();
});
});
@@ -264,15 +264,15 @@ describe('AgentsLibrary', () => {
renderLibrary(<LibraryHarness />);
fireEvent.click(screen.getByRole('button', { name: 'Open library' }));
- expect(screen.getByRole('heading', { name: 'Agents Library' })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { name: 'Agents' })).toBeInTheDocument();
fireEvent.keyDown(window, { key: 'Escape' });
- expect(screen.queryByRole('heading', { name: 'Agents Library' })).not.toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Agents' })).not.toBeInTheDocument();
});
});
describe('AgentsLibraryButton', () => {
- it('opens the Agents Library panel from the trigger', async () => {
+ it('opens the Agents panel from the trigger', async () => {
const server = mockServer([{ name: 'alpha-agent', agentId: 'alpha-agent' }]);
renderLibrary(
@@ -283,9 +283,9 @@ describe('AgentsLibraryButton', () => {
{ server },
);
- fireEvent.click(screen.getByRole('button', { name: /Agents Library/ }));
- expect(screen.getByRole('heading', { name: 'Agents Library' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: /Agents Library/ })).toHaveAttribute('aria-current', 'page');
+ fireEvent.click(screen.getByRole('button', { name: /Agents/ }));
+ expect(screen.getByRole('heading', { name: 'Agents' })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Agents/ })).toHaveAttribute('aria-current', 'page');
await waitFor(() => {
expect(screen.getByRole('button', { name: 'Try agent alpha-agent' })).toBeInTheDocument();
});
@@ -319,13 +319,13 @@ describe('AgentsLibraryButton', () => {
);
await waitFor(() => {
- expect(screen.getByRole('button', { name: /Agents Library \(1\)/ })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Agents \(1\)/ })).toBeInTheDocument();
});
fireEvent.click(screen.getByRole('button', { name: 'Invalidate' }));
await waitFor(() => {
- expect(screen.getByRole('button', { name: /Agents Library \(2\)/ })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Agents \(2\)/ })).toBeInTheDocument();
});
expect(searchAgents).toHaveBeenCalledTimes(2);
});
@@ -340,7 +340,7 @@ describe('AgentsLibraryButton', () => {
renderLibrary(<AgentsLibraryButton />, { server });
await waitFor(() => {
- expect(screen.getByRole('button', { name: /Agents Library \(50\+\)/ })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Agents \(50\+\)/ })).toBeInTheDocument();
});
});
@@ -350,7 +350,7 @@ describe('AgentsLibraryButton', () => {
renderLibrary(<AgentsLibraryButton compact />, { server });
- expect(screen.getByRole('button', { name: 'Agents Library' })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Agents' })).toBeInTheDocument();
expect(searchAgents).not.toHaveBeenCalled();
});
@@ -424,11 +424,13 @@ describe('AgentsLibraryButton', () => {
fireEvent.click(addSchedule);
expect(screen.getByTestId('schedules-open')).toHaveTextContent('yes');
expect(new URL(window.location.href).searchParams.get('agent')).toBe('beta-agent');
+ expect(new URL(window.location.href).searchParams.get('isNew')).toBe('true');
fireEvent.click(screen.getByRole('button', { name: 'Open library' }));
await screen.findByRole('button', { name: /2 schedules for alpha-agent/ });
fireEvent.click(screen.getByRole('button', { name: /2 schedules for alpha-agent/ }));
expect(new URL(window.location.href).searchParams.get('agent')).toBe('alpha-agent');
+ expect(new URL(window.location.href).searchParams.get('isNew')).toBeNull();
});
it('does not show an empty-schedules action before schedule counts load', async () => {
diff --git a/packages/trueforge-ui/test/atoms/schedules/SchedulesPage.test.tsx b/packages/trueforge-ui/test/atoms/schedules/SchedulesPage.test.tsx
index 6678af6b4..d7adcbb03 100644
--- a/packages/trueforge-ui/test/atoms/schedules/SchedulesPage.test.tsx
+++ b/packages/trueforge-ui/test/atoms/schedules/SchedulesPage.test.tsx
@@ -366,4 +366,15 @@ describe('SchedulesPage', () => {
fireEvent.click(await screen.findByRole('button', { name: 'Filter by agent' }));
expect(screen.getByRole('option', { name: 'Agent 51' })).toBeInTheDocument();
});
+
+ it('opens the create drawer from isNew=true then clears the flag', async () => {
+ window.history.replaceState(null, '', '/schedules?agent=demo-agent&isNew=true');
+ renderPage();
+
+ expect(await screen.findByRole('heading', { name: 'New Schedule' })).toBeInTheDocument();
+ await waitFor(() => {
+ expect(new URL(window.location.href).searchParams.get('isNew')).toBeNull();
+ });
+ expect(new URL(window.location.href).searchParams.get('agent')).toBe('demo-agent');
+ });
});
diff --git a/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx b/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
index 001d4f8ec..9c46f169d 100644
--- a/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
+++ b/packages/trueforge-ui/test/containers/TrueForgeUI.test.tsx
@@ -100,7 +100,8 @@ describe('TrueForgeUI', () => {
await waitFor(() => {
switch (layout) {
case 'sidebar':
- expect(screen.getByRole('button', { name: /^(Collapse|Expand) sidebar$/ })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Start new chat' })).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /^(Collapse|Expand) sidebar$/ })).not.toBeInTheDocument();
break;
case 'drawer':
expect(screen.getByRole('button', { name: 'New chat' })).toBeInTheDocument();
@@ -351,7 +352,7 @@ describe('StackChatPanel', () => {
});
describe('SidebarLayout', () => {
- it('shows the app brand in the mobile sessions drawer', () => {
+ it('shows the app brand in the mobile navigation drawer', () => {
render(
<SlotsProvider theme={{ brand: { mode: 'icon-title', name: 'Acme', icon: { src: '/acme.svg' } } }}>
<RuntimeHarness messages={[]}>
@@ -362,14 +363,17 @@ describe('SidebarLayout', () => {
</SlotsProvider>,
);
- fireEvent.click(screen.getByRole('button', { name: 'Sessions' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Navigation' }));
- const drawer = screen.getByRole('dialog', { name: 'Sessions' });
- expect(within(drawer).getByText('Acme')).toBeInTheDocument();
+ const drawer = screen.getByRole('dialog', { name: 'Navigation' });
+ expect(drawer).toHaveClass('w-20');
expect(within(drawer).getByAltText('Acme')).toHaveAttribute('src', '/acme.svg');
+ expect(within(drawer).queryByText('Acme')).not.toBeInTheDocument();
+ expect(within(drawer).getByRole('button', { name: 'Start new chat' })).toBeInTheDocument();
+ expect(within(drawer).queryByText('No threads yet')).not.toBeInTheDocument();
});
- it('shows the default wordmark without a name in expanded chrome', () => {
+ it('shows the default icon mark in the permanent rail', () => {
const { container } = render(
<SlotsProvider>
<RuntimeHarness messages={[]}>
@@ -381,11 +385,12 @@ describe('SidebarLayout', () => {
);
const mark = container.querySelector('aside svg');
- expect(mark).toHaveAttribute('viewBox', '0 0 614 100');
+ expect(mark).toHaveAttribute('viewBox', '0 0 140 140');
expect(screen.queryByText('TrueForge')).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /^(Collapse|Expand) sidebar$/ })).not.toBeInTheDocument();
});
- it('shows a wide logo when expanded and its square icon when collapsed', () => {
+ it('uses the square brand icon in the rail (not the wide wordmark)', () => {
const { container } = render(
<SlotsProvider
theme={{ brand: { mode: 'logo', name: 'Acme', icon: '/acme-icon.svg', logo: '/acme-wordmark.svg' } }}
@@ -398,16 +403,11 @@ describe('SidebarLayout', () => {
</SlotsProvider>,
);
- expect(container.querySelector('aside img')).toHaveAttribute('src', '/acme-wordmark.svg');
- expect(screen.queryByText('Acme')).not.toBeInTheDocument();
-
- fireEvent.click(screen.getByRole('button', { name: 'Collapse sidebar' }));
expect(container.querySelector('aside img')).toHaveAttribute('src', '/acme-icon.svg');
-
- fireEvent.click(screen.getByRole('button', { name: 'Expand sidebar' }));
+ expect(screen.queryByText('Acme')).not.toBeInTheDocument();
});
- it('supports icon-only branding in expanded chrome', () => {
+ it('supports icon-only branding in the rail', () => {
const { container } = render(
<SlotsProvider theme={{ brand: { mode: 'icon-only', name: 'Acme', icon: '/acme-icon.svg' } }}>
<RuntimeHarness messages={[]}>
@@ -423,8 +423,8 @@ describe('SidebarLayout', () => {
expect(screen.queryByText('Acme')).not.toBeInTheDocument();
});
- it('shows the brand and toggles the desktop sidebar rail', () => {
- const { unmount } = render(
+ it('shows a permanent labeled rail with New Chat and no expand control', () => {
+ const { container } = render(
<SlotsProvider theme={{ brand: { mode: 'icon-title', name: 'Acme', icon: '/acme.svg' } }}>
<RuntimeHarness messages={[]}>
<div className="h-96">
@@ -434,25 +434,11 @@ describe('SidebarLayout', () => {
</SlotsProvider>,
);
- expect(screen.getByText('Acme')).toBeInTheDocument();
- fireEvent.click(screen.getByRole('button', { name: 'Collapse sidebar' }));
-
+ expect(container.querySelector('aside img')).toHaveAttribute('src', '/acme.svg');
expect(screen.queryByText('Acme')).not.toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Expand sidebar' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Start new chat' })).toBeInTheDocument();
-
- // New Chat / Agents remount ChatProvider via runtimeKey; collapse must survive.
- unmount();
- render(
- <SlotsProvider theme={{ brand: { mode: 'icon-title', name: 'Acme', icon: '/acme.svg' } }}>
- <RuntimeHarness messages={[]}>
- <div className="h-96">
- <SidebarLayout />
- </div>
- </RuntimeHarness>
- </SlotsProvider>,
- );
- expect(screen.getByRole('button', { name: 'Expand sidebar' })).toBeInTheDocument();
+ expect(screen.getByText('New Chat')).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /^(Collapse|Expand) sidebar$/ })).not.toBeInTheDocument();
});
it('toggles theme from the footer and shows settings only when catalog is provided', async () => {
@@ -471,11 +457,7 @@ describe('SidebarLayout', () => {
);
expect(screen.getAllByRole('button', { name: 'Settings' })).toHaveLength(2);
- const expandButton = screen.queryByRole('button', { name: 'Expand sidebar' });
- if (expandButton != null) {
- fireEvent.click(expandButton);
- }
- expect(await screen.findAllByRole('button', { name: 'Agents Library (0)' })).not.toHaveLength(0);
+ 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');
diff --git a/packages/trueforge-ui/test/utils/scheduleShareUrl.test.ts b/packages/trueforge-ui/test/utils/scheduleShareUrl.test.ts
index 13038083f..5980134b4 100644
--- a/packages/trueforge-ui/test/utils/scheduleShareUrl.test.ts
+++ b/packages/trueforge-ui/test/utils/scheduleShareUrl.test.ts
@@ -7,24 +7,29 @@ import {
} from '@/utils/scheduleShareUrl.js';
describe('scheduleShareUrl', () => {
- it('reads agent, status, and q from the search string', () => {
- expect(readScheduleShareSearch('?agent=alpha&status=paused&q=digest&theme=dark')).toEqual({
+ it('reads agent, status, q, and isNew from the search string', () => {
+ expect(readScheduleShareSearch('?agent=alpha&status=paused&q=digest&isNew=true&theme=dark')).toEqual({
agent: 'alpha',
status: 'paused',
q: 'digest',
+ isNew: true,
});
- expect(readScheduleShareSearch('?status=nope&agent=')).toEqual({
+ expect(readScheduleShareSearch('?status=nope&agent=&isNew=1')).toEqual({
agent: null,
status: null,
q: null,
+ isNew: false,
});
});
it('writes and clears schedule-owned keys without touching host keys', () => {
- const params = new URLSearchParams('theme=dark&agent=old&q=x');
- writeScheduleShareSearch(params, { agent: 'alpha', status: 'active', q: null });
+ const params = new URLSearchParams('theme=dark&agent=old&q=x&isNew=true');
+ writeScheduleShareSearch(params, { agent: 'alpha', status: 'active', q: null, isNew: null });
expect(params.toString()).toBe('theme=dark&agent=alpha&status=active');
+ writeScheduleShareSearch(params, { isNew: true });
+ expect(params.get('isNew')).toBe('true');
+
clearScheduleShareSearch(params);
expect(params.toString()).toBe('theme=dark');
});