Skip to content

feat(sort): add SortToggle for Logs, History, and Network (#1371)#1372

Open
cliffhall wants to merge 2 commits into
v2/mainfrom
feat/1371-sort-toggle
Open

feat(sort): add SortToggle for Logs, History, and Network (#1371)#1372
cliffhall wants to merge 2 commits into
v2/mainfrom
feat/1371-sort-toggle

Conversation

@cliffhall
Copy link
Copy Markdown
Member

Summary

  • Adds a reusable SortToggle element (Mantine Select with "Sort: Newest First" / "Sort: Oldest First").
  • Wires it into the Logs, History, and Network panels and applies a memoized chronological sort to the rendered entries (source state is untouched — sort stays presentational).
  • Persists each screen's choice independently to localStorage under inspector.sortDirection.{logs,history,network} via @mantine/hooks useLocalStorage. Invalid stored values fall back to the newest-first default so the toggle never renders in an unselectable state.
  • Adds a small in-memory localStorage shim in the unit-test setup because Node 22+ exposes an experimental placeholder that masks happy-dom's implementation when --localstorage-file is not provided.

Closes #1371.

Test plan

  • npm run validate (format, lint, build, unit tests + coverage)
  • npm run test:storybook (323 stories pass under headless Chromium)
  • Manually flip sort in each screen, reload, and confirm restore
  • Manually corrupt inspector.sortDirection.logs in DevTools and confirm fallback to "Sort: Newest First"

🤖 Generated with Claude Code

Introduces a reusable SortToggle element and wires it into the Logs,
History, and Network screens so users can flip chronological order.
Selection is persisted per-screen to localStorage under the
inspector.sortDirection.* namespace, with invalid stored values falling
back to the newest-first default.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label May 28, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant