Skip to content

Conversation

@Fangoling
Copy link
Contributor

@Fangoling Fangoling commented Jan 7, 2026

What it does

VS Code exposes a SCM action button api that allows SCM providers (like the built-in Git extension) to provide and update an action button based on repository state.

fixes #16583

This PR introduces an SCM Action Button API in Theia, mirroring VS Code’s
extension model where SCM providers contribute and update the state of the SCM
action button.

Primary Command: Commit State
image

Secondary Commands: Commit State
image

Primary Command: Sync Changes State (no secondary commands)
image

  1. Plugin API & Extension Support (plugin-ext)
  • API Extension: Added ScmActionButton interface to theia.d.ts mirroring VS Code's API.
  • RPC Protocol: Updated ScmMain interface to support $setActionButton.
  • SCM Implementation:
    • Implemented actionButton setter in SourceControlImpl.
    • Added proper command conversion logic using toSafeCommand to handle command execution across the plugin boundary.
  1. SCM Provider & Service (scm)
  • Provider Interface: Added actionButton and onDidChangeActionButton to ScmProvider.
  • Event Handling: Added support for updating the action button state dynamically.
  1. UI Implementation (scm)
  • New Widget: Created ScmCommitButtonWidget to render the action button.
  • Context Menu:
    • Implemented custom context menu for secondary actions.
    • Crucial Fix: Implemented custom CommandMenu nodes to properly pass command arguments (handles), bypassing Theia's default menu system limitation which doesn't support per-item arguments.

How to test

  1. check that the vscode extensions Git Base (built-in) and Git (built-in) are installed
  2. go to the scm widget in the sidebar, the button should be disabled with the primary command commit
  3. make any changes in your code, the button should be enabled with the primary command commit
  4. interact with the button and check if the secondary commands work as intended
  5. commit all changes, the button should show the primary command sync changes and no secondary commands

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Contributed under the supervision of @JonasHelming as part of the TUM Bachelor Thesis project "Enhancing Terminal Usability in Modern IDEs through AI-Assisted Interaction".

Review checklist

Reminder for reviewers

Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Jan 7, 2026
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@JonasHelming JonasHelming requested a review from sdirix January 8, 2026 07:44
@sdirix
Copy link
Member

sdirix commented Jan 8, 2026

I will review at the latest next week.

Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

The PR works well for me 👍

I have some minor comments but they should be easy to resolve.

I checked the code and it looks good to me, however I am not that familiar with the deep details of menus/commands, so if something could be streamlined there then it went over my head.

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Waiting on author in PR Backlog Jan 18, 2026
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@Fangoling Fangoling requested a review from sdirix January 19, 2026 14:19
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on author

Development

Successfully merging this pull request may close these issues.

Commit button missing on git extension

2 participants