Component Viewer/Core Peripherals: add context menu#1027
Conversation
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Files with Diff Coverage (4)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
There was a problem hiding this comment.
Pull request overview
Adds a VS Code webview context menu to the Component Viewer/Core Peripherals tree-table, enabling copy and view-state actions that stay aligned with existing toolbar/command state and persisted settings.
Changes:
- Added webview context menu contributions (Copy / Copy Row / Periodic Update toggle / Exclude/Include Updates / Reset View State) with conditional visibility based on row state.
- Implemented webview-side context generation (selected-text aware Copy) and new extension commands to handle copy + reset actions.
- Added dynamic view-state clearing support and accompanying unit test coverage for the new reset behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/webviews/tree-table/src/TreeTable.tsx | Adds selection-aware Copy handling and per-row webview context generation on right-click. |
| src/views/dynamic-view-states.ts | Adds targeted clearing of persisted component viewer/core peripherals view state. |
| src/views/dynamic-view-states.test.ts | Adds tests validating targeted clearing preserves unrelated view state. |
| src/views/component-viewer/test/unit/component-viewer-base.test.ts | Updates/extends tests for new commands and reset/copy behavior. |
| src/views/component-viewer/component-viewer-webview-provider.ts | Updates lock/unlock tooltips to match new “Updates” terminology. |
| src/views/component-viewer/component-viewer-instance.ts | Exposes a stable instance key to support lock resolution across refreshes. |
| src/views/component-viewer/component-viewer-base.ts | Registers new commands (copy/copyRow/reset) and supports webview-context-based actions. |
| package.json | Adds new commands and webview/context menu contributions for componentViewer/corePeripherals. |
jreineckearm
left a comment
There was a problem hiding this comment.
Note tested yet. Already some feedback from code review.
…proved clarity and functionality
77d3c32 to
084212e
Compare
There was a problem hiding this comment.
Context menu behaves nicely, great job!
Just two feedback items
- It "feels" a bit odd that
Reset View Statecollapses all nodes. Are we storing the expand states as part of the viewState setting? Or can we make that stop? A user got the collapse all button to achieve that. - Suggestions for renaming commands/context menu entries
- Component Viewer:
Exclude from Updates--> Maybe betterFreeze Component DisplayorLock Component Display? It's not very clear what's excluded as you may not immediately understand the connection for which node this applies. AndExclude Component from Updatesbecomes a bit lengthy. - Core Peripherals:
Exclude from Updates--> Maybe betterFreeze Peripheral DisplayorLock Peripheral Display?
- Component Viewer:
Note: hard for me to predict how long the entries become with the suggested names. So, may need a bit of experimentation.
…st related tooltips and test expectations
|
Thanks for the feedback! The suggestions have been applied. Are we storing the expand states as part of the viewState setting? |
jreineckearm
left a comment
There was a problem hiding this comment.
Re-tested, LGTM. Thanks!

Fixes
Stacked PR on top of #926.
Blocked until #926 is merged, and will be rebased to main afterwards.
Changes
CopyCopy Row(if applicable)Enable/Disable Periodic Update(if applicable)Exclude/Include Updates(if applicable)Reset View StateCopy Rowonly appears for non-root rows with a value.Exclude/Include Updatesonly appears on root component rows.settings.jsonview state.Copysupports selected text, in addition to Name/Value/Row Copy.Reset View Statewill reset the states of ALL sessions.Screenshots
Root row context menu

Non-root row with value context menu

Checklist