Skip to content

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jul 9, 2025

Related Issue

Issue: #XXXX

Description

Introduces the showMessage host API to the host bridge for displaying informational, warning, and error messages to the user in clients.

The changes include:

  • A new ShowMessageRequest and SelectedResponse message definition in proto/host/window.proto to define the request and response structure for showing messages.
  • A new file src/hosts/vscode/window/showMessage.ts that implements the showErrorMessage, showInformationMessage, and showWarningMessage functions. These functions use the VS Code API to display messages based on the ShowMessageRequest.
  • Update all current call sites to use the new implementations

Test Procedure

  1. The behavior for showErrorMessage, showInformationMessage, showWarningMessage should remain unchanged.
  2. Example - Click Reset Workspace State in debugger to confirm the window messages are showing up as expected:
image

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

image

Additional Notes


Important

Introduces a unified showMessage API for consistent message handling across the codebase, replacing direct VS Code message calls.

  • Behavior:
    • Introduces showMessage API in proto/host/window.proto for displaying messages.
    • Replaces vscode.window.showErrorMessage, showInformationMessage, and showWarningMessage with showMessage in createRuleFile.ts, deleteRuleFile.ts, index.ts, resetState.ts, updateDefaultTerminalProfile.ts, deleteAllTaskHistory.ts, deleteTasksWithIds.ts, index.ts (mentions), index.ts (webview), tasks.ts, extension.ts, showMessage.ts, commit-message-generator.ts, export-markdown.ts, open-file.ts, process-files.ts, and McpHub.ts.
  • API:
    • Adds ShowMessageRequest, ShowMessageType, and SelectedResponse to proto/host/window.proto.
    • Implements showMessage function in showMessage.ts to handle message display logic.
  • Misc:
    • Updates message handling in various functions to use the new showMessage API for consistency and maintainability.

This description was created by Ellipsis for 23d81d1. You can customize this summary. It will automatically update as commits are pushed.

abeatrix added 2 commits July 8, 2025 17:37
…owWarningMessage

Introduces the `showMessage` host API to the VS Code extension, allowing the host to display informational, warning, and error messages to the user.

The changes include:

- A new `ShowMessageRequest` and `SelectedResponse` message definition in `proto/host/window.proto` to define the request and response structure for showing messages.
- A new file `src/hosts/vscode/window/showMessage.ts` that implements the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions. These functions use the VS Code API to display messages based on the `ShowMessageRequest`.
- Replace all current call sites with the new implementations
This commit introduces the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` host APIs to the VS Code extension. These APIs allow the host to display informational, warning, and error messages to the user.

The changes include:

- Added `ShowErrorMessageRequest`, `ShowInformationMessageRequest`, and `ShowWarningMessageRequest` message definitions in `proto/host/window.proto` to define the request structure for showing messages.
- Added new files `src/hosts/vscode/window/showErrorMessage.ts`, `src/hosts/vscode/window/showInformationMessage.ts`, and `src/hosts/vscode/window/showWarningMessage.ts` that implement the corresponding functions. These functions use the VS Code API to display messages based on the provided message and options.
@Copilot Copilot AI review requested due to automatic review settings July 9, 2025 01:14
Copy link

changeset-bot bot commented Jul 9, 2025

⚠️ No Changeset found

Latest commit: 23d81d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors all direct vscode.window.show*Message calls to use the new host bridge API (showErrorMessage, showInformationMessage, showWarningMessage) and adds corresponding Protobuf definitions and wrapper implementations.

  • Introduces new wrapper functions in src/hosts/vscode/window and updates the Protobuf window.proto definitions.
  • Replaces all existing vscode.window.show*Message calls with the new host bridge calls across the codebase.
  • Updates tests and import statements to reference the new wrappers.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

File Description
src/hosts/vscode/window/show*.ts Added host bridge wrappers for error/info/warning messages
proto/host/window.proto Defined ShowErrorMessageRequest, ShowInformationMessageRequest, ShowWarningMessageRequest, and shared message types
**/*.ts (various) Replaced direct VSCode UI calls with the new wrapper functions
src/test/extension.test.ts Updated test cleanup to use showInformationMessage wrapper

Copy link
Contributor

github-actions bot commented Jul 9, 2025

Coverage Report

Extension Coverage

Base branch: 46%

PR branch: 46%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 13%

PR branch: 13%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-07-11T22:36:00.782521

The `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions in `src/hosts/vscode/window/` have been refactored for simplification.

