Skip to content

Component Viewer/Core Peripherals: add context menu#1027

Merged
jreineckearm merged 16 commits into
mainfrom
componentViewer-contextMenu
Jun 19, 2026
Merged

Component Viewer/Core Peripherals: add context menu#1027
jreineckearm merged 16 commits into
mainfrom
componentViewer-contextMenu

Conversation

@jthuangarm

@jthuangarm jthuangarm commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes

Stacked PR on top of #926.
Blocked until #926 is merged, and will be rebased to main afterwards.

Changes

  • Added actions:
    • Copy
    • Copy Row (if applicable)
    • Enable/Disable Periodic Update (if applicable)
    • Exclude/Include Updates (if applicable)
    • Reset View State
  • Menu items are shown based on row state:
    • Copy Row only appears for non-root rows with a value.
    • Exclude/Include Updates only appears on root component rows.
  • Context menu actions stay in sync with toolbar/command palette state and persisted settings.json view state.
  • Keyboard copy supported.
  • Copy supports selected text, in addition to Name/Value/Row Copy.
  • Especially for multicore-debugging, Reset View State will reset the states of ALL sessions.

Screenshots

Root row context menu
image

Non-root row with value context menu
image

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@qltysh

qltysh Bot commented Jun 17, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on main by 0.03%.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
src/views/component-viewer/component-viewer-base.ts96.7%151
Coverage rating: A Coverage rating: A
src/views/component-viewer/component-viewer-instance.ts0.0%94
Coverage rating: A Coverage rating: A
src/views/component-viewer/component-viewer-webview-provider.ts100.0%
Coverage rating: A Coverage rating: A
src/views/dynamic-view-states.ts93.3%135
Total93.6%
🤖 Increase coverage with AI coding...
In the `componentViewer-contextMenu` branch, add test coverage for this new code:

- `src/views/component-viewer/component-viewer-base.ts` -- Line 151
- `src/views/component-viewer/component-viewer-instance.ts` -- Line 94
- `src/views/dynamic-view-states.ts` -- Line 135

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/webviews/tree-table/src/TreeTable.tsx
Comment thread src/webviews/tree-table/src/TreeTable.tsx Outdated
@jthuangarm

Copy link
Copy Markdown
Collaborator Author

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note tested yet. Already some feedback from code review.

Comment thread src/views/component-viewer/component-viewer-base.ts Outdated
Comment thread src/views/component-viewer/component-viewer-base.ts Outdated
Comment thread src/views/component-viewer/component-viewer-base.ts Outdated
Comment thread src/views/dynamic-view-states.ts
Comment thread src/webviews/tree-table/src/TreeTable.tsx Outdated
Comment thread src/webviews/tree-table/src/TreeTable.tsx
Base automatically changed from webview-buttonFilter to main June 19, 2026 12:00
@qltysh

qltysh Bot commented Jun 19, 2026

Copy link
Copy Markdown

All good ✅

Comment thread src/webviews/tree-table/src/TreeTable.tsx Outdated
Comment thread src/webviews/tree-table/src/TreeTable.tsx Outdated
Comment thread src/webviews/tree-table/src/TreeTable.tsx Outdated
@jthuangarm jthuangarm force-pushed the componentViewer-contextMenu branch from 77d3c32 to 084212e Compare June 19, 2026 13:09
@jthuangarm jthuangarm marked this pull request as ready for review June 19, 2026 14:09

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Context menu behaves nicely, great job!

Just two feedback items

  • It "feels" a bit odd that Reset View State collapses 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 better Freeze Component Display or Lock Component Display? It's not very clear what's excluded as you may not immediately understand the connection for which node this applies. And Exclude Component from Updates becomes a bit lengthy.
    • Core Peripherals: Exclude from Updates --> Maybe better Freeze Peripheral Display or Lock Peripheral Display?

Note: hard for me to predict how long the entries become with the suggested names. So, may need a bit of experimentation.

@jthuangarm

jthuangarm commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback! The suggestions have been applied.
I chose Lock Display as we are using Lock icon.

Are we storing the expand states as part of the viewState setting?
No, it is stored in runtime. After stopping the session will clear the expand/collapse states

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-tested, LGTM. Thanks!

@jreineckearm jreineckearm merged commit a69aed1 into main Jun 19, 2026
21 checks passed
@jreineckearm jreineckearm deleted the componentViewer-contextMenu branch June 19, 2026 15:44
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.

3 participants