Skip to content

Follow-ups to #255: expanded group dead end on mobile, nodesEsc listener leak, two test gaps #259

Description

@dborup

Follow-ups from the review of #255 (#254, merged as 3bb2cb89). Items 1 and 2 are pre-existing behaviour that #255 did not cause. Items 3 and 4 are test gaps in #255's own tests. Line references are to master 3bb2cb89.

1. An expanded packet group has no collapse path after crossing to mobile width

At 1400 px, expand a multi-observation group in the grouped packets view, then resize to ≤ 600 px. The row re-renders as select-hash without aria-expanded, as #255 intends. It keeps class="expanded", though, and its child rows stay visible. The expand column is hidden at that width, so nothing can collapse the group.

Before #255 the same row announced a stale aria-expanded="true", so this is not a regression. It is the dead end that upstream #1461 #7 describes.

Expected: a group expanded on desktop does not leave visible children on mobile without a way back. For example:

  • clear the hash from expandedHashes when the layout mode flips to mobile; or
  • keep the state but omit the child rows from the visible slice while in mobile mode, so they come back on desktop.

Test: an E2E that expands a group at 1400 px, resizes to 390 px and asserts that no child rows are visible, or that the group can be collapsed. Add a mutant without the fix.

2. nodes.js adds a document keydown listener (nodesEsc) on every node-page init

init() adds the listener on each visit, and it is only removed when Escape is pressed. Navigating between nodes A → B → C stacks three listeners, and Escape then sets the same hash three times. That is harmless today, but the listeners leak.

Expected: at most one listener. Remove it in the page's destroy(), or register it once. Add a test that counts the listeners, or the hash writes, after repeated navigation.

3. Test gap: the unit test does not prove that the node page uses the new renderer

test-issue-254-affinity-debug-toggle.js exercises renderAffinityDebugCard() in isolation. A mutant that puts the old inline onclick card back into the loadFullNode template, and leaves the renderer exported but unused, passes the unit test 9/9; only the E2E catches it. The "no inline event handler anywhere in the card" case is also green on master, because it scans an empty string there.

Expected: a fast-layer assertion that the loadFullNode template uses renderAffinityDebugCard(), or that nodes.js has no onclick= in the #node-affinity-debug card.

4. Test gap: Space on a mobile group row

The #254 E2E presses Enter on a 390 px group row but not Space. The handler treats both keys the same, and the review checked Space by hand: the detail sheet opens and the group does not expand. Add Space to the E2E.

Evidence

No activity

Activity on this issue will appear here.

Activity

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

    bugSomething isn't workingtype:bugSomething broken

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions