Skip to content

GUI has no way to rename a VM (Name column missing from inline-edit columns, despite backend support) #95

Description

@hisamotodev

Summary

The backend fully supports renaming a VM (asb_vm_set_name() in asb_core.c, wired up to the
editVm command with field: "name" in ui.c), but the GUI's inline-edit table never exposes
the Name column as editable, so there is no way to rename a VM from the GUI.

Reproduction

  1. Create a VM, stop it.
  2. Click Edit (✏️) to enter edit mode for the row (icon changes to ✔️).
  3. Click on the VM's Name cell.
  4. Nothing happens — no input field appears, unlike the CPU/RAM/GPU/Network cells.

Root cause

In web/app.js, the inline-edit click handler only wires up columns 4, 5, 7, and 8:

/* Editable columns: 4=CPU, 5=RAM, 7=GPU, 8=Network */
if (editModeRow === row && (col === 4 || col === 5 || col === 7 || col === 8)) {
    td.style.cursor = 'pointer';
    td.title = 'Click to edit';
    td.onclick = function(e) {
        e.stopPropagation();
        startInlineEdit(row, col, td);
    };
}

The Name column (col 1) is not included, so startInlineEdit is never called for it, and no
onclick is ever attached to that cell.

Meanwhile the backend is fully ready to handle it:

// asb_core.c
ASB_API HRESULT asb_vm_set_name(AsbVm vm, const wchar_t *name)
{
    ...
    if (inst->running) return E_ACCESSDENIED;
    if (!name || name[0] == L'\0') return E_INVALIDARG;

    for (i = 0; i < g_vm_count; i++) {
        if (i != idx && _wcsicmp(g_vms[i].name, name) == 0) {
            asb_log(L"Name \"%s\" is already in use.", name);
            return E_INVALIDARG;
        }
    }
    wcscpy_s(inst->name, 256, name);
    save_vm_list();
    ...
}
// ui.c, editVm dispatch
if (wcscmp(field, L"name") == 0) asb_vm_set_name(vm, value);

The headless HTTP/JSON API can already rename a VM today by sending editVm with
field: "name" — it's purely a missing GUI affordance.

Suggested fix

Add the Name column (col 1, or whichever index it is in the row layout) to the editable-column
check in makeCell, and handle it as a text input in startInlineEdit / commitInlineEdit
(mapping to field: 'name'), similar to how CPU/RAM already work as plain text inputs. Probably
also want the same duplicate-name validation surfaced in the UI (the backend already returns
E_INVALIDARG + logs "Name is already in use", so the existing asb_log output would need to
reach the user, or the commit could check vms client-side before sending).

Environment

  • App Sandbox version: (latest as of 2026-07)
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions