[OpenNMS/opennms] ec2c90: NMS-19878: Place a new label under the cursor, and...

Marshall Massengill via opennms-cvs <[email protected]>
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/mm/NMS-19878-smoke/[email protected]>
  Branch: refs/heads/mm/NMS-19878-smoke
  Home:   https://github.com/OpenNMS/opennms
  Commit: ec2c90b39a86ce552aef08f613f3d01915c38dca
      https://github.com/OpenNMS/opennms/commit/ec2c90b39a86ce552aef08f613f3d01915c38dca
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M ui/src/components/Topology/TopologyCanvas.vue
    M ui/src/components/Topology/layout.ts
    M ui/tests/components/Topology/layout.test.ts

  Log Message:
  -----------
  NMS-19878: Place a new label under the cursor, and keep a drawn box on canvas

Double-clicking empty canvas creates a label and enters edit mode immediately.
The edit input was a fixed 12ch wide, and the label box is centered on the click
point, so an empty new label put its caret about 6ch left of the cursor. An
existing label hugs its text and looked right, which is why this showed only for
the case in the report. The input starts at 4ch and grows with the text.

Shape drawing listens for mousemove on `window` so the release still arrives when
the pointer leaves the canvas, but it used those coordinates raw: dragging past
an edge converted to graph points outside the visible area. Start and move are
clamped to the canvas rect now.

The preview also measured against the draw overlay's rect while the commit
measured against the canvas's -- they coincide today, both layers being inset:0
on the same parent, so this was latent rather than the reported symptom, but the
comments already flagged the mismatch. Both use the same rect, so the preview
cannot drift from the shape it creates.

The clamp lives in layout.ts as a pure helper rather than inside the canvas
component, which has no tests of its own because sigma touches WebGL on import.


  Commit: e2e96961b3a069d6177a92a227951b12dde43fb9
      https://github.com/OpenNMS/opennms/commit/e2e96961b3a069d6177a92a227951b12dde43fb9
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M ui/packages/onms-ui/src/components/OnmsDialog.vue
    A ui/src/components/Topology/ViewNameDialog.vue
    M ui/src/containers/Topology.vue
    A ui/tests/components/Topology/ViewNameDialog.test.ts
    M ui/tests/containers/Topology.test.ts
    M ui/tests/onms-ui/OnmsDialog.test.ts

  Log Message:
  -----------
  NMS-19878: Name a view in a dialog instead of window.prompt

New, Save As and Rename each asked for a name with window.prompt. Beyond looking
nothing like the rest of the page, that carried a real fault: once a user ticks
"prevent this page from creating additional dialogs" -- offered by Chromium after
a couple of prompts, and easy to hit while creating several views -- every later
prompt is suppressed and returns null, which all three read as "cancelled". The
buttons then did nothing at all, with no error, until the page was reloaded.

One ViewNameDialog serves all three. The mode decides the wording, what the
field is seeded with, and what the answer does, so the collision rule stays
where the difference actually lives: Save As has to create a new entry, so the
open view's own name is a conflict, while Rename may keep it and treat it as a
no-op.

The collision check moves ahead of the request rather than following it. prompt
could only close and then toast; the dialog disables the action, names the view
already using the name, and lets the user edit without retyping the rest. The
toast is still there for the case the check cannot cover, a catalog gone stale
against another session.

OnmsDialog gains a `show` re-emit. Focus has to move into the field once it is
in the DOM, and the dialog appends to body behind a transition, so mount and
nextTick are both too early.


  Commit: 9028f6e1756d0c5ca26a0dcc619aae7ee5ff376c
      https://github.com/OpenNMS/opennms/commit/9028f6e1756d0c5ca26a0dcc619aae7ee5ff376c
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    R ui/src/components/Topology/ViewManager.vue
    M ui/src/stores/topologyStore.ts
    M ui/src/types/topology.ts
    R ui/tests/components/Topology/ViewManager.test.ts

  Log Message:
  -----------
  NMS-19878: Drop the unreachable ViewManager

A standalone catalog browser with list, rename and delete. Nothing imported it:
the only reference outside its own test was two comments naming it as a caller.
Topology.vue grew its own rename and delete against the same store actions
instead, so the page it was meant to be never got built.

Left alone it would have been the last window.prompt and window.confirm in the
tree, and worth a dialog nobody could open. The store actions and the catalog
type stay: the view chooser and the collision check use both.


Compare: https://github.com/OpenNMS/opennms/compare/ad64c6455544...9028f6e1756d

To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.