|
| 1 | +import type { ProgressCard } from "@openclaw/gateway-protocol"; |
1 | 2 | import { html, nothing } from "lit"; |
2 | 3 | import { findInlineApproval } from "../../app/approval-presentation.ts"; |
3 | 4 | import { hasOperatorAdminAccess, hasOperatorWriteAccess } from "../../app/operator-access.ts"; |
@@ -181,7 +182,7 @@ export class ChatPane extends ChatPaneLayoutRender { |
181 | 182 | hasOperatorWriteAccess(gatewaySnapshot.hello?.auth ?? null) && |
182 | 183 | isGatewayMethodAdvertised(gatewaySnapshot, "progressCard.put") === true; |
183 | 184 | const onDismissProgressCard = canDismissProgressCard |
184 | | - ? (card: NonNullable<ChatProps["progressCard"]>) => { |
| 185 | + ? (card: ProgressCard) => { |
185 | 186 | void this.progressCard |
186 | 187 | .dismiss(card) |
187 | 188 | .catch(() => showToast({ message: t("sessionProgressCard.dismissFailed") })); |
@@ -225,16 +226,22 @@ export class ChatPane extends ChatPaneLayoutRender { |
225 | 226 | ? t("chat.catalog.remoteViewOnly") |
226 | 227 | : t("chat.catalog.unsupportedViewOnly") |
227 | 228 | : null; |
228 | | - const { backgroundTasks, closePanelSlot, openPanelSlot, progressCardInRail, sessionWorkspace } = |
229 | | - createChatPaneRails({ |
230 | | - state, |
231 | | - sidebarLayout, |
232 | | - paneWidth: this.paneWidth, |
233 | | - presentationId: this.presentationId, |
234 | | - presented: this.presented, |
235 | | - gatewaySnapshot, |
236 | | - setObserverVisibility: this.setSessionObserverVisibility, |
237 | | - }); |
| 229 | + const { |
| 230 | + backgroundTasks, |
| 231 | + closePanelSlot, |
| 232 | + openPanelSlot, |
| 233 | + progressCardPlacement, |
| 234 | + sessionWorkspace, |
| 235 | + } = createChatPaneRails({ |
| 236 | + state, |
| 237 | + sidebarLayout, |
| 238 | + paneWidth: this.paneWidth, |
| 239 | + composerGutter: this.composerGutter.width, |
| 240 | + presentationId: this.presentationId, |
| 241 | + presented: this.presented, |
| 242 | + gatewaySnapshot, |
| 243 | + setObserverVisibility: this.setSessionObserverVisibility, |
| 244 | + }); |
238 | 245 | const selfUser = resolveCurrentSelfUser({ |
239 | 246 | snapshotUser: gatewaySnapshot.selfUser, |
240 | 247 | presenceEntries: readPresenceEntries(gatewaySnapshot.hello?.snapshot), |
@@ -315,7 +322,10 @@ export class ChatPane extends ChatPaneLayoutRender { |
315 | 322 | waitingApproval: state.waitingApprovalStatuses.size > 0, |
316 | 323 | compactionStatus: state.compactionStatus, |
317 | 324 | fallbackStatus: state.fallbackStatus, |
318 | | - progressCard: progressCardInRail ? null : this.progressCard.card, |
| 325 | + progressCard: |
| 326 | + progressCardPlacement === "rail" || !this.progressCard.card |
| 327 | + ? null |
| 328 | + : { card: this.progressCard.card, placement: progressCardPlacement }, |
319 | 329 | onDismissProgressCard, |
320 | 330 | gatewayQuestionPrompts: catalogKey || sessionParticipationBlocked ? [] : this.questionPrompts, |
321 | 331 | onGatewayQuestionChange: () => { |
@@ -639,7 +649,7 @@ export class ChatPane extends ChatPaneLayoutRender { |
639 | 649 | currentAgentId, |
640 | 650 | board, |
641 | 651 | sidebarLayout, |
642 | | - progressCardInRail, |
| 652 | + progressCardPlacement, |
643 | 653 | onDismissProgressCard, |
644 | 654 | sessionWorkspace, |
645 | 655 | backgroundTasks, |
|
0 commit comments