ChatThreadSidebarComponent

A conversation sidebar connected to a ThreadDirectory: New chat, Projects, Recent and Archived with the row commands the directory supports. It refreshes on mount and, given an agent, after each run. Place it in the sidenavSections slot of <chat-sidenav> or use it on its own.

The directory is app-owned: the sidebar subscribes to it and releases that subscription on destroy, but never calls dispose().

newChat replaces the default New chat: with no listener, New chat calls directory.create() and emits threadSelected with the new id. Without a listener or a create command, the button is omitted. activeThreadRemoved fires after the conversation that was active is deleted.

Content: [chatThreadSidebarBefore] and [chatThreadSidebarAfter] place app sections around the built-in ones, and ng-template[chatThreadRow] replaces each conversation row.

import { ChatThreadSidebarComponent } from '@threadplane/chat';

Declaration

export declare class ChatThreadSidebarComponent  {
  constructor();
  readonly activeThreadId: import("@angular/core").InputSignal<string | null>;
  readonly activeThreadRemoved: import("@angular/core").OutputEmitterRef<void>;
  readonly agent: import("@angular/core").InputSignal<Agent<unknown> | null>;
  readonly directory: import("@angular/core").InputSignal<ThreadDirectory>;
  readonly extraActions: import("@angular/core").InputSignal<readonly ThreadRowAction[] | null>;
  readonly features: import("@angular/core").InputSignal<ThreadSidebarFeatures | null>;
  readonly labels: import("@angular/core").InputSignal<Partial<Record<ThreadSidebarLabelKey, string>> | null>;
  readonly newChat: import("@angular/core").OutputRef<void>;
  readonly projectSelected: import("@angular/core").OutputEmitterRef<string | null>;
  readonly selectedProjectId: import("@angular/core").InputSignal<string | null>;
  readonly threadSelected: import("@angular/core").OutputEmitterRef<string>;
}

Angular template API

Selector: chat-thread-sidebar

Inputs

activeThreadId
string | null
agent
Agent<unknown> | null
directory · required
ThreadDirectory
extraActions
readonly ThreadRowAction[] | null
features
ThreadSidebarFeatures | null
labels
Partial<Record<ThreadSidebarLabelKey, string>> | null
selectedProjectId
string | null

Outputs

activeThreadRemoved
void
newChat
OutputRef<void>
projectSelected
string | null
threadSelected
string

Examples

<chat-thread-sidebar
  [directory]="threads.directory"
  [agent]="agent"
  [activeThreadId]="threadId()"
  (threadSelected)="threadId.set($event)"
  (activeThreadRemoved)="threadId.set(null)"
/>

Members

Constructor · overload 1

Constructs a new instance of the ChatThreadSidebarComponent class

constructor();

activeThreadId

readonly activeThreadId: import("@angular/core").InputSignal<string | null>;

activeThreadRemoved

Emits after the conversation that was active when the delete was confirmed is removed.

readonly activeThreadRemoved: import("@angular/core").OutputEmitterRef<void>;

agent

Refreshes the directory each time a run ends.

readonly agent: import("@angular/core").InputSignal<Agent<unknown> | null>;

directory

App-owned; the sidebar never disposes it.

readonly directory: import("@angular/core").InputSignal<ThreadDirectory>;

extraActions

App commands appended to each conversation row menu.

readonly extraActions: import("@angular/core").InputSignal<readonly ThreadRowAction[] | null>;

features

readonly features: import("@angular/core").InputSignal<ThreadSidebarFeatures | null>;

labels

readonly labels: import("@angular/core").InputSignal<Partial<Record<ThreadSidebarLabelKey, string>> | null>;

newChat

Replaces the default New chat, which creates a thread and selects it.

readonly newChat: import("@angular/core").OutputRef<void>;

projectSelected

Emits null after the selected project is removed; otherwise the app decides what clears a project.

readonly projectSelected: import("@angular/core").OutputEmitterRef<string | null>;

selectedProjectId

When a project id, Recent and Archived list only that project's threads; null lists every thread.

readonly selectedProjectId: import("@angular/core").InputSignal<string | null>;

threadSelected

readonly threadSelected: import("@angular/core").OutputEmitterRef<string>;