Skip to content

canvas multi-select, marquee and context menu are live on the readonly org chart and untested there #14749

Closed

Description

@mrveiss

Summary

#14660 landed multi-select, marquee and the canvas context menu, and its body
described them as "implemented, not proven". For three of those entry points
that undersells it: they are live in the readonly Company OS mount, and
none is gated on readonly.

Filed as the follow-up required before #14660 merged.

The untested surface

On OrgChart.vue, which mounts the canvas readonly:

  • shift-click and Enter toggle selectedIds, and each change re-emits
    node-selected — which OrgChart.vue does listen to.
  • a left-press on empty canvas starts a marquee anywhere on the org chart.
  • right-click and the .node-menu-btn both open the context menu, and its
    detach-process / detach-tool actions emit process-detached /
    tool-detached, which OrgChart.vue wires to real handlers.

Only delete is !readonly-gated. So there is an untested trigger for a
real mutation on a surface #14660 was not about.

Why this was a follow-up and not a merge block

The risk is bounded: those actions reuse the exact emit(...) calls the card's
own detach buttons already make, and those are independently tested — so the
plumbing is proven and only the new entry point is not. The readonly-mode
toolbar assertion (toHaveLength(4) → (6)) already caught the button
exposure, which is evidence the existing tests do their job.

By contrast the add / delete / connect trio genuinely is inert there:
OrgChart.vue registers no @node-added, @node-removed,
@nodes-connected or @nodes-disconnected listeners. So #14660's reasoning was
right for those three and wrong for these three.

Also in scope

Bulk delete from the context menu loops deleteNode(id), pushing one
history entry per node rather than one per gesture. That is inconsistent with
the single-entry-per-gesture principle #14660 proved for drag — and proved
properly, with a test that fails if the drag pushes per-tick.

Worth considering alongside: contextMenuActions is ~60 lines and new.
Splitting it into readonly-safe and authoring halves would make the boundary
explicit in code rather than by convention comment, which given the finding
above is worth more than the line count suggests.

Acceptance criteria

  • OrgChart.vue is exercised for right-click and …-button detach,
    marquee, and shift-click — asserting at the handler, not just that the
    menu opened
  • Bulk delete pushes one history entry per gesture, proven by mutation
  • The readonly boundary is expressed in code rather than by comment, or a
    test pins which actions are readonly-gated so the next addition cannot
    quietly widen the surface

Activity

  1. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  2. mrveiss commented on Nov 6, 2026

    @mrveiss
    OwnerAuthor

    Closure check against origin/main @ 4a0f0e6. PR #20679 (Refs) landed via train #20896 (merged head b385ff4 is an ancestor of main; the PR itself shows OPEN).

    AC Verdict Evidence
    OrgChart.vue is exercised for right-click and …-button detach, marquee, and shift-click, asserting at the handler. NOT met The new gesture tests are on the canvas, autobot-frontend/src/components/workflow/__tests__/WorkflowCanvas.readonlyGates.test.ts and WorkflowCanvas.contextMenu.test.ts. Count of contextmenu/marquee/shiftKey hits in src/views/llc/__tests__/OrgChart*: 0
    Bulk delete pushes one history entry per gesture, proven by mutation. NOT met Untouched by the PR; no mutation-checked test found. WorkflowCanvas.vue:1374 only documents the single-entry principle
    The readonly boundary is expressed in code rather than by comment, or a test pins which actions are readonly-gated. delivered WorkflowCanvas.readonlyGates.test.ts:93,122,147 pin the exact readonly menu ids (['select','zoom'], ['open-workflow','zoom'], ['select','zoom','fit-selection']), and l.109 asserts no mutating id; a new action widening the surface fails

    Left: AC 1 and AC 2. Issue stays open.

  3. github-actions commented on Nov 14, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21537, merge 9aa2d4d265) via #21534

  4. mrveiss commented on Nov 14, 2026

    @mrveiss
    OwnerAuthor

    Closure check against main after the landing in #21537 (merge 9aa2d4d265, carrying #21534, which adds the org chart gesture spec).

    Criterion Evidence on main Ticked
    OrgChart.vue exercised for right-click and ...-button detach, marquee, shift-click, asserting at the handler autobot-frontend/src/views/llc/__tests__/OrgChart.canvasGestures.test.ts mounts the real OrgChart and canvas: right-click and the ... button on a process and a tool node (menu has no detach/delete id, del/post not called), shift-click ("adds a node to the selection and sends no request"), marquee ("selects the nodes and sends no request"), and the card's own detach button deletes once for a viewer who may manage. Detach menu items need !readonly && detachable (WorkflowCanvas.vue:2490,2497), and OrgChart mounts readonly (OrgChart.vue:1321). Assertions are at the request layer, downstream of the process-detached handler yes
    Bulk delete pushes one history entry per gesture, proven by mutation not met: WorkflowCanvas.vue:2520 still loops deleteNode(id), and deleteNode (l.1516) calls pushHistory per node; no bulk-delete history test under components/workflow/__tests__ no
    Readonly boundary pinned already ticked (WorkflowCanvas.readonlyGates.test.ts) yes

    Satisfied by: make bulk delete record one history entry (collect the removals, one pushHistory), plus a test that fails when it pushes per node. The issue stays open.

  5. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Closure check against main after #21930 (merge 8d0c736). check-issue-close-refs.sh 14749 clear. The two criteria already ticked were verified earlier; the remaining one is now delivered and ticked.

    • "Bulk delete pushes one history entry per gesture, proven by mutation" - autobot-frontend/src/components/workflow/WorkflowCanvas.vue:1524 removeNode returns an undo record without pushing; :1534-1537 deleteNodes(ids) pushes ONE pushHistory(removed); the context-menu delete calls deleteNodes(bulk ? [...selectedIds.value] : [node.id]) at :2520. Test WorkflowCanvas.bulkDelete.test.ts "one Undo re-adds every deleted node, and a second Undo has nothing left" (asserts the second undo is disabled, which fails with a per-node push). The PR records that reverting the per-node history push fails it; I did not re-run it.
    • Criteria 1 and 3 (gesture spec; readonly gating pinned) remain as ticked; WorkflowCanvas.readonlyGates.test.ts also covers them ("no mutating action appears on a readonly canvas", "a multi-selection stays reachable on readonly, for fit-selection").

    All three delivered; the issue stays closed.

  6. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Host evidence (install at d8cbd91)

    Checked 2026-11-21 ~21:38 Riga. Deployed commit marker on the install = d8cbd91925a19c7e4bc27696382e8b6a01ef2c0d (= origin/main); backend and SLM backend services active. All checks read-only.

    Commands (generic)

    Results

    Check Result
    PR #21930 files, deployed source vs origin/main 6/6 match (incl. WorkflowCanvas.readonlyGates.test.ts, WorkflowCanvas.bulkDelete.test.ts)
    Bulk delete in the built bundle function deleteNodes(e){pushHistory(e.map(removeNode).filter(e=>e!==null))}, function deleteNode(e){deleteNodes([e])}: one history entry per gesture

    Verdict

    Partial (host-checkable part verified). The single-history-entry bulk delete is live in the served bundle. The other two ACs, the OrgChart.vue handler tests and the readonly-gate pin, are tests; their sources are deployed and match main, but tests do not run on the host. Their evidence is CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: company-osWave 4 · cluster A — Company OS & LLC canvasbugSomething isn't workingfrontendphase:M3.7Company OS, Automation and BI screenstesting

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions