add commands for consumer groups#3312
Conversation
|
9b6234e to
27c744f
Compare
857f4c4 to
2e58c9a
Compare
|
8e1baca to
f5f4e41
Compare
c2c858b to
2919663
Compare
2e58c9a to
b81b673
Compare
| "command": "confluent.copyResourceId", | ||
| "when": "view == confluent-topics && viewItem =~ /.*-consumer-group-.*/", | ||
| "group": "2_copy@1" | ||
| }, | ||
| { | ||
| "command": "confluent.openCCloudLink", | ||
| "when": "view == confluent-topics && viewItem =~ /ccloud-consumer-group-.*/", | ||
| "group": "z_openInCloud" |
There was a problem hiding this comment.
These context values were set in the initial models by #3263, so this is just exposing the commands - no additional logic needed for copying IDs or opening CCloud pages for consumer groups/members in this branch.
There was a problem hiding this comment.
Generally matches the existing pattern in https://github.com/confluentinc/vscode/blob/main/src/commands/flinkDatabaseView.ts, but may be worth abstracting to a more general spot
There was a problem hiding this comment.
Pull request overview
This PR adds Topics view container-level commands to refresh either the Topics or Consumer Groups container independently, and wires up context values so Copy ID and View in Confluent Cloud actions can appear for consumer groups and members in the Topics view.
Changes:
- Add a new Topics view command (
confluent.topics.refreshResourceContainer) to refresh only the clicked container (Topics vs Consumer Groups). - Adjust consumer group/member
idbehavior to support “Copy ID” while keeping TreeItem IDs stable. - Update
package.jsonmenus to show refresh/copy/open-in-cloud actions for the new context values.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/viewProviders/topics.ts | Adds a context value for the Consumer Groups container so container-level actions can be targeted. |
| src/models/consumerGroup.ts | Changes id values for Copy-ID usage; adjusts TreeItem IDs/context values for menu targeting. |
| src/models/consumerGroup.test.ts | Updates/extends tests to match new id and tooltip behavior. |
| src/extension.ts | Registers the new Topics view command set during activation. |
| src/commands/topicsView.ts | Implements and registers the container-level refresh command. |
| src/commands/topicsView.test.ts | Adds unit tests for registration and refresh routing. |
| package.json | Contributes the new command and wires it into the Topics view context menus. |
|
James Robinson (jlrobins)
left a comment
There was a problem hiding this comment.
looks good!






Summary of Changes
Some basic cleanup and minor additions that were out of scope for #3264:
Associated PRs
Click-testing instructions
Consumer Group commands
Select a Kafka cluster with at least one consumer group
Click the "Refresh Group" action on the "Consumer Groups" item (optional: start/stop consumers before refreshing) and expect no change in the "Topics" item (or child items)

Right-click on a consumer group, click "Copy ID" from the right-click context menu, and expect the consumer group ID to be copied to the clipboard (with an info notification shown)
Expand the consumer group, click "Copy ID" from the right-click context menu, and expect the consumer ID to be copied to the clipboard (+notification)
For CCloud consumer groups+members, click "View in Confluent Cloud" from the right-click context menu
consumer groups:

consumers:

Topic commands
Click the "Refresh Group" action on the "Topics" item and expect no change in the "Consumer Groups" item (or child items)

Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
Release notes