mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
fix CtrlK model selection
This commit is contained in:
parent
def78affb4
commit
c222a801a8
3 changed files with 16 additions and 5 deletions
|
|
@ -771,7 +771,7 @@ class EditCodeService extends Disposable implements IEditCodeService {
|
|||
}
|
||||
|
||||
weAreWriting = false
|
||||
private async _writeURIText(uri: URI, text: string, range_: IRange | 'wholeFileRange', { shouldRealignDiffAreas, }: { shouldRealignDiffAreas: boolean, }) {
|
||||
private _writeURIText(uri: URI, text: string, range_: IRange | 'wholeFileRange', { shouldRealignDiffAreas, }: { shouldRealignDiffAreas: boolean, }) {
|
||||
const model = this._getModel(uri)
|
||||
if (model === null) return
|
||||
|
||||
|
|
@ -1470,6 +1470,8 @@ class EditCodeService extends Disposable implements IEditCodeService {
|
|||
resMessageDonePromise()
|
||||
},
|
||||
})
|
||||
// should never happen, just for safety
|
||||
if (streamRequestIdRef.current === null) { return }
|
||||
|
||||
await messageDonePromise
|
||||
console.log('done waiting')
|
||||
|
|
@ -1799,6 +1801,9 @@ class EditCodeService extends Disposable implements IEditCodeService {
|
|||
|
||||
})
|
||||
|
||||
// should never happen, just for safety
|
||||
if (streamRequestIdRef.current === null) { break }
|
||||
|
||||
await messageDonePromise
|
||||
|
||||
} // end while
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ export const QuickEditChat = ({
|
|||
const chatAreaRef = useRef<HTMLDivElement | null>(null)
|
||||
return <div ref={sizerRef} style={{ maxWidth: 450 }} className={`py-2 w-full`}>
|
||||
<VoidChatArea
|
||||
featureName='Ctrl+K'
|
||||
divRef={chatAreaRef}
|
||||
onSubmit={onSubmit}
|
||||
onAbort={onInterrupt}
|
||||
|
|
|
|||
|
|
@ -204,13 +204,13 @@ const getChatBubbleId = (threadId: string, messageIdx: number) => `${threadId}-$
|
|||
|
||||
|
||||
// SLIDER ONLY:
|
||||
const ReasoningOptionDropdown = () => {
|
||||
const ReasoningOptionDropdown = ({ featureName }: { featureName: FeatureName }) => {
|
||||
const accessor = useAccessor()
|
||||
|
||||
const voidSettingsService = accessor.get('IVoidSettingsService')
|
||||
const voidSettingsState = useSettingsState()
|
||||
|
||||
const modelSelection = voidSettingsState.modelSelectionOfFeature['Chat']
|
||||
const modelSelection = voidSettingsState.modelSelectionOfFeature[featureName]
|
||||
if (!modelSelection) return null
|
||||
|
||||
const { modelName, providerName } = modelSelection
|
||||
|
|
@ -289,6 +289,8 @@ interface VoidChatAreaProps {
|
|||
onClickAnywhere?: () => void;
|
||||
// Optional close button
|
||||
onClose?: () => void;
|
||||
|
||||
featureName: FeatureName;
|
||||
}
|
||||
|
||||
export const VoidChatArea: React.FC<VoidChatAreaProps> = ({
|
||||
|
|
@ -306,6 +308,7 @@ export const VoidChatArea: React.FC<VoidChatAreaProps> = ({
|
|||
showProspectiveSelections = true,
|
||||
selections,
|
||||
setSelections,
|
||||
featureName,
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
|
|
@ -359,8 +362,8 @@ export const VoidChatArea: React.FC<VoidChatAreaProps> = ({
|
|||
<div className='flex flex-row justify-between items-end gap-1'>
|
||||
{showModelDropdown && (
|
||||
<div className='max-w-[200px] flex-grow'>
|
||||
<ReasoningOptionDropdown />
|
||||
<ModelDropdown featureName={'Chat'} />
|
||||
<ReasoningOptionDropdown featureName={featureName} />
|
||||
<ModelDropdown featureName={featureName} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -852,6 +855,7 @@ const UserMessageComponent = ({ chatMessage, messageIdx, isLoading }: ChatBubble
|
|||
}
|
||||
|
||||
chatbubbleContents = <VoidChatArea
|
||||
featureName='Chat'
|
||||
onSubmit={onSubmit}
|
||||
onAbort={onAbort}
|
||||
isStreaming={false}
|
||||
|
|
@ -1709,6 +1713,7 @@ export const SidebarChat = () => {
|
|||
}, [onSubmit, onAbort, isStreaming])
|
||||
const inputForm = <div className={`right-0 left-0 m-2 z-[999] overflow-hidden ${previousMessages.length > 0 ? 'absolute bottom-0' : ''}`}>
|
||||
<VoidChatArea
|
||||
featureName='Chat'
|
||||
divRef={chatAreaRef}
|
||||
onSubmit={onSubmit}
|
||||
onAbort={onAbort}
|
||||
|
|
|
|||
Loading…
Reference in a new issue