Skip to content

Commit 8ac8247

Browse files
committed
chore(shared): dedupe WebviewMessage.type union; add WebviewMessagePayload alias; clarify ExtensionMessage header comment
1 parent 06d5674 commit 8ac8247

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/shared/ExtensionMessage.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ export interface LanguageModelChatSelector {
5757
id?: string
5858
}
5959

60-
// Represents JSON data that is sent from extension to webview, called
61-
// ExtensionMessage and has 'type' enum which can be 'plusButtonClicked' or
62-
// 'settingsButtonClicked' or 'hello'. Webview will hold state.
60+
/**
61+
* Message sent from the VS Code extension to the webview UI.
62+
* The 'type' union below enumerates outbound notifications and data updates
63+
* (e.g., "state", "theme", "indexingStatusUpdate", "filesChanged") that the
64+
* webview consumes to render and synchronize state. See the full union below.
65+
*/
6366
export interface ExtensionMessage {
6467
type:
6568
| "action"

src/shared/WebviewMessage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export interface WebviewMessage {
8383
| "allowedMaxRequests"
8484
| "allowedMaxCost"
8585
| "alwaysAllowSubtasks"
86-
| "alwaysAllowUpdateTodoList"
8786
| "autoCondenseContext"
8887
| "autoCondenseContextPercent"
8988
| "condensingApiConfigId"
@@ -186,7 +185,6 @@ export interface WebviewMessage {
186185
| "indexCleared"
187186
| "focusPanelRequest"
188187
| "profileThresholds"
189-
| "setHistoryPreviewCollapsed"
190188
| "openExternal"
191189
| "filterMarketplaceItems"
192190
| "marketplaceButtonClicked"
@@ -197,7 +195,6 @@ export interface WebviewMessage {
197195
| "marketplaceInstallResult"
198196
| "fetchMarketplaceData"
199197
| "switchTab"
200-
| "profileThresholds"
201198
| "shareTaskSuccess"
202199
| "exportMode"
203200
| "exportModeResult"
@@ -346,3 +343,6 @@ export type WebViewMessagePayload =
346343
| IndexClearedPayload
347344
| InstallMarketplaceItemWithParametersPayload
348345
| UpdateTodoListPayload
346+
347+
// Alias for consistent naming (prefer 'Webview' spelling in new code)
348+
export type WebviewMessagePayload = WebViewMessagePayload

0 commit comments

Comments
 (0)