This commit is contained in:
Mathew Pareles 2025-01-10 19:02:51 -08:00
parent 966470cf68
commit 951da8e31a
3 changed files with 12 additions and 3 deletions

View file

@ -405,14 +405,15 @@ const ChatBubble = ({ chatMessage, isLoading }: {
return <div return <div
// align chatbubble accoridng to role // align chatbubble accoridng to role
className={` className={`
${role === 'user' ? 'px-2 self-end w-fit' : ''} ${role === 'user' ? 'px-2 self-end w-fit max-w-full' : ''}
${role === 'assistant' ? 'self-start w-full' : ''} ${role === 'assistant' ? 'self-start w-full max-w-full' : ''}
`} `}
> >
<div <div
// style chatbubble according to role // style chatbubble according to role
className={` className={`
p-2 text-left space-y-2 rounded-lg break-all p-2 text-left space-y-2 rounded-lg
overflow-x-auto max-w-full
${role === 'user' ? 'bg-vscode-input-bg text-vscode-input-fg' : ''} ${role === 'user' ? 'bg-vscode-input-bg text-vscode-input-fg' : ''}
`} `}
> >

View file

@ -44,6 +44,7 @@ import { IKeybindingService } from '../../../../../../../platform/keybinding/com
import { IEnvironmentService } from '../../../../../../../platform/environment/common/environment.js' import { IEnvironmentService } from '../../../../../../../platform/environment/common/environment.js'
import { IConfigurationService } from '../../../../../../../platform/configuration/common/configuration.js' import { IConfigurationService } from '../../../../../../../platform/configuration/common/configuration.js'
import { IPathService } from '../../../../../../../workbench/services/path/common/pathService.js' import { IPathService } from '../../../../../../../workbench/services/path/common/pathService.js'
import { IMetricsService } from '../../../../../../../platform/void/common/metricsService.js'
// normally to do this you'd use a useEffect that calls .onDidChangeState(), but useEffect mounts too late and misses initial state changes // normally to do this you'd use a useEffect that calls .onDidChangeState(), but useEffect mounts too late and misses initial state changes
@ -181,6 +182,7 @@ const getReactAccessor = (accessor: ServicesAccessor) => {
IEnvironmentService: accessor.get(IEnvironmentService), IEnvironmentService: accessor.get(IEnvironmentService),
IConfigurationService: accessor.get(IConfigurationService), IConfigurationService: accessor.get(IConfigurationService),
IPathService: accessor.get(IPathService), IPathService: accessor.get(IPathService),
IMetricsService: accessor.get(IMetricsService),
} as const } as const
return reactAccessor return reactAccessor

View file

@ -60,6 +60,10 @@ export type ChatThreads = {
createdAt: string; // ISO string createdAt: string; // ISO string
lastModified: string; // ISO string lastModified: string; // ISO string
messages: ChatMessage[]; messages: ChatMessage[];
// editing state
isBeingEdited: boolean;
_currentStagingSelections: CodeStagingSelection[] | null;
}; };
} }
@ -77,6 +81,8 @@ const newThreadObject = () => {
createdAt: now, createdAt: now,
lastModified: now, lastModified: now,
messages: [], messages: [],
isBeingEdited: false,
_currentStagingSelections: null,
} }
} }