diff --git a/docs/DESIGN_SPEC.md b/docs/DESIGN_SPEC.md
index 9d00310..c7c4b50 100644
--- a/docs/DESIGN_SPEC.md
+++ b/docs/DESIGN_SPEC.md
@@ -232,6 +232,63 @@ must recompute mid-scroll rather than assume) — see §9.
- **Toolbar** (`.toolbar`): flex row, wraps, `align-items: flex-end` so label-stacked fields
(uppercase label over input) share a bottom baseline with bare buttons. (This was a bug — see §9.)
+## 4a. Detail pane anatomy (split views)
+
+Four of the five split views build their right-hand pane from one shared helper (`detailHeadHtml`) —
+Network, WebSockets, Push and Crashes. Timeline hand-rolls its own head from the same classes and
+is the odd one out; folding it into the helper is an open item (§9).
+
+```
+┌ .detail-head ────────────────────────────────────────────────┐
+│ [BADGE] [MOCK] title (mono, ellipsis) STATUS [⤢] [⋮] │ head row
+│ ‹facts strip — see table below› │ .detail-facts
+│ ‹actions row — see table below› │ .detail-actions-row
+│ Summary │ Request & response │ Headers │ … [Stacked] │ .detail-tabs
+├ .detail-find (compare/diff tabs only) ───────────────────────┤
+│ Find in headers, payload and response… N matches │
+├ .detail-body (scrolls) ──────────────────────────────────────┤
+│ ┌ .sbs-pane ────────┐ ┌ .sbs-pane ────────┐ │ .sbs-grid
+│ │ ● Request [Copy] │ │ ● Response [Copy] │ │
+│ │ › Request headers │ │ › Response headers│ │ collapsed
+│ │ ⌄ Payload │ │ ⌄ Body │ │ expanded
+│ └───────────────────┘ └───────────────────┘ │
+│ redaction footnote │
+└──────────────────────────────────────────────────────────────┘
+```
+
+**Two variants of the head's middle band.** The facts strip and the actions row are per-pane
+choices, not fixed furniture:
+
+| Pane | Facts strip | Actions |
+|---|---|---|
+| **Network** | none — folded into the Summary tab | kebab **⋮** menu, right of the expand button |
+| WebSockets, Push, Crashes | `.detail-facts` row under the title | flat `.detail-actions-row` |
+
+The kebab is opt-in via `detailHeadHtml`'s `actionsMenu` flag. Network carries up to seven actions
+(flag, pin, resend, clone, mock *or* unmock, cURL, fetch) — a full row of buttons for controls
+used occasionally, not per-capture. The other panes carry two or three, where a row costs nothing
+and a menu would only add a click. Menu items keep the same `data-detail-action` ids as row
+buttons, so a pane's delegated click handler is identical either way. The panel is
+`position: fixed` (placed by `positionDetailMenuPanel()`) because `.detail-pane-v2` is
+`overflow: hidden` and an absolutely positioned popup clips at the pane edge — the same trade
+`.drop-panel` makes. It closes on pick, outside click, and Escape (returning focus to its button).
+
+**Network's tab order** is `Summary · Request & response · [Diff vs baseline] · Headers · Timing ·
+Related events`. Summary leads because it absorbed the head's old facts strip and is the "what is
+this capture" view: time, duration, request url/method, response status, `response.error` on a
+failure, content type, correlation id, mock rule (a link into Mocks), vs-original field count, and
+tags. Diff only appears once a baseline is pinned. **Default selection is Request & response**, not
+the first tab — the body is what an engineer opens a capture to read.
+
+Consequently Network's two compare panes hold only headers and body; they have no "General" group,
+because everything it used to duplicate now lives one tab left. Group collapse defaults come from
+`detailGroupHtml`: `Payload`/`Body` open, everything else collapsed, an explicit user toggle always
+winning over the default.
+
+**Simple mode** hides the Headers/Timing/Related tabs outright, and hides individual actions that
+carry `hideInSimple` (`fetch` always; `pin` only while no baseline is pinned, so a pinned baseline
+can never be stranded behind a mode switch).
+
## 4b. Layout (Android in-app inspector)
- **Bottom nav, 4 destinations:** `01 Observe · 02 Control · 03 Data · 04 More` (numbered + label,
@@ -300,7 +357,9 @@ tray screen becomes a natural addition, just not one this pass builds.
- **Segmented control** (`.seg`): joined buttons, one active (signal).
- **Chips / chip-row** (`.chip-row`): wrapping pill filters.
- **Cards** (`.card`): panel surface, 1px `--line`, 16px pad, `h2` with small leading icon.
-- **Split panes:** `.list` (rows) + `.splitter` + `.detail-pane` (min-width 300px).
+- **Split panes:** `.list-pane` (rows) + `.splitter` (5px) + `.detail-pane-v2`, inside `.split-shell`
+ (min 360px per column). Detail-pane anatomy — head, facts/actions variants, tabs, find bar,
+ side-by-side groups — is specified in §4a.
- **Data table** (`.db-table`): real `
`, `
`, truncation via `.db-truncated`,
horizontal scroll in `.db-table-wrap`.
- **Empty states** (`.empty-state`): centered icon + title + sub. Used widely — design these well;
@@ -317,9 +376,10 @@ tray screen becomes a natural addition, just not one this pass builds.
1. **Overview** — landing / status summary, connect prompt when unauthenticated, and the
previous-run-crashed banner (see [CRASH_AND_ANR.md](CRASH_AND_ANR.md#the-previous-run-crashed-banner)).
-2. **Network** — captured HTTP list + detail; toolbar (search, status seg, method seg, Apply, Clear,
- HAR, Postman); detail action row (Clone to composer, cURL, fetch, JSON, Related events); redacted
- metadata pane.
+2. **Network** — captured HTTP list + detail; toolbar (search, status seg, method seg, service drop,
+ HAR, Postman, Clear) over a "More filters" disclosure; redacted metadata pane whose actions
+ (flag, pin, resend, clone, mock/unmock, cURL, fetch) live in the head's **⋮ menu** and whose tabs
+ lead with Summary — see §4a.
3. **WebSockets** — socket sessions (URL, STATE/SENT/RECV), frame list per socket.
4. **Timeline** — unified event timeline (search).
5. **Crashes** — crash/ANR list + detail: kind/thread badges, breadcrumb strip, the all-thread dump
@@ -427,6 +487,10 @@ The final web visual contract relies on a rigid separation of concerns. `dashboa
next step: the device's More screen, the `adb forward tcp:8080 tcp:8080` command (with its caveat
that 8080 is only the first port tried), and the two browser access modes: a bare URL by default or
the `#code=` credential when SESSION_CODE is selected.
+- **Network's detail head carried three stacked strips** (facts, actions, tabs) before the panes
+ even started, each duplicating something already on screen — the facts repeated the compare
+ panes' "General" groups. Facts moved into the Summary tab, the General groups went away, the
+ actions row became a ⋮ menu, and Summary was ordered first. See §4a.
- **Cross-surface parity was undecided** — resolved and documented in §4c, with a full 16-row table
of which web views the Android inspector mirrors, which it deliberately doesn't (Composer, capture
rules, Overview), and one open naming mismatch (Timeline / Logs) left as a documented gap rather
@@ -435,6 +499,8 @@ The final web visual contract relies on a rigid separation of concerns. `dashboa
**Open / worth a design eye:**
- **Table/detail density** on Network/Database detail panes — readability at scale — is still
unaddressed by this pass.
+- **Timeline's detail head is hand-rolled** rather than built from `detailHeadHtml` like the other
+ three split views (§4a), so it drifts from them silently whenever the shared helper changes.
- **The Timeline / Logs naming mismatch** (§4c) — same underlying event stream, different name on
each surface. Documented, not fixed; fixing it is a code change (renaming `ObserveTab.LOGS` or the
web view, or both to a shared name), out of scope for a documentation-only pass.
diff --git a/samples/compose-app/src/main/kotlin/io/devconsole/sample/compose/MainActivity.kt b/samples/compose-app/src/main/kotlin/io/devconsole/sample/compose/MainActivity.kt
index f2bbf48..484ed4e 100644
--- a/samples/compose-app/src/main/kotlin/io/devconsole/sample/compose/MainActivity.kt
+++ b/samples/compose-app/src/main/kotlin/io/devconsole/sample/compose/MainActivity.kt
@@ -112,14 +112,33 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
+import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
+import okhttp3.RequestBody.Companion.toRequestBody
import org.eclipse.paho.client.mqttv3.MqttAsyncClient
import org.eclipse.paho.client.mqttv3.MqttConnectOptions
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence
import java.io.File
import java.util.concurrent.atomic.AtomicInteger
+/** Public read endpoint: answers gzipped and chunked, which is what the capture tee is built for. */
+private const val SAMPLE_GET_URL = "https://jsonplaceholder.typicode.com/todos/1"
+
+/**
+ * Public write endpoint. It echoes the posted object back with an `id`, so one tap produces a
+ * capture carrying a real request body *and* a real response body -- the pair every other sample
+ * action leaves half empty, and the only way to exercise the request side of the inspector
+ * (payload viewer, cURL/fetch reproduction, mock-from-request) against live traffic.
+ *
+ * Nothing is persisted: jsonplaceholder fakes the write and always answers 201 with id 101.
+ */
+private const val SAMPLE_POST_URL = "https://jsonplaceholder.typicode.com/posts"
+
+/** Sent by [SampleActivity.sendJsonPost]; small enough to read whole in either inspector. */
+private const val SAMPLE_POST_BODY =
+ """{"title":"DevConsole sample","body":"Posted from the compose sample app","userId":9912837}"""
+
private const val SHOW_ORDER_HISTORY_FLAG = "compose_sample.show_order_history"
private const val MOCK_RULE_ID = "compose-sample-orders"
@@ -251,7 +270,12 @@ private fun devConsoleStatusText(
* owns the server lifecycle and builds its own launch surface on top of [DevConsole.state], but can
* also drop into the SDK's own in-app inspector (More screen QR, Data rail, exports) via
* [DevConsole.open].
+ *
+ * Carries one private method per capability it demonstrates (GET, POST, Ktor, MQTT, screenshot,
+ * push, ...), which is what the `TooManyFunctions` suppression below covers: splitting them across
+ * helper classes would put each demonstration somewhere other than the screen that offers it.
*/
+@Suppress("TooManyFunctions") // One private method per capability demonstrated; see the class doc.
class MainActivity : ComponentActivity() {
private val socketClient = OkHttpClient()
@@ -274,9 +298,14 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
DevConsole.initialize(application, buildConfig())
- // Mock rules are SESSION-scoped and dropped whenever the embedded server restarts (fresh
- // session), so the rule is (re)installed from the Running-state observer below rather than
- // once here -- a one-shot install here would silently stop mocking after any restart.
+ // Installed here AND re-installed from the Running-state observer below. Both are needed:
+ // mock rules are SESSION-scoped and DevConsole's stop sequence calls clearSessionRules(),
+ // so a one-shot install would silently stop mocking after any restart -- but installing
+ // *only* on Running left the rule missing until the embedded server was first started,
+ // which made a fresh launch show an empty Mocks list and send "Send mocked request"
+ // to the real network. Mocking is in-process and needs no server, so it should not wait
+ // for one.
+ installMockRule()
seedSampleData(applicationContext)
setContent {
@@ -399,7 +428,7 @@ class MainActivity : ComponentActivity() {
if (state is DevConsoleState.Running) {
endpoint = DevConsole.endpoint()
// Re-seed on every Running transition (first start AND every restart) -- see the
- // comment in onCreate for why a one-shot install at init isn't enough.
+ // comment in onCreate for why the install there isn't enough on its own.
installMockRule()
// Poll while running so either access mode updates the displayed URL after a restart;
// SESSION_CODE also re-issues the code after a browser consumes it.
@@ -505,16 +534,20 @@ class MainActivity : ComponentActivity() {
SectionLabel("Exercise the SDK")
CapabilityCard(
- title = "Send network request",
+ title = "Send GET request",
subtitle = "OkHttp interceptor -- chunked response, body captured via the tee",
onClick = {
scope.launch {
- lastResponse =
- sendRequest("https://jsonplaceholder.typicode.com/todos/1", "Network response")
+ lastResponse = sendRequest(SAMPLE_GET_URL, "GET response")
showOrderHistory = DevConsole.featureFlagValue(SHOW_ORDER_HISTORY_FLAG)
}
},
)
+ CapabilityCard(
+ title = "Send POST request",
+ subtitle = "JSON request body and JSON response body -- both captured on the same transaction",
+ onClick = { scope.launch { lastResponse = sendJsonPost() } },
+ )
CapabilityCard(
title = "Send Ktor request",
subtitle = "Ktor plugin on the CIO engine -- request and response bodies, no OkHttp involved",
@@ -630,6 +663,37 @@ class MainActivity : ComponentActivity() {
}
}
+ /**
+ * Posts [SAMPLE_POST_BODY] to [SAMPLE_POST_URL] through the same instrumented client the GET
+ * card uses, so the capture carries both bodies.
+ *
+ * The request body goes through OkHttp's own `RequestBody`, not a pre-serialized string handed
+ * to the recorder: the capture interceptor reads what OkHttp actually writes to the wire, so
+ * what the inspector shows is the request as sent rather than as intended. `Content-Type` comes
+ * from the media type here (not a manual header) for the same reason -- it is the one the call
+ * really carries.
+ */
+ private suspend fun sendJsonPost(): String =
+ withContext(Dispatchers.IO) {
+ requestCount.incrementAndGet()
+ try {
+ val request =
+ Request
+ .Builder()
+ .url(SAMPLE_POST_URL)
+ .post(SAMPLE_POST_BODY.toRequestBody("application/json; charset=utf-8".toMediaType()))
+ .build()
+ instrumentedClient.newCall(request).execute().use { response ->
+ val body = response.body?.string().orEmpty()
+ "POST response: ${response.code} (${body.length} chars)"
+ }
+ } catch (cancellation: kotlinx.coroutines.CancellationException) {
+ throw cancellation
+ } catch (error: Exception) {
+ "POST failed: ${error.message ?: error.javaClass.simpleName}"
+ }
+ }
+
/**
* Issues one request through the sample's Ktor client, whose debug build installs
* `DevConsoleKtorClientPlugin` (see `SampleKtorClient` in `src/debug`).
diff --git a/sdk/server-ktor/src/main/resources/devconsole-web/dashboard.css b/sdk/server-ktor/src/main/resources/devconsole-web/dashboard.css
index 4a23a99..1bcd2f2 100644
--- a/sdk/server-ktor/src/main/resources/devconsole-web/dashboard.css
+++ b/sdk/server-ktor/src/main/resources/devconsole-web/dashboard.css
@@ -741,6 +741,8 @@ body.detail-zoom .split-shell.collapse-detail { grid-template-columns: 1fr; }
.col-status { flex: 0 0 62px; text-align: right; }
.col-flag { flex: 0 0 24px; text-align: right; }
@media (max-width: 620px) { .col-duration { display: none; } }
+/* The stacked pair keeps both values at every width — it costs one column, not two, and Network's
+ list head is sr-only anyway, so there is no header to drift out of step with it. */
/* Export-selection checkbox (Network list only): header "select all visible" + one per row.
Same 24x24/6px-radius footprint as .row-flag so the row height and header never shift when a
@@ -765,9 +767,14 @@ body.detail-zoom .split-shell.collapse-detail { grid-template-columns: 1fr; }
.detail-pane-v2 { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--ground); }
/* ---- List rows ---- */
+/* `min-height`, not `height`: a row with a path too long for one line grows to fit it (up to the
+ four-line clamp on .row-main-text below). The virtualizer measures each painted row rather than
+ multiplying by --d-row-h, so a taller row costs nothing but its own pixels — see
+ createVirtualList's `heights` cache. Vertical padding is what keeps a grown row off its own
+ borders; a one-line row still lands on exactly --d-row-h. */
.row {
- position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: var(--d-row-h);
- padding: 0 8px 0 12px; text-align: left; cursor: pointer; border-radius: 0; border-inline: 0; border-top: 0; border-bottom: 1px solid var(--line);
+ position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--d-row-h);
+ padding: 4px 8px 4px 12px; text-align: left; cursor: pointer; border-radius: 0; border-inline: 0; border-top: 0; border-bottom: 1px solid var(--line);
background: transparent; color: var(--ink); font: inherit; font-size: var(--d-row-font);
}
.row:hover { background: var(--surface-2); }
@@ -781,12 +788,38 @@ body.detail-zoom .split-shell.collapse-detail { grid-template-columns: 1fr; }
font-family: var(--font-mono); font-size: var(--d-row-main-font); color: var(--ink);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
+/* Opt-in (rowHtml's `wrapMain`, Network only): a long path wraps instead of being cut at the first
+ line, then ellipsises once past four — enough for the query-string-heavy endpoints that were
+ losing everything after the host, without letting one pathological URL own the whole viewport.
+ `word-break: break-all`, not `overflow-wrap`: a query string is one unbreakable token, and
+ overflow-wrap only breaks a token that cannot fit on a line of its own, so it pushed the whole
+ query to line two and left the rest of line one blank. break-all fills every line to the edge,
+ which is what a URL wants — and what prose does not, which is why this is opt-in rather than the
+ rule for every list. The line clamp supplies its own ellipsis, so the single-line
+ `text-overflow` above is turned back off here. */
+.row-main-text.row-main-wrap {
+ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4;
+ white-space: normal; text-overflow: clip; word-break: break-all;
+}
/* Query string trailing a Network row's path: present and readable, but never louder than the endpoint. */
.row-main-sub { color: var(--text-3); }
.row-tag {
flex: 0 0 auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
padding: 1px 4px; border-radius: 99px; border: 1px solid var(--border-strong);
}
+/* Network stacks its status over its duration in one column (rowHtml's `stackMetrics`), the way
+ the Android row reads them; the widths below still apply to the side-by-side lists. Right-
+ aligned and baseline-free so the pair reads as one block however tall the path beside it is. */
+/* `line-height: 1` on the pair, not the default ~1.2: stacked, the two values would otherwise
+ total more than --d-row-h and push every Network row ~12px taller than the other lists' — the
+ opposite of the space this layout is meant to hand back. At 1 they fit the plain row height, and
+ only a wrapped path grows the row. */
+/* `flex: 0 0 auto`, not the 74px the side-by-side lists reserve: stacked, the pair is at most as
+ wide as "1931 ms", and a fixed track just parked that slack to the left of a short "200" — read
+ as a gap between the path and the status roughly four times the row's own 8px one. Auto-sizing
+ hands those pixels back to the path and leaves exactly that 8px. */
+.row-metrics { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; line-height: 1; }
+.row-metrics .row-duration, .row-metrics .row-status { flex: 0 0 auto; }
/* Sized for the longest consumers: Timeline puts an event type here, not Network's "198 ms". */
.row-duration { flex: 0 0 74px; font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; color: var(--text-3); }
.row-status { flex: 0 0 62px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
@@ -853,6 +886,30 @@ body.detail-zoom .split-shell.collapse-detail { grid-template-columns: 1fr; }
.detail-head-status { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.detail-expand { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.detail-expand.active { border-color: var(--signal); background: var(--signal-soft); color: var(--signal); }
+
+/* Kebab (⋮) actions menu, sitting immediately right of .detail-expand — same 26px footprint, so
+ the head row's right edge reads as one pair of controls rather than two sizes. */
+.detail-menu-btn { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); }
+.detail-menu-btn:hover { color: var(--ink); border-color: var(--border-strong); }
+.detail-menu-btn.active { border-color: var(--signal); background: var(--signal-soft); color: var(--signal); }
+/* position: fixed, not absolute: .detail-pane-v2 is overflow: hidden, so an absolutely positioned
+ popup would be clipped at the pane's edge. Placed by positionDetailMenuPanel(), same contract
+ as the toolbar dropdowns' .drop-panel. */
+.detail-menu-panel {
+ position: fixed; z-index: 200; min-width: 200px; max-width: min(92vw, 320px);
+ display: grid; gap: 1px; padding: 4px;
+ background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--elev-3);
+}
+.detail-menu-item {
+ display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px;
+ border: none; border-radius: 6px; background: transparent; text-align: left; color: var(--muted); font-size: 12.5px;
+}
+.detail-menu-item .ic { flex: 0 0 auto; color: var(--text-3); }
+.detail-menu-item:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
+.detail-menu-item:hover:not(:disabled) .ic { color: inherit; }
+.detail-menu-item.on { color: var(--signal); background: var(--signal-soft); }
+.detail-menu-item.on .ic { color: var(--signal); }
+.detail-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.detail-fact { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; }
.detail-fact-k { font-size: 10.5px; font-weight: 600; color: var(--text-3); }
@@ -922,6 +979,10 @@ body.detail-zoom .split-shell.collapse-detail { grid-template-columns: 1fr; }
/* Find-highlight must win over both grid sizes' background overrides above — same (0,3,0)
specificity as `.kv-grid.kv-grid-lg .kv-v` but declared after it, so source order decides. */
.kv-grid .kv-k.hit, .kv-grid .kv-v.hit { background: var(--signal-soft); }
+/* Clickable kv value (Network summary's "mock rule: " → Mocks). A