Skip to content

feat(config): pending-changes engine — desired vs actual VM config with apply/revert#73

Merged
pparage merged 12 commits into
devfrom
feature/pending-changes
May 20, 2026
Merged

feat(config): pending-changes engine — desired vs actual VM config with apply/revert#73
pparage merged 12 commits into
devfrom
feature/pending-changes

Conversation

@pparage
Copy link
Copy Markdown
Member

@pparage pparage commented May 20, 2026

What

Adds a VM configuration drift feature: an editable ConfigPanel for deployed VMs that tracks desired vs actual config, surfaces per-field drift, and applies changes through an orchestrated dialog.

  • usePendingChanges diff engine (+ tests) and changeCategories mapping (+ tests)
  • ApplyChangesDialog with categorized changes and orchestrated apply
  • desiredConfig/actualConfig state initialized on deploy/import; WebSocket status writes to actualConfig
  • editable deployed-VM fields with per-field revert icons and a pending-changes strip on InfraNodeVm
  • setName/setDescription/setCpu/setMemory API methods (+ setTags path fix)

Integration

This branch was based on the pre-v1 dev. Current dev (the v1 line) has been merged in and conflicts resolved:

  • ConfigPanel.vue: kept both the pending-changes wiring and v1's confirm/toast usage; feature verified wired (usePendingChanges called, ApplyChangesDialog in template, drift bound across fields).
  • vite.config.js: took dev's canonical config (callback form + dev-gated devtools + proxy/worker).
  • api.ts/deploymentStore.ts/ProjectEditor.vue: auto-merged.

Verification

  • lint: 0 errors
  • build: passes
  • tests: 331 passed (50 files), including the feature's usePendingChanges + changeCategories suites

Note for review

ConfigPanel.vue is a large auto-merge of two heavy rewrites; it compiles, lints, and tests green, but a visual QA pass of the deployed-VM edit/apply/revert flow is recommended before merge.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4e3e80238

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/composables/usePendingChanges.ts Outdated
import { getChangeCategory, getChangeLabel } from '@/constants/changeCategories'
import type { PendingChange } from '@/services/proxmox/types'

const DIFFABLE_FIELDS = ['name', 'cores', 'memory', 'tags']
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Diff description fields in pending-change engine

The pending-change diff only checks ['name', 'cores', 'memory', 'tags'], even though the deployed VM form now allows editing description and ApplyChangesDialog has a description apply path. This means description-only edits never produce pending changes (so Apply/Discard actions do not appear), and description updates are skipped even when applying other fields.

Useful? React with 👍 / 👎.

<div class="flex gap-1 mb-3">
<button class="btn btn-xs btn-success flex-1" :disabled="actionLoading" @click="handleVmAction('start')">Start</button>
<button class="btn btn-xs btn-warning flex-1" :disabled="actionLoading" @click="handleVmAction('stop')">Stop</button>
<button class="btn btn-xs btn-info flex-1" :disabled="actionLoading" @click="handleVmAction('pause')">Pause</button>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle pause action in VM action switch

The deployed VM panel now renders a Pause button that calls handleVmAction('pause'), but the action switch has no pause branch. In this flow, clicking Pause performs no VM command and silently acts like a no-op, so users cannot actually pause a running VM from this control.

Useful? React with 👍 / 👎.

</span>
<button
class="text-[9px] font-medium text-amber-600 dark:text-amber-400 hover:text-amber-800 dark:hover:text-amber-200"
@click.stop="emit('open-apply-dialog')"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire pending-change Apply strip to a real handler

The new node-level pending-changes strip emits open-apply-dialog, but there is no listener wired for that event in the VM node host path (the node-vm slot currently just renders <InfraNodeVm v-bind="props" />). As a result, the Apply button shown on the node card does nothing when clicked.

Useful? React with 👍 / 👎.

- usePendingChanges: include 'description' in DIFFABLE_FIELDS so
  description-only edits register as pending changes and get applied (P1)
- ConfigPanel: add pause/resume cases to handleVmAction so the Pause
  button is no longer a no-op (P2)
- ProjectEditor: wire the node-card Apply strip's open-apply-dialog event
  to open the node's ConfigPanel and surface the apply dialog (P2);
  ConfigPanel exposes openApplyDialog() for this
@pparage pparage merged commit 6f75262 into dev May 20, 2026
1 of 2 checks passed
@pparage pparage deleted the feature/pending-changes branch May 20, 2026 14:22
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.

1 participant