Skip to content

Commit d0bd796

Browse files
bloveclaude
andcommitted
refactor(chat,langgraph): polish Phase-1 review nits
- Drop unused ref inputs on DebugControlsComponent and DebugSummaryComponent - Consolidate fragmented @cacheplane/chat imports in chat-debug - Route cockpit messages/input demos through chatAgent.submit Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 599bc45 commit d0bd796

5 files changed

Lines changed: 14 additions & 16 deletions

File tree

cockpit/chat/input/angular/src/app/input.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ export class InputComponent {
6262
protected readonly isLoading = computed(() => this.stream.isLoading());
6363

6464
submitMessage(content: string) {
65-
this.stream.submit([{ role: 'human', content }]);
65+
this.chatAgent.submit({ message: content });
6666
}
6767
}

cockpit/chat/messages/angular/src/app/messages.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ export class MessagesComponent {
5454
protected readonly chatAgent = toChatAgent(this.stream);
5555

5656
submitMessage(content: string) {
57-
this.stream.submit([{ role: 'human', content }]);
57+
this.chatAgent.submit({ message: content });
5858
}
5959
}

libs/langgraph/src/lib/compositions/chat-debug/chat-debug.component.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@ import {
1414
import { DomSanitizer } from '@angular/platform-browser';
1515
import type { AgentRef } from '../../agent.types';
1616
import { toChatAgent } from '../../to-chat-agent';
17-
import { ChatMessagesComponent } from '@cacheplane/chat';
18-
import { MessageTemplateDirective } from '@cacheplane/chat';
19-
import { ChatInputComponent } from '@cacheplane/chat';
20-
import { ChatTypingIndicatorComponent } from '@cacheplane/chat';
21-
import { ChatErrorComponent } from '@cacheplane/chat';
17+
import {
18+
ChatMessagesComponent,
19+
MessageTemplateDirective,
20+
ChatInputComponent,
21+
ChatTypingIndicatorComponent,
22+
ChatErrorComponent,
23+
messageContent,
24+
CHAT_THEME_STYLES,
25+
CHAT_MARKDOWN_STYLES,
26+
renderMarkdown,
27+
} from '@cacheplane/chat';
2228
import { DebugTimelineComponent } from './debug-timeline.component';
2329
import { DebugDetailComponent } from './debug-detail.component';
2430
import { DebugControlsComponent } from './debug-controls.component';
2531
import { DebugSummaryComponent } from './debug-summary.component';
2632
import type { DebugCheckpoint } from './debug-checkpoint-card.component';
2733
import { toDebugCheckpoint, extractStateValues } from './debug-utils';
28-
import { messageContent } from '@cacheplane/chat';
29-
import { CHAT_THEME_STYLES } from '@cacheplane/chat';
30-
import { CHAT_MARKDOWN_STYLES, renderMarkdown } from '@cacheplane/chat';
3134

3235
@Component({
3336
selector: 'chat-debug',
@@ -149,13 +152,12 @@ import { CHAT_MARKDOWN_STYLES, renderMarkdown } from '@cacheplane/chat';
149152
150153
<!-- Summary -->
151154
<div class="px-3 py-2 border-b" style="border-color: var(--chat-border-light);">
152-
<chat-debug-summary [ref]="ref()" [checkpoints]="checkpoints()" />
155+
<chat-debug-summary [checkpoints]="checkpoints()" />
153156
</div>
154157
155158
<!-- Controls -->
156159
<div class="px-3 py-2 border-b" style="border-color: var(--chat-border-light);">
157160
<chat-debug-controls
158-
[ref]="ref()"
159161
[checkpointCount]="checkpoints().length"
160162
[selectedIndex]="selectedCheckpointIndex()"
161163
(stepForward)="stepForward()"

libs/langgraph/src/lib/compositions/chat-debug/debug-controls.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
output,
66
ChangeDetectionStrategy,
77
} from '@angular/core';
8-
import type { AgentRef } from '../../agent.types';
98

109
@Component({
1110
selector: 'chat-debug-controls',
@@ -41,7 +40,6 @@ import type { AgentRef } from '../../agent.types';
4140
`,
4241
})
4342
export class DebugControlsComponent {
44-
readonly ref = input.required<AgentRef<any, any>>();
4543
readonly checkpointCount = input<number>(0);
4644
readonly selectedIndex = input<number>(-1);
4745
readonly stepForward = output<void>();

libs/langgraph/src/lib/compositions/chat-debug/debug-summary.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
input,
66
ChangeDetectionStrategy,
77
} from '@angular/core';
8-
import type { AgentRef } from '../../agent.types';
98
import type { DebugCheckpoint } from './debug-checkpoint-card.component';
109

1110
@Component({
@@ -20,7 +19,6 @@ import type { DebugCheckpoint } from './debug-checkpoint-card.component';
2019
`,
2120
})
2221
export class DebugSummaryComponent {
23-
readonly ref = input.required<AgentRef<any, any>>();
2422
readonly checkpoints = input<DebugCheckpoint[]>([]);
2523

2624
readonly totalDuration = computed(() =>

0 commit comments

Comments
 (0)