Skip to content

Commit e676d8a

Browse files
committed
🤖 Merge main: resolve conflicts and integrate ModelDisplay
1 parent 643674d commit e676d8a

File tree

2 files changed

+19
-53
lines changed

2 files changed

+19
-53
lines changed

src/components/AIViewPreview.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ export const AIViewPreview: React.FC<AIViewPreviewProps> = ({
8585
maxMessages = 6,
8686
className,
8787
}) => {
88-
const merged = useMemo(() => mergeConsecutiveStreamErrors(workspaceState.messages), [
89-
workspaceState.messages,
90-
]);
88+
const merged = useMemo(
89+
() => mergeConsecutiveStreamErrors(workspaceState.messages),
90+
[workspaceState.messages]
91+
);
9192

9293
// Select only the last N messages for brevity
93-
const messages = useMemo(() => merged.slice(Math.max(0, merged.length - maxMessages)), [
94-
merged,
95-
maxMessages,
96-
]);
94+
const messages = useMemo(
95+
() => merged.slice(Math.max(0, merged.length - maxMessages)),
96+
[merged, maxMessages]
97+
);
9798

9899
return (
99100
<ChatProvider
@@ -134,4 +135,3 @@ export const AIViewPreview: React.FC<AIViewPreviewProps> = ({
134135
</ChatProvider>
135136
);
136137
};
137-

src/components/ProjectSidebar.tsx

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,24 +1044,18 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
10441044
data-workspace-path={workspace.path}
10451045
data-workspace-id={workspaceId}
10461046
>
1047+
{/* Hover preview tooltip (does not steal hover) */}
10471048
<Tooltip className="tooltip" align="right" width="wide">
1048-
{/* Lazy import to avoid bundle growth in main path */}
1049-
{/* We avoid dynamic imports per repo rules; component is small */}
1050-
{/* Render compact AIViewPreview inside tooltip for hover glance */}
1051-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
1052-
{/* @ts-ignore - imported at top-level */}
1053-
{(() => {
1054-
// Inline require to avoid circulars; still static import at file top not allowed per size?
1055-
// We already created component at src/components/AIViewPreview.tsx
1056-
// Importing statically:
1057-
return null;
1058-
})()}
1049+
<AIViewPreview {...previewProps} />
10591050
</Tooltip>
10601051
<TooltipWrapper inline>
10611052
<WorkspaceRemoveBtn
10621053
onClick={(e) => {
10631054
e.stopPropagation();
1064-
void handleRemoveWorkspace(workspaceId, e.currentTarget);
1055+
void handleRemoveWorkspace(
1056+
workspaceId,
1057+
e.currentTarget
1058+
);
10651059
}}
10661060
aria-label={`Remove workspace ${displayName}`}
10671061
data-workspace-id={workspaceId}
@@ -1077,7 +1071,6 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
10771071
workspaceId={workspaceId}
10781072
tooltipPosition="right"
10791073
/>
1080-
/>
10811074
{isEditing ? (
10821075
<WorkspaceNameInput
10831076
value={editingName}
@@ -1126,45 +1119,18 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({
11261119
{/* Hover preview portal */}
11271120
<HoverPreviewRenderer {...previewProps} />
11281121
</TooltipWrapper>
1129-
onClick={(e) => e.stopPropagation()}
1130-
aria-label={`Rename workspace ${displayName}`}
1131-
data-workspace-id={workspaceId}
1132-
/>
1133-
) : (
1134-
<WorkspaceName
1135-
onDoubleClick={(e) => {
1136-
e.stopPropagation();
1137-
startRenaming(workspaceId, displayName);
1138-
}}
1139-
title="Double-click to rename"
1140-
>
1141-
{displayName}
1142-
</WorkspaceName>
1143-
)}
1144-
<WorkspaceStatusIndicator
1145-
streaming={isStreaming}
1146-
unread={isUnread}
1147-
onClick={() => _onToggleUnread(workspaceId)}
1148-
title={
1149-
isStreaming
1150-
? "Assistant is responding"
1151-
: isUnread
1152-
? "Unread messages"
1153-
: "Idle"
1154-
}
1155-
/>
1156-
</WorkspaceItem>
1157-
{/* Hover preview portal */}
1158-
<HoverPreviewRenderer {...previewProps} />
1159-
</TooltipWrapper>
1160-
>>>>>>> e2cecb3d (🤖 Hover AIView preview in sidebar: show recent messages on workspace hover without altering active view\n\n- Add AIViewPreview (read-only, last N messages, ChatProvider for parity)\n- Integrate preview as Tooltip content around WorkspaceItem\n- Keep non-interactive/pointer-events:none to avoid stealing focus\n- Uses existing MessageRenderer for full parity\n\nGenerated with)
11611122
{renameError && editingWorkspaceId === workspaceId && (
11621123
<WorkspaceErrorContainer>{renameError}</WorkspaceErrorContainer>
11631124
)}
11641125
</React.Fragment>
11651126
);
11661127
}
11671128
)}
1129+
</WorkspacesContainer>
1130+
)}
1131+
</ProjectGroup>
1132+
);
1133+
})
11681134
)}
11691135
</ProjectsList>
11701136
</>

0 commit comments

Comments
 (0)