Skip to content

fix(packets): leaving with the SlideOver open rewrites the new page's URL; Clear Filters on a detail URL re-filters on reload #180

Description

@dborup

Summary

Two pre-existing URL/state bugs on the packets page. The independent review of PR #167 (fix for #147) found both. Neither is caused by #167. Line numbers refer to #167's head d0a9f28e; the same behaviour exists on master 84c637ea.

Relates to #147, #167.

1. Leaving the page with the SlideOver open overwrites the new page's URL

Where: viewport 641–1023 px, where the packet detail opens in a SlideOver.

Steps:

  1. Open a packet so the SlideOver shows.
  2. Navigate to another page (for example Nodes) without closing the SlideOver.

Result: the Nodes page renders, but the address bar is rewritten to the packets route:

A reload or a copied link opens Packets, not the page being shown. The likely cause is the SlideOver close / onClose handler (public/packets.js ~3184), which writes the packets hash during teardown even after the route has changed.

Fix: when the SlideOver (or detail) closes because the page is being left, do not write the hash. Only write it while the current route is still #/packets. Compare the current route before writing, or tear the SlideOver down from destroy() without the hash write.

Test: an E2E at about 800 px: open the SlideOver, navigate to #/nodes, and assert that the address bar is #/nodes…. Repeat after a reload.

2. Clear Filters on a detail URL leaves the subpath, so a reload re-applies the hash filter

Steps:

  1. Open #/packets/<hash>?… with filters, so the list shows 1 row.
  2. Press Clear Filters. The list shows all rows (36 in the fixture), and the Clear button hides.
  3. Reload.

Result: filters.hash is set from the <hash> subpath again, the list goes back to 1 row, and the Clear button reappears. The URL after Clear (#/packets/<hash>?obs=…) still means "filtered to this hash" on load, so it does not describe what Clear showed.

Fix (decide and document):

  • Either Clear Filters also drops the detail subpath, closing the detail and going to #/packets;
  • or a cold load of a detail subpath selects the packet without forcing filters.hash.

Keep #121/#132's Clear Filters behaviour intact otherwise.

Test: unit and/or E2E covering detail URL → Clear Filters → reload, asserting that the list and the Clear button match what was shown before the reload.

Acceptance criteria

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions