@hakam-aldeen-kh/blix 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,12 +3,13 @@
3
3
 
4
4
  An in-app dev-tools panel for React apps. Captures HTTP requests, Redux
5
5
  actions, TanStack Query cache events and realtime traffic, and renders them in
6
- a dockable panel with a waterfall, diffing, replay and HAR/cURL export.
6
+ a dockable panel with cross-source links, diffing, replay and HAR/cURL
7
+ export.
7
8
 
8
9
  The entire panel is eliminated from production builds — see
9
10
  [Production elimination](#production-elimination).
10
11
 
11
- Release notes are in [CHANGELOG.md](CHANGELOG.md).
12
+ Release notes are in [CHANGELOG.md](https://github.com/Hakam-aldeen-Kh/blix/blob/main/CHANGELOG.md).
12
13
 
13
14
  ---
14
15
 
@@ -173,8 +174,8 @@ instance.interceptors.response.use(undefined, (error) =>
173
174
 
174
175
  The consequence is silent and total: **every non-2xx request stays `pending`
175
176
  in the panel for the rest of the session.** No error, no warning, no Failed
176
- filter. (The 30-second pending cap only bounds the width of the waterfall bar;
177
- it does not resolve the entry.)
177
+ filter. (The 30-second pending cap only bounds how far the row's duration bar
178
+ grows; it does not resolve the entry.)
178
179
 
179
180
  Two ways out, and you currently have to choose one:
180
181
 
@@ -385,7 +386,7 @@ both. There is no wrong choice here and no silent failure.
385
386
 
386
387
  What *does* matter is which one your app calls through. Only the proxy's traps
387
388
  record a stack, so every request made against the unwrapped instance is still
388
- captured but arrives with an empty Initiator column. Export the wrapped one and
389
+ captured but arrives with no initiator. Export the wrapped one and
389
390
  keep the original private:
390
391
 
391
392
  ```ts
@@ -401,7 +402,7 @@ The traps cover the callable form (`apiClient(config)`) plus `request`, `get`,
401
402
  the `*Form` helpers — pass through unwrapped: still captured, just with no
402
403
  initiator stack.
403
404
 
404
- > **Known limitation.** The Initiator column is produced by filtering your own
405
+ > **Known limitation.** The initiator stack is produced by filtering your own
405
406
  > HTTP wrapper's frames out of the captured stack, and that filter currently
406
407
  > matches a fixed set of module paths rather than deriving them from where
407
408
  > `withInitiatorCapture` was called. If your axios module does not sit at one
@@ -601,6 +602,39 @@ structural typing means you just pass your store and client.)
601
602
  Passing neither still gives you a fully working capture log; you only lose the
602
603
  two features that need a live handle on the app.
603
604
 
605
+ ### Finding your way around
606
+
607
+ The panel is one header, one rail and two panes.
608
+
609
+ **The rail on the left is the four sources** — Network, Realtime, Redux,
610
+ Query. They are not filters over one table: each has its own columns and its
611
+ own notion of a row, so switching source switches the whole view. `1`–`4` jump
612
+ between them, and each keeps its own selection, so stepping to Redux and back
613
+ returns you to the request you were reading. Below the sources it carries the
614
+ session totals, and it collapses to icons — click the chevron, or let a narrow
615
+ dock do it for you.
616
+
617
+ **The header is the session**, not the entry: whether capture is running, what
618
+ is being filtered out, and where the panel lives. Filter tokens you have
619
+ already applied become chips *inside* the filter field, each removable on its
620
+ own, so `method:post status:5xx` is two things you can undo separately rather
621
+ than one string to re-edit. `.*` widens the search to request and response
622
+ bodies.
623
+
624
+ **`Ctrl/⌘ K` opens the command palette**, and for several things it is the only
625
+ way in — sort order, row density, dock position, the copy formats, the filter
626
+ syntax. The header spends its width on what you read constantly; everything you
627
+ reach for occasionally lives one keystroke away instead of costing a button
628
+ each. Every row shows its key binding where it has one, so the palette teaches
629
+ its own shortcuts. `?` still opens the full cheatsheet.
630
+
631
+ **Linked events tie the sources together.** When Blix can see that a query
632
+ caused a request, that a request came from a query, or that one entry is a
633
+ replay of another, the row grows a coloured tick and the foot of the detail
634
+ pane grows a chip you can click to step straight to the other side. The
635
+ relation is observed, never inferred: no tick means *not known*, not
636
+ *unrelated*.
637
+
604
638
  ### Viewing payloads
605
639
 
606
640
  Every payload pane has a format switch. The choice is remembered, so you pick
@@ -634,7 +668,7 @@ literal rather than a pre-serialized string.
634
668
 
635
669
  ### Exporting the log
636
670
 
637
- The toolbar's neighbour, the download button, offers six formats and a scope
671
+ The **Export** button in the header offers six formats and a scope
638
672
  toggle — **Shown** (what the current section and filters leave visible) or
639
673
  **All**. It defaults to Shown, with both counts on the control, so an export
640
674
  says what it will contain before you pick a format.
@@ -653,7 +687,8 @@ placeholder rather than a working token — use **Replay** for a real re-run.
653
687
 
654
688
  ### Themes
655
689
 
656
- Twelve themes, under the button in the toolbar:
690
+ Twelve themes, under the theme button in the header — it names the one
691
+ currently applied:
657
692
 
658
693
  | | Theme | |
659
694
  | --- | --- | --- |
@@ -682,7 +717,7 @@ panel's other preferences and survives a reload.
682
717
  The panel never inherits your app's styling — it portals outside every stacking
683
718
  context and ships its own palettes, so nothing you do to your own theme can
684
719
  distort it. Themes are complete rather than partial: every colour the panel
685
- paints, down to the JSON syntax highlighting and the waterfall bars, comes from
720
+ paints, down to the JSON syntax highlighting and the duration bars, comes from
686
721
  the active theme. Each palette is checked against WCAG contrast targets — 4.5:1
687
722
  for anything read as text, 3:1 for badges and quiet chrome — which is why a few
688
723
  of the ported palettes differ by a shade from the originals in the slots used
@@ -825,13 +860,16 @@ the database is opened only when the panel mounts — see
825
860
  while it is off nothing Blix captures reaches IndexedDB — the store is
826
861
  actively cleared on every panel mount.
827
862
 
828
- Three ways to toggle it:
863
+ Four ways to toggle it:
829
864
 
830
865
  | Where | Note |
831
866
  | --- | --- |
832
- | Toolbar button | Hidden in the compact layout |
833
- | **⋯ More actions** overflow menu | Always available |
834
- | `Shift+L` | Always available |
867
+ | Header button | Keeps its icon at every width; loses its label when the panel is narrow |
868
+ | **⋯ More actions** overflow menu | |
869
+ | Command palette (`Ctrl/⌘ K`) | Listed as **Preserve log across reloads** / **Stop preserving the log** |
870
+ | `Shift+L` | — |
871
+
872
+ All four require the panel to be mounted.
835
873
 
836
874
  **Turning it on is retroactive.** The toggle does not mean "from now on".
837
875
  Switching it on writes every entry already sitting in the live buffer — the
@@ -872,7 +910,9 @@ that is not one of the four above, it is captured verbatim.
872
910
 
873
911
  Masking is partial rather than total: for a value longer than 12 characters
874
912
  the first 8 and last 4 survive, so you can still tell which token you sent.
875
- Shorter values are replaced outright.
913
+ Shorter values are replaced outright. The Headers tab tags every masked row
914
+ `MASKED` rather than leaving you to infer it from an ellipsis, and the stored
915
+ value keeps a `(masked)` suffix so every export path carries the fact too.
876
916
 
877
917
  **Nothing inside a body is redacted.** Request bodies, response bodies, error
878
918
  payloads, the encrypted request/response values, Redux payloads and diffs, and
@@ -887,7 +927,7 @@ for your payloads and no way to tell a secret from any other string.
887
927
  | Bound | Value |
888
928
  | --- | --- |
889
929
  | Records | 200 |
890
- | Total size | 24 MB |
930
+ | Total size | 24 MB — HTTP entries only |
891
931
  | Per payload field | 512 KB |
892
932
  | Eviction | oldest first, once either bound is exceeded |
893
933
  | Time-based expiry | none |
@@ -897,26 +937,27 @@ records or 24 MB of newer traffic push it out, or when you clear it yourself.
897
937
  On a low-traffic app with preserve-log left on, a captured token stays in the
898
938
  browser profile indefinitely.
899
939
 
900
- > **Realtime frames are an exception to the size bound.** They are stored
901
- > without truncation and are under-counted against the byte budget — a record
902
- > is charged a flat allowance regardless of how many frames it carries, and a
903
- > connection can hold hundreds. A long-lived realtime session can therefore
904
- > occupy considerably more on disk than the 24 MB figure implies, and eviction
905
- > will not reclaim it. The record and size caps hold for HTTP entries.
906
- > Tracked in [#N](https://github.com/Hakam-aldeen-Kh/blix/issues/N).
940
+ Three ways to purge:
941
+
942
+ | Where | Note |
943
+ | --- | --- |
944
+ | The persisted-size label in the status bar — the one reading `12 saved · 3.4 MB` | The label *is* the control, and it is the only one that asks twice: click once to arm it, at which point it changes to `Purge saved log?`, and click again. It disarms itself after three seconds. Rendered only while preserve-log is on |
945
+ | **⋯ More actions** **Purge saved log** | Deletes on a single press, with no confirmation |
946
+ | Command palette (`Ctrl/⌘ K`) → **Purge the saved log** | Deletes on a single press, with no confirmation |
907
947
 
908
- To purge, use the persisted-size label in the status bar the one reading
909
- `12 saved · 3.4 MB`. It is the control: click once to arm it, at which point
910
- it changes to `Purge saved log?`, and click again to delete the database.
948
+ The menu and palette entries are disabled when nothing is on disk, but unlike
949
+ the status-bar label they do not depend on preserve-log being on so a log
950
+ written earlier in the session can still be deleted after you have switched
951
+ the toggle off.
911
952
 
912
953
  Switching preserve-log **off** also clears the stored entries, so turning it
913
- off is itself a way to drop everything Blix has written. What survives is the
914
- database and your panel preferences, not the captured bodies.
954
+ off is itself a way to drop everything Blix has written.
915
955
 
916
- **The purge control is only rendered while preserve-log is on**, so once you
917
- have switched it off there is nothing left in the UI to press and there is
918
- no programmatic API for it either. Use Purge when you want the database gone
919
- outright; switch off when clearing the entries is enough.
956
+ Every path clears the captured entries; Purge additionally deletes the
957
+ IndexedDB database itself. **Your panel preferences survive either way**
958
+ they are mirrored to `localStorage`, and a fresh database is re-seeded from
959
+ that mirror on the next boot. There is no UI or API for clearing them, and no
960
+ programmatic API for purging either.
920
961
 
921
962
  ### Threat model
922
963
 
@@ -931,7 +972,7 @@ Export and copy move captured data out of the browser entirely:
931
972
  | --- | --- |
932
973
  | HAR export | Decrypted request and response bodies |
933
974
  | JSON / NDJSON export | Everything captured — frames, Redux diffs, timings |
934
- | **Copy as cURL** / **Copy as fetch** | Headers and bodies, with `Authorization` masked — so the output is not a working request |
975
+ | **Copy as cURL** / **Copy as fetch** | Headers and bodies, with the four redacted headers masked — so the output is not a working request |
935
976
 
936
977
  HAR is the one to watch. It is a plain JSON file carrying your decrypted
937
978
  bodies, and it is the artifact most likely to end up attached to a ticket.
@@ -941,8 +982,9 @@ bodies, and it is the artifact most likely to end up attached to a ticket.
941
982
  - **Leave preserve-log off unless you actively need it.** It is off by
942
983
  default. In-memory capture already gives you the entire panel; the toggle
943
984
  buys you nothing but survival across a reload.
944
- - **Purge after any session that captured an auth flow** — and purge *before*
945
- you switch preserve-log back off, or the control disappears on you.
985
+ - **Clear the log after any session that captured an auth flow** —
986
+ switching preserve-log off is enough; Purge additionally deletes the
987
+ database, though neither removes your panel preferences.
946
988
  - **Use the Redux `ignore` option** for action types that carry credentials or
947
989
  personal data, so they are never captured in the first place. See
948
990
  [Redux](#redux--createreduxmonitormiddlewareoptions).
@@ -973,4 +1015,4 @@ The `/capture` entry exports `attachHttpMonitor`, `captureEncrypted`,
973
1015
 
974
1016
  ## License
975
1017
 
976
- MIT — see [LICENSE](./LICENSE).
1018
+ MIT — see [LICENSE](https://github.com/Hakam-aldeen-Kh/blix/blob/main/LICENSE).