Skip to content

refactor(dashboard): declutter the Network detail pane - #34

Closed
maksudur03 wants to merge 1 commit into
mainfrom
feature/dashboard-ui-refactor
Closed

maksudur03 wants to merge 1 commit into
mainfrom
feature/dashboard-ui-refactor

Conversation

@maksudur03

@maksudur03 maksudur03 commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

Declutters the Network detail pane. Five changes:

  • Move the head's facts line into Summary — time, duration, content type, correlation, mock
    rule (still links into Mocks), vs-original.
  • Remove the "General" group from both the Request and Response panes — Summary now holds
    everything it showed. Headers stay collapsed, payload/body expanded (already the default).
  • Give the error string a Summary row (response.error) — General was its only home before,
    and General is gone.
  • Fold the action buttons into a ⋮ menu at the top right, next to the expand button; click
    opens the list.
  • Put Summary first in the tab order.

Web assets only (dashboard.js, dashboard.css, index.html); no Kotlin, no API surface, no
capture-path code.

Verification

  • ./gradlew :sdk:server-ktor:test — passing (includes DashboardAssetsTest, the CSP guard
    that fails the build on inline scripts/handlers in these assets)
  • ./gradlew :sdk:server-ktor:ktlintCheck :sdk:server-ktor:detekt apiCheck — clean
  • ./gradlew ktlintCheck detekt (repo-wide) — fails on two pre-existing issues outside this
    diff
    , both in files this PR does not touch (and which Kotlin lint could not be affected by,
    since this diff is .js/.css/.html only):
    - samples/foundation-app/.../MainActivity.kt:335,504 — 4 ktlint violations
    - sdk/server-api/.../LocalServerEngine.kt:205 — detekt TooManyFunctions on
    SessionAuthority (13/11)
  • ./gradlew apiCheck — clean; no public API change, so no apiDump needed
  • Debug/release boundary: not touched, no sample assemble/verify needed

Beyond Gradle, every path was exercised by driving the real index.html/dashboard.css/
dashboard.js in a browser against a stub server:

  • All eight menu actions by real click — Flag/unflag (evidence count round-trips), Pin/unpin (BASE
    row tag and the Diff tab appear and disappear), Resend, Clone to composer (lands on Composer with
    the curl prefilled), Mock this response (dialog prefilled from the capture), Unmock, cURL and
    fetch (correct text on the clipboard). Each also dismissed the menu.
  • Menu close paths: pick, outside click, Escape.
  • Summary rows on a 200, a mocked capture (mock rule link navigates to Mocks; vs original
    present), and a no-response failure (response.error present).
  • Group defaults: headers collapsed, payload/body expanded.
  • Simple mode still hides pin/fetch via the existing .detail-action-hide-simple rule.
  • Light and dark themes.

Checklist

  • Capture-path code (network/socket/push) never throws into the host app — not touched
  • No new sensitive data is captured, logged, or exported without going through
    RedactionEngine first — this only rearranges fields the pane already received and
    displayed; the redaction footnote is unchanged
  • Docs updated — new docs/DESIGN_SPEC.md §4a specifies the detail-pane anatomy (shared head,
    kebab-vs-row variants, tab order, group defaults, Simple-mode hiding). §5 and §6 corrected
    where they had gone stale.
  • This PR is scoped to one logical change

Anything reviewers should look at closely

  • The kebab is opt-in, not global. detailHeadHtml gained an actionsMenu flag that only
    renderNetworkDetail passes; WebSockets/Push/Crashes carry two or three actions each and keep
    their flat rows, where a menu would only add a click. One line each to flip them if you'd rather
    the chrome be uniform.
  • .detail-menu-panel is position: fixed, placed by positionDetailMenuPanel(). It has to
    be — .detail-pane-v2 is overflow: hidden, so an absolutely positioned popup clips at the pane
    edge. Same trade the toolbar .drop-panel dropdowns already make.
  • Menu items keep their data-detail-action ids, so the existing delegated click handler in
    wireNetworkDetailPane covers them unchanged; only the markup moved.
  • Pre-existing, untouched, noticed in passing: copyNetworkCurl and cloneCapturedRequest
    both do if (!r.ok) return; with no toast, so a failing /curl fetch is completely silent to
    the user. Out of scope here — worth its own fix.

🤖 Generated with Claude Code

The Network detail head had grown three stacked strips above the tabs — a
facts row, an actions row, and the tabs themselves — pushing the request and
response panes well down the viewport. Each strip also duplicated something
already on screen: the facts repeated what the compare panes' "General" groups
showed, and the actions row spent a full row on buttons that are used
occasionally, not per-capture.

Consolidate onto the Summary tab and a kebab menu:

- Move the facts strip (time, duration, content type, correlation, mock rule,
  vs-original) out of the head and into Summary, where the mock rule keeps its
  link into Mocks via a new `mockRuleLink` kv-grid row type.
- Drop the "General" group from both compare panes. Everything it held now
  lives in Summary, so the tab is just headers and body.
- Give the failure branch's error string its own `response.error` Summary row
  instead of parenthesising it into `response.status`; it was previously only
  reachable through the General group that just went away.
- Replace the actions row with a kebab (⋮) menu beside the expand button.
  Opt-in per pane via `actionsMenu`, so WebSockets/Push/Crashes — two or three
  actions each — keep their flat rows. Items carry the same
  `data-detail-action` ids, so the existing delegated handlers are unchanged.
  Closes on pick, outside click, and Escape.
- Order Summary first among the tabs. Default selection is still
  Request & response.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@maksudur03 maksudur03 self-assigned this Aug 25, 2026
@maksudur03 maksudur03 closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant