Skip to content

Commit

Permalink
click 'manually edit context' button moves items to input, but doesn'…
Browse files Browse the repository at this point in the history
…t remove them from context list
  • Loading branch information
beyang committed Oct 22, 2024
1 parent daa2bdf commit 1288f43
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
6 changes: 0 additions & 6 deletions lib/shared/src/misc/rpc/webviewAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ export interface WebviewToExtensionAPI {
* The current user's product subscription information (Cody Free/Pro).
*/
userProductSubscription(): Observable<UserProductSubscription | null>

/**
* Move the fetched context into the previous input
*/
clearFetchedContext(index: number): Observable<void>
}

export function createExtensionAPI(
Expand Down Expand Up @@ -119,7 +114,6 @@ export function createExtensionAPI(
transcript: proxyExtensionAPI(messageAPI, 'transcript'),
userHistory: proxyExtensionAPI(messageAPI, 'userHistory'),
userProductSubscription: proxyExtensionAPI(messageAPI, 'userProductSubscription'),
clearFetchedContext: proxyExtensionAPI(messageAPI, 'clearFetchedContext'),
}
}

Expand Down
6 changes: 0 additions & 6 deletions vscode/src/chat/chat-view/ChatController.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
type ChatModel,
type CodyClientConfig,
EMPTY,
cenv,
clientCapabilities,
currentSiteVersion,
Expand Down Expand Up @@ -1668,11 +1667,6 @@ export class ChatController implements vscode.Disposable, vscode.WebviewViewProv
userProductSubscription.pipe(
map(value => (value === pendingOperation ? null : value))
),
clearFetchedContext: (index: number) => {
this.chatBuilder.removeContextForHumanMessage(index)
this.postViewTranscript()
return EMPTY
},
}
)
)
Expand Down
1 change: 0 additions & 1 deletion vscode/webviews/AppWrapperForTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const AppWrapperForTest: FunctionComponent<{ children: ReactNode }> = ({
},
}),
userProductSubscription: () => Observable.of(null),
clearFetchedContext: () => EMPTY,
},
} satisfies Wrapper<ComponentProps<typeof ExtensionAPIProviderForTestsOnly>['value']>,
{
Expand Down
9 changes: 1 addition & 8 deletions vscode/webviews/chat/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,7 @@ const TranscriptInteraction: FC<TranscriptInteractionProps> = memo(props => {
}
editor.removeMentions(item => item.type !== 'repository')
editor.addMentions(contextFiles, undefined, 'before', '\n')

// Clear the listed context files
extensionAPI.clearFetchedContext(humanMessage.index).subscribe({
error: error => {
console.error('Error editing context', error)
},
})
}, [extensionAPI, humanMessage.contextFiles, humanMessage.index])
}, [humanMessage.contextFiles])

return (
<>
Expand Down

0 comments on commit 1288f43

Please sign in to comment.