Skip to content

Topology interaction improvements#113

Merged
GyulyVGC merged 1 commit into
NullNet-ai:mainfrom
antoncxx:topology-focus
Jun 26, 2026
Merged

Topology interaction improvements#113
GyulyVGC merged 1 commit into
NullNet-ai:mainfrom
antoncxx:topology-focus

Conversation

@antoncxx

@antoncxx antoncxx commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Click empty space to deselect

Clicking anywhere on the topology canvas that isn't a node or edge now closes the detail panel and deselects the current selection. Previously the only way to deselect was to click the same node again.

Implementation: a transparent full-size <rect> is added as the first (bottom) SVG child and fires PANEL_CLOSED on click. Node and edge handlers call stopPropagation() so their clicks don't bubble through to the background.

Auto-clear client focus on disconnect

When a client was selected from the Internet node panel and then disconnected, the topology stayed in the dimmed/focused state indefinitely. Now it clears automatically.

Two complementary mechanisms handle this:

  1. SSE fast path — on session_torn_down, if event.client_ip matches the focused client, FOCUS_CLEARED is dispatched immediately without waiting for a data refresh.
  2. Sessions watcher — a useEffect on [sessions, focusedClientIp] checks whether the focused IP still exists in the session list and dispatches FOCUS_CLEARED if not. This fires promptly because sessions are now also refetched on every session_created / session_torn_down SSE event (previously only graph and chains were refetched on SSE).

The two paths are complementary: the SSE check is the fast path; the sessions watcher is the reliable fallback in case of IP format differences between the SSE payload and the sessions API.

- Click empty space to deselect a selected node
- Auto-clear client focus when the focused client disconnects: sessions
  are refetched immediately on SSE session_torn_down events and a
  watcher clears the focus state as soon as the client leaves the list
@antoncxx antoncxx changed the title Topology focus Topology interaction improvements Jun 26, 2026
@antoncxx antoncxx marked this pull request as ready for review June 26, 2026 01:52
@GyulyVGC GyulyVGC added the enhancement New feature or request label Jun 26, 2026
@GyulyVGC GyulyVGC merged commit 49767f4 into NullNet-ai:main Jun 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants