Skip to content

Commit 78792c2

Browse files
authored
Spring cleaning (RooCodeInc#3723)
* Spring cleaning * changeset * Fixed incorrect return on ScrollToSettings proto * cleanup
1 parent 0abd13e commit 78792c2

File tree

8 files changed

+17
-54
lines changed

8 files changed

+17
-54
lines changed

.changeset/honest-boats-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Spring cleaning

proto/common.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ message StringArrays {
6363
repeated string values1 = 1;
6464
repeated string values2 = 2;
6565
}
66+
67+
message KeyValuePair {
68+
string key = 1;
69+
string value = 2;
70+
}

proto/ui.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ message ClineMessage {
221221
// UiService provides methods for managing UI interactions
222222
service UiService {
223223
// Scrolls to a specific settings section in the settings view
224-
rpc scrollToSettings(StringRequest) returns (Empty);
224+
rpc scrollToSettings(StringRequest) returns (KeyValuePair);
225225

226226
// Marks the current announcement as shown and returns whether an announcement should still be shown
227227
rpc onDidShowAnnouncement(EmptyRequest) returns (Boolean);

src/core/controller/index.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import pWaitFor from "p-wait-for"
77
import * as path from "path"
88
import * as vscode from "vscode"
99
import { handleGrpcRequest, handleGrpcRequestCancel } from "./grpc-handler"
10-
import { handleModelsServiceRequest } from "./models"
11-
import { EmptyRequest } from "@shared/proto/common"
1210
import { buildApiHandler } from "@api/index"
1311
import { cleanupLegacyCheckpoints } from "@integrations/checkpoints/CheckpointMigration"
1412
import { downloadTask } from "@integrations/misc/export-markdown"
@@ -44,8 +42,6 @@ import { sendStateUpdate } from "./state/subscribeToState"
4442
import { sendAddToInputEvent } from "./ui/subscribeToAddToInput"
4543
import { sendAuthCallbackEvent } from "./account/subscribeToAuthCallback"
4644
import { sendMcpMarketplaceCatalogEvent } from "./mcp/subscribeToMcpMarketplaceCatalog"
47-
import { sendOpenRouterModelsEvent } from "./models/subscribeToOpenRouterModels"
48-
import { OpenRouterCompatibleModelInfo } from "@/shared/proto/models"
4945

5046
/*
5147
https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
@@ -207,17 +203,6 @@ export class Controller {
207203
await this.setUserInfo(message.user || undefined)
208204
await this.postStateToWebview()
209205
break
210-
case "newTask":
211-
// Code that should run in response to the hello message command
212-
//vscode.window.showInformationMessage(message.text!)
213-
214-
// Send a message to our webview.
215-
// You can send any JSON serializable data.
216-
// Could also do this in extension .ts
217-
//this.postMessageToWebview({ type: "text", text: `Extension: ${Date.now()}` })
218-
// initializing new instance of Cline will make sure that any agentically running promises in old instance don't affect our new task. this essentially creates a fresh slate for the new task
219-
await this.initTask(message.text, message.images, message.files)
220-
break
221206
case "apiConfiguration":
222207
if (message.apiConfiguration) {
223208
await updateApiConfiguration(this.context, message.apiConfiguration)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Controller } from ".."
2-
import { StringRequest } from "../../../shared/proto/common"
2+
import { StringRequest, KeyValuePair } from "../../../shared/proto/common"
33

44
/**
55
* Executes a scroll to settings action
66
* @param controller The controller instance
77
* @param request The request containing the ID of the settings section to scroll to
8-
* @returns An object with action and value fields for the UI to process
8+
* @returns KeyValuePair with action and value fields for the UI to process
99
*/
10-
export async function scrollToSettings(controller: Controller, request: StringRequest): Promise<Record<string, string>> {
11-
return {
12-
action: "scrollToSettings",
10+
export async function scrollToSettings(controller: Controller, request: StringRequest): Promise<KeyValuePair> {
11+
return KeyValuePair.create({
12+
key: "scrollToSettings",
1313
value: request.value || "",
14-
}
14+
})
1515
}

src/shared/ExtensionMessage.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,15 @@ export interface ExtensionMessage {
1717
| "action"
1818
| "state"
1919
| "selectedImages"
20-
| "ollamaModels"
21-
| "lmStudioModels"
2220
| "workspaceUpdated"
23-
| "openAiModels"
2421
| "requestyModels"
2522
| "mcpServers"
2623
| "relinquishControl"
2724
| "mcpDownloadDetails"
28-
| "commitSearchResults"
29-
| "openGraphData"
3025
| "didUpdateSettings"
3126
| "userCreditsBalance"
3227
| "userCreditsUsage"
3328
| "userCreditsPayments"
34-
| "fileSearchResults"
3529
| "grpc_response" // New type for gRPC responses
3630
text?: string
3731
action?: "didBecomeVisible" | "accountLogoutClicked" | "focusChatInput"
@@ -50,14 +44,6 @@ export interface ExtensionMessage {
5044
error?: string
5145
mcpDownloadDetails?: McpDownloadResponse
5246
commits?: GitCommit[]
53-
openGraphData?: {
54-
title?: string
55-
description?: string
56-
image?: string
57-
url?: string
58-
siteName?: string
59-
type?: string
60-
}
6147
url?: string
6248
isImage?: boolean
6349
userCreditsBalance?: BalanceResponse

src/shared/WebviewMessage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { McpViewTab } from "./mcp"
99
export interface WebviewMessage {
1010
type:
1111
| "apiConfiguration"
12-
| "newTask"
1312
| "condense"
1413
| "reportBug"
1514
| "requestVsCodeLmModels"
@@ -21,7 +20,6 @@ export interface WebviewMessage {
2120
| "updateSettings"
2221
| "clearAllTaskHistory"
2322
| "fetchUserCreditsData"
24-
| "searchFiles"
2523
| "grpc_request"
2624
| "grpc_request_cancel"
2725
| "toggleWorkflow"

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -345,22 +345,6 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
345345
}
346346
}, [selectedType, searchQuery])
347347

348-
const handleMessage = useCallback((event: MessageEvent) => {
349-
const message: ExtensionMessage = event.data
350-
switch (message.type) {
351-
case "fileSearchResults": {
352-
// Only update results if they match the current query or if there's no mentionsRequestId - better UX
353-
if (!message.mentionsRequestId || message.mentionsRequestId === currentSearchQueryRef.current) {
354-
setFileSearchResults(message.results || [])
355-
setSearchLoading(false)
356-
}
357-
break
358-
}
359-
}
360-
}, [])
361-
362-
useEvent("message", handleMessage)
363-
364348
const queryItems = useMemo(() => {
365349
return [
366350
{ type: ContextMenuOptionType.Problems, value: "problems" },

0 commit comments

Comments
 (0)