- The functions now directly destructure the `modal`, `detail`, and `items` properties from the input object.
- The VS Code API calls now directly pass the `modal` and `detail` options, and use the spread operator to pass the `items.options` array as additional arguments. This removes the need for conditional logic to construct the options object.
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@abeatrix abeatrix requested a review from Garoth July 10, 2025 00:55
ARQAWA pushed a commit to ARQAWA/cline that referenced this pull request Jul 10, 2025
…exts (cline#4745) (cline#4748)

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Garoth
Garoth previously approved these changes Jul 11, 2025
Copy link
Contributor

@Garoth Garoth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks Bee

@abeatrix abeatrix requested a review from Garoth July 11, 2025 23:49
Copy link
Contributor

@arafatkatze arafatkatze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick stamp for reapprove after merge conflicts, did not review properly but it has been tested by andrei

@abeatrix abeatrix merged commit 16f066d into main Jul 12, 2025
9 checks passed
massi-ang pushed a commit to massi-ang/cline that referenced this pull request Jul 14, 2025
…WarningMessage (cline#4745)

* host bridge migration: showErrorMessage & showInformationMessage & showWarningMessage

Introduces the `showMessage` host API to the VS Code extension, allowing the host to display informational, warning, and error messages to the user.

The changes include:

- A new `ShowMessageRequest` and `SelectedResponse` message definition in `proto/host/window.proto` to define the request and response structure for showing messages.
- A new file `src/hosts/vscode/window/showMessage.ts` that implements the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions. These functions use the VS Code API to display messages based on the `ShowMessageRequest`.
- Replace all current call sites with the new implementations

* define the request structure

This commit introduces the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` host APIs to the VS Code extension. These APIs allow the host to display informational, warning, and error messages to the user.

The changes include:

- Added `ShowErrorMessageRequest`, `ShowInformationMessageRequest`, and `ShowWarningMessageRequest` message definitions in `proto/host/window.proto` to define the request structure for showing messages.
- Added new files `src/hosts/vscode/window/showErrorMessage.ts`, `src/hosts/vscode/window/showInformationMessage.ts`, and `src/hosts/vscode/window/showWarningMessage.ts` that implement the corresponding functions. These functions use the VS Code API to display messages based on the provided message and options.

* Simplify showMessage functions and use options array

The `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions in `src/hosts/vscode/window/` have been refactored for simplification.

- The functions now directly destructure the `modal`, `detail`, and `items` properties from the input object.
- The VS Code API calls now directly pass the `modal` and `detail` options, and use the spread operator to pass the `items.options` array as additional arguments. This removes the need for conditional logic to construct the options object.

* wip: apply feedback

* Update src/integrations/git/commit-message-generator.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* merge conflict

---------

Co-authored-by: abeatrix <beatrix@cline.bot>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@celestial-vault
Copy link
Contributor

@abeatrix Could these be separate PRs in the future? 🙏 🙏

@abeatrix abeatrix deleted the bee/showMessage branch July 16, 2025 23:50
li-yechao pushed a commit to li-yechao/cline that referenced this pull request Jul 27, 2025
…WarningMessage (cline#4745)

* host bridge migration: showErrorMessage & showInformationMessage & showWarningMessage

Introduces the `showMessage` host API to the VS Code extension, allowing the host to display informational, warning, and error messages to the user.

The changes include:

- A new `ShowMessageRequest` and `SelectedResponse` message definition in `proto/host/window.proto` to define the request and response structure for showing messages.
- A new file `src/hosts/vscode/window/showMessage.ts` that implements the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions. These functions use the VS Code API to display messages based on the `ShowMessageRequest`.
- Replace all current call sites with the new implementations

* define the request structure

This commit introduces the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` host APIs to the VS Code extension. These APIs allow the host to display informational, warning, and error messages to the user.

The changes include:

- Added `ShowErrorMessageRequest`, `ShowInformationMessageRequest`, and `ShowWarningMessageRequest` message definitions in `proto/host/window.proto` to define the request structure for showing messages.
- Added new files `src/hosts/vscode/window/showErrorMessage.ts`, `src/hosts/vscode/window/showInformationMessage.ts`, and `src/hosts/vscode/window/showWarningMessage.ts` that implement the corresponding functions. These functions use the VS Code API to display messages based on the provided message and options.

* Simplify showMessage functions and use options array

The `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions in `src/hosts/vscode/window/` have been refactored for simplification.

- The functions now directly destructure the `modal`, `detail`, and `items` properties from the input object.
- The VS Code API calls now directly pass the `modal` and `detail` options, and use the spread operator to pass the `items.options` array as additional arguments. This removes the need for conditional logic to construct the options object.

* wip: apply feedback

* Update src/integrations/git/commit-message-generator.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* merge conflict

---------

Co-authored-by: abeatrix <beatrix@cline.bot>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@canvrno canvrno mentioned this pull request Jul 30, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants