fix(chat): enable in-place subtask navigation in embedded session-chat iframe (#2138)
This commit is contained in:
@@ -53,6 +53,7 @@ import {
|
||||
sendImplementationResponseToReviewer,
|
||||
sendReviewFeedbackToOriginal,
|
||||
} from '@/lib/reviewFlow';
|
||||
import { isEmbeddedSessionChat } from '@/components/layout/contextPanelEmbeddedChat';
|
||||
|
||||
|
||||
const CONTAIN_LAYOUT_STYLE = { contain: 'layout' as const, transform: 'translateZ(0)' };
|
||||
@@ -252,7 +253,11 @@ const UserSubtaskPart: React.FC<{ part: SubtaskPartLike }> = ({ part }) => {
|
||||
className="typography-meta text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2"
|
||||
onClick={() => {
|
||||
if (!effectiveDirectory) return;
|
||||
if (isMobile || isVSCodeRuntime()) {
|
||||
// In contexts with no ContextPanel (embedded
|
||||
// session-chat iframe) or single-surface layouts
|
||||
// (mobile, VS Code), navigate in place. Otherwise
|
||||
// open a new side-panel tab.
|
||||
if (isEmbeddedSessionChat() || isMobile || isVSCodeRuntime()) {
|
||||
setCurrentSession(taskSessionID, effectiveDirectory);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import { readTaskTagSessionIdFromOutput } from './taskSessionIdParser';
|
||||
import { areRenderRelevantPartsEqual } from '../renderCompare';
|
||||
import { useI18n } from '@/lib/i18n';
|
||||
import { getDiffPatchEntries, getPatchText, type DiffPatchEntry } from './toolDiffUtils';
|
||||
import { isEmbeddedSessionChat } from '@/components/layout/contextPanelEmbeddedChat';
|
||||
|
||||
const TOOL_ROW_TEXT_CLASS = '!text-[length:var(--text-meta)] !leading-5 sm:!leading-6 tracking-normal';
|
||||
const TOOL_ROW_TITLE_CLASS = cn('typography-meta font-medium', TOOL_ROW_TEXT_CLASS);
|
||||
@@ -1374,7 +1375,10 @@ const TaskToolSummary: React.FC<{
|
||||
const handleOpenSession = (event: React.MouseEvent) => {
|
||||
event.stopPropagation();
|
||||
if (sessionId && currentDirectory) {
|
||||
if (isMobile || runtime?.runtime.isVSCode) {
|
||||
// In contexts with no ContextPanel (embedded session-chat iframe)
|
||||
// or single-surface layouts (mobile, VS Code), navigate in place.
|
||||
// Otherwise open a new side-panel tab.
|
||||
if (isEmbeddedSessionChat() || isMobile || runtime?.runtime.isVSCode) {
|
||||
setCurrentSession(sessionId, currentDirectory);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user