project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Feature] Show QEMU VM descriptions in the Corporate summary

Open Frisch12 opened this issue 2 months ago • 3 comments

Describe the feature

Show a QEMU VM's configured description in the property table of the Corporate VM summary when the description is non-empty.

The Corporate detail view already fetches the VM config to display machine, BIOS, CPU, SCSI and network information. The same response contains raw.description, so the feature requires no additional API request. The compact summary should render the description as plain text, preserve line breaks, wrap long content inside the available width, and never interpret embedded HTML or script markup.

VM changes must clear the previous config state while the next config loads so a delayed response cannot leave another VM's description visible. The existing Config editor and its Markdown preview should remain unchanged.

Use Case

Descriptions often contain the short operational context that identifies a VM's purpose or owner. In the Corporate layout, users currently have to leave the summary and open Configure even though the summary has already loaded the data. Showing the description in the existing property table keeps that context visible without adding another request or a new screen.

Alternatives considered

  • Keep the description only in Configure. This preserves the current behavior but adds navigation for information already present in the loaded response.
  • Render the existing Markdown preview in the summary. The summary is intentionally compact, and rich HTML would add visual weight and a larger security surface. Plain React text is a better fit there.
  • Add a separate description request. Unnecessary because the config request already supplies the field.
  • Show an empty Description row. Rejected because it adds noise to the dense Corporate property table.

How important is this for you?

Nice to have. It removes a small but repeated navigation step in the Corporate workflow.

A focused implementation has been tested against a PegaProx 1.1.1 Docker instance and a PegaProx 1.1.1 manual installed instance with multiline, empty and script-like descriptions, including rapid VM switching. The complete test suite passes with 1,296 tests.

A solution is implemented in our fork on feat/vm-description-summary

Checklist

  • [x] I have searched existing issues and discussions to make sure this hasn't been requested before

Frisch12 avatar Sep 12 '26 08:09 Frisch12

Your premise checks out — the summary already reads raw.machine, raw.bios, raw.cpu and friends out of that same config response, so the description really is free.

Noted, we'll have a look. No commitment on when.

Two things for whenever you open it. Your fork reports 1,296 tests and we're at 1,400-odd on Testing now, so rebase first or you'll be reviewing against a different codebase. And the "clear the old config while the next one loads" point is well spotted — we've just fixed that exact stale-response shape twice in the PBS panels, so it's a real failure mode here and not theoretical.

— MK, and the tip jar is at https://opencollective.com/pegaprox

mkellermann97 avatar Sep 12 '26 13:09 mkellermann97

Built, on Testing, and your premise held all the way through - raw.description was already in the config response the detail view fetches, so this costs no extra request.

It renders in the property grid under IP, as plain text with pre-wrap and break-word: React escapes it, your line breaks survive, and a pasted URL wraps inside the column instead of widening the grid. No row at all when the description is empty, which is most VMs. The Config editor and its Markdown preview are untouched.

Verified against a live PVE with a three-line description containing a literal <b>scratch</b> - it appears as those exact characters, three lines, wrapped. Screenshot-equivalent in one line: what PVE stores is what you see.

The part you flagged that turned out to be a real bug. You asked for the previous config to be cleared while the next one loads, and you were right that it was not happening: the clear sat inside the isQemu guard, so it only ran when you clicked a container. Switching between two VMs kept the old machine, BIOS, CPU and network on screen until the new request came back. Nobody noticed because those fields read alike on most VMs - a description is a sentence about one specific VM, which is what would have made it visible.

Clearing alone would not have been enough either. Two requests can still land out of order and the older one wins, so the effect drops an answer that has been superseded rather than painting it. Both are tested; the cancellation test exists specifically because clearing looks like it solves this and does not.

MrMasterbay avatar Sep 28 '26 21:09 MrMasterbay

The QEMU description now shows in the Corporate summary as plain text. Line breaks are kept, long lines wrap, and there is no row when the description is empty. Switching between VMs also clears the previous config and ignores late answers, so another VM's description can no longer stay on screen. This ships in 1.3.0.

Marcus

mkellermann97 avatar Oct 07 '26 04:10 mkellermann97