Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tidy up Agentic Chat and Context accordions and behaviour #6735

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions vscode/src/chat/agentic/DeepCody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ export class DeepCodyAgent {
span.addEvent('reviewLoop')
for (let i = 0; i < maxLoops && !chatAbortSignal.aborted; i++) {
this.stats.loop++
const step = this.stepsManager.addStep({ title: 'Reflecting' })
const step = this.stepsManager.addStep({
title: 'Reflecting',
state: 'pending', // Explicitly set pending state
})
const newContext = await this.review(requestID, span, chatAbortSignal)
this.statusCallback.onComplete(step.id)
if (!newContext.length) break
Expand Down Expand Up @@ -227,8 +230,9 @@ export class DeepCodyAgent {
return []
}

const step = this.stepsManager.addStep({ title: 'Retrieving context' })

const step = this.stepsManager.addStep({
title: 'Finding relevant context',
})
const results = await Promise.all(
this.tools.map(async tool => {
try {
Expand Down Expand Up @@ -283,7 +287,7 @@ export class DeepCodyAgent {
if (reviewed.length > 0) {
this.statusCallback.onStream({
title: 'Optimizing context',
content: `selected ${toPlural(reviewed.length, 'item')}`,
content: `${toPlural(reviewed.length, 'item')} selected`,
})
const userAdded = this.context.filter(c => isUserAddedItem(c))
reviewed.push(...userAdded)
Expand Down
45 changes: 21 additions & 24 deletions vscode/webviews/chat/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import { useIntentDetectionConfig } from '../components/omnibox/intentDetection'
import { AgenticContextCell } from './cells/agenticCell/AgenticContextCell'
import ApprovalCell from './cells/agenticCell/ApprovalCell'
import { DidYouMeanNotice } from './cells/messageCell/assistant/DidYouMean'
import { SwitchIntent } from './cells/messageCell/assistant/SwitchIntent'
import { LastEditorContext } from './context'

interface TranscriptProps {
Expand Down Expand Up @@ -765,37 +764,35 @@ const TranscriptInteraction: FC<TranscriptInteractionProps> = memo(props => {
intent={manuallySelectedIntent?.intent || intentResults?.intent}
manuallySelectIntent={handleManualIntentSelection}
/>
{experimentalOneBoxEnabled && (
<SwitchIntent
intent={humanMessage.intent}
manuallySelected={!!humanMessage.manuallySelectedIntent}
onSwitch={
humanMessage.intent === 'search'
? reSubmitWithChatIntent
: reSubmitWithSearchIntent
}
/>
)}
{experimentalOneBoxEnabled && assistantMessage?.didYouMeanQuery && (
<DidYouMeanNotice
query={assistantMessage?.didYouMeanQuery}
disabled={!!assistantMessage?.isLoading}
switchToSearch={() => editAndSubmitSearch(assistantMessage?.didYouMeanQuery ?? '')}
/>
)}
{!isSearchIntent && humanMessage.agent && (
<AgenticContextCell
key={`${humanMessage.index}-${humanMessage.intent}-process`}
isContextLoading={isContextLoading}
processes={humanMessage?.processes ?? undefined}
/>
{humanMessage.agent && (
<>
<AgenticContextCell
key={`${humanMessage.index}-${humanMessage.intent}-process`}
isContextLoading={isContextLoading}
processes={humanMessage?.processes ?? undefined}
intent={isSearchIntent ? 'search' : 'chat'}
onSwitchIntent={
isSearchIntent ? reSubmitWithChatIntent : reSubmitWithSearchIntent
}
contextItems={humanMessage.contextFiles}
isForFirstMessage={humanMessage.index === 0}
model={assistantMessage?.model}
experimentalOneBoxEnabled={experimentalOneBoxEnabled}
/>
{!isSearchIntent &&
humanMessage.agent &&
isContextLoading &&
assistantMessage?.isLoading && <ApprovalCell vscodeAPI={vscodeAPI} />}
</>
)}
{!isSearchIntent &&
humanMessage.agent &&
isContextLoading &&
assistantMessage?.isLoading && <ApprovalCell vscodeAPI={vscodeAPI} />}

{!(humanMessage.agent && isContextLoading) &&
{!(humanMessage.agent === 'deep-cody') &&
(humanMessage.contextFiles || assistantMessage || isContextLoading) &&
!isSearchIntent && (
<ContextCell
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.processItem {
transition: all 0.3s ease-in-out;
}

.stateIcon {
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.stateText {
transition: color 0.3s ease-in-out;
}

.fadeIn {
opacity: 0;
animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
Loading
Loading