mitmweb: add status/method badges to the flow table by sleeyax · Pull Request #8335 · mitmproxy/mitmproxy · GitHub
Skip to content

mitmweb: add status/method badges to the flow table - #8335

Merged
lups2000 merged 7 commits into
mitmproxy:mainfrom
sleeyax:feat/web-flowtable-badges
Aug 3, 2026
Merged

lups2000 merged 7 commits into
mitmproxy:mainfrom
sleeyax:feat/web-flowtable-badges

Conversation

@sleeyax

@sleeyax sleeyax commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Renders the flow table's status code as a colored badge (by response class) and the method as an outlined badge, replacing the inline-colored text.
The badges reuse the semantic state tokens added in #8316/#8317, so they follow the dark theme. The dark palette uses soft fills (tinted background, colored label) rather than solid ones, because a solid fill repeated on every row glares.

Also adds hover tooltips to the TLS / replay / intercept / error indicators, via a new optional title prop on Icon that renders an SVG <title> (and stops marking the icon aria-hidden, so it's no longer decorative). This is a small addition I had in my old branch, which could be expanded upon later.

Part of #7789. The badge styling is a precedent the tag badges in #8290 could reuse; this PR does not implement tagging.

Out of scope: swapping the sprite content-type icons to lucide (the sprites don't recolor in dark mode). I'll tackle that in a the next PR.

Screenshots

image image

Checklist

  • I have updated tests where applicable.
  • I have added an entry to the CHANGELOG.

sleeyax and others added 4 commits July 29, 2026 12:57
Replace the inline-colored status text with a colored status-code badge and render the request method as an outlined badge.
Both reuse the semantic state tokens, so they follow the dark theme automatically.
Add hover tooltips (via a new optional Icon `title` prop and a title on the TLS cell) to the TLS, replay, intercept, and error indicators.

Part of mitmproxy#7789.
Add a soft variant of the state palette (`--mitmweb-<state>-soft-bg`/`-fg`) and use it for the status badges and the footer option labels.
A saturated fill glares against a dark surface once it is repeated across every row, so the soft fill sinks towards the background and the label text carries the hue.
The solid tokens stay vivid for the header connection label and `.btn-info`, which appear one at a time and are meant to draw the eye.
Light values alias the existing solid colors, so the light theme is unchanged.
The status column renders a badge that reuses the semantic state tokens, so nothing consumes --mitmweb-status-1xx…5xx/-other any more.

@lups2000 lups2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :) Looks nice 🙌

Just a few nits:

Image

Maybe these could have the same height?

Not strictly related to this PR, but for the future: the column content is sometimes left-aligned and sometimes right-aligned. Maybe we should stick to one alignment, or possibly center it consistently. But this is more something to consider when we improve the FlowTable UI :)

Comment thread web/src/js/components/common/MethodBadge.tsx Outdated
Comment thread web/src/js/components/common/StatusBadge.tsx Outdated
sleeyax added 2 commits July 30, 2026 18:14
The two components differed only in styling, so a single presentational Badge in common/ now carries the shared class and callers pass the variant class.
statusClass moves to flow/utils next to statusCode, mirroring getIcon which likewise returns a CSS class.
The two badges sized themselves from their own font size, padding and border, so the outlined method badge came out about a pixel shorter than the filled status badge.
A fixed height on the shared base plus a transparent border makes the box identical regardless of the variant.
@sleeyax

sleeyax commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@sleeyax

sleeyax commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Maybe these could have the same height?

Should be fixed now.

Just wanted to confirm they have the same height now (18px)

image

@sleeyax
sleeyax requested a review from lups2000 July 31, 2026 12:09
@lups2000

lups2000 commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Maybe these could have the same height?

Should be fixed now.

Just wanted to confirm they have the same height now (18px)

image

Thank you :) Is the NOERROR badge cut off, or is it just the screenshot? I didn't even know we had this status 😅

@sleeyax

sleeyax commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Is the NOERROR badge cut off, or is it just the screenshot? I didn't even know we had this status 😅

Oh wow, I didn't even notice that. Yes, it's probably cut off because the column size for the "status" is too small (in width). Will fix that.

The NOERROR status is is he DNS RCODE 0, basically the DNS equivalent of HTTP 200. See RFC 1035.

The badge's padding and border pushed word-shaped DNS response codes such as NOERROR past the 60px cell, where the table's overflow rule clipped them.
@lups2000

lups2000 commented Aug 3, 2026

Copy link
Copy Markdown
Member

@lups2000
lups2000 merged commit 4c018bb into mitmproxy:main Aug 3, 2026
28 checks passed
@lups2000 lups2000 mentioned this pull request Aug 5, 2026
1 of 2 tasks
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.

2 participants