You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2026/09/03 10:44:32 UTC

(plc4x-extras) 05/05: feat: Make colour carry meaning in both tool interfaces

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x-extras.git

commit 74dfaa78118923243e03ba4bd6a76b57b286fea7
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Sep 3 12:30:01 2026 +0200

    feat: Make colour carry meaning in both tool interfaces
    
    The interfaces used a handful of colours for decoration. They now use
    colour to answer a question at a glance, and the screen is framed by a
    raised band at the top and foot rather than ending in an empty gutter.
    
    Values are coloured by data-type family -- numbers, flags, text and times
    -- via Theme.DataType, which matches IEC 61131-3 names by suffix. A type
    it does not recognise stays muted, so it reads as uncategorised rather
    than as miscategorised. Theme.LogLevel does the same for log levels.
    Outcomes are green or red in the message list as well as in Detail, so a
    failed request is findable in a full pane without reading it.
    
    Four fixes behind that, each of which a plain-theme test cannot see:
    
    A terminal cannot nest a background. An inner style's reset ends the
    outer background mid-row, so a banded row has to be assembled from
    styles that each carry the band themselves -- hence Theme.OnSurface and
    Theme.Surfaced -- and every space in such a row has to live inside a
    styled run. A bare space beside one showed the terminal's background
    through the band and striped the bar.
    
    bubbles/table styles each cell and then styles the selected row around
    them, so the foreground on the cell style ended with a reset that wiped
    the selection from every cell after the first: the selected message row
    was indistinguishable from its neighbours. The cell style is now bare.
    
    The command bar's band stopped one cell short of the right edge, because
    the prompt was sized two cells narrower than the screen while only one
    was spent on its gutter.
    
    The prompt's field emitted a hardcoded white for its unset prompt style
    and for its cursor -- colour reaching a terminal that asked for none.
    
    Also: LDATE, LTOD, LDT and LDATE_AND_TIME fell through to uncategorised,
    because the temporal match listed spellings rather than dropping the L.
    The log drawer grew from a sixth of the screen to a quarter, the sidebar
    no longer repeats the tag catalogue that Detail is already showing, and
    a duration renders at a precision worth reading rather than as 62.25µs.
    
    internal/tuitest holds the escape-sequence assertions both tools need,
    so there is one answer to what the terminal paints rather than two that
    can drift. Every new assertion was checked against a mutation of the
    code it covers.
---
 plc4go/tools/QUICKSTART.md                         |   7 +-
 plc4go/tools/README.md                             |  38 +++
 plc4go/tools/internal/tui/layout.go                |   8 +-
 plc4go/tools/internal/tui/prompt.go                |  47 +++-
 plc4go/tools/internal/tui/theme.go                 | 165 ++++++++++++
 plc4go/tools/internal/tui/theme_test.go            | 188 ++++++++++++++
 plc4go/tools/internal/tuitest/painted.go           | 128 ++++++++++
 .../tools/plc4xbrowser/browser/appearance_test.go  | 282 +++++++++++++++++++++
 plc4go/tools/plc4xbrowser/browser/keys_test.go     |  12 +-
 plc4go/tools/plc4xbrowser/browser/model.go         |  75 +++++-
 plc4go/tools/plc4xbrowser/browser/model_test.go    |   8 +-
 plc4go/tools/plc4xbrowser/browser/view.go          | 102 ++++++--
 .../tools/plc4xpcapanalyzer/ui/appearance_test.go  |  95 +++++++
 plc4go/tools/plc4xpcapanalyzer/ui/helpers_test.go  |   9 +-
 plc4go/tools/plc4xpcapanalyzer/ui/view.go          |  40 ++-
 15 files changed, 1149 insertions(+), 55 deletions(-)

diff --git a/plc4go/tools/QUICKSTART.md b/plc4go/tools/QUICKSTART.md
index af402339..1b188f36 100644
--- a/plc4go/tools/QUICKSTART.md
+++ b/plc4go/tools/QUICKSTART.md
@@ -35,6 +35,10 @@ go run ./tools/plc4xpcapanalyzer ui --demo
 Opens already connected to `demo://plant-1`, with a `DEMO` badge in the status bar so
 simulated values can never be mistaken for readings from real hardware.
 
+Values are coloured by data type: numbers cyan, flags amber, text lime, times violet, and a
+type the tool does not recognise stays muted rather than being given a colour that would imply
+it had been categorised. `OK` is green and a failure red, wherever either appears.
+
 ### 1. See what the device exposes
 
 ```
@@ -211,7 +215,8 @@ without giving up the prompt.
 | `--ascii` | force ASCII drawing characters instead of Unicode |
 | `--log-level` | `trace`, `debug`, `info`, `warn`, `error` |
 
-`NO_COLOR=1` in the environment strips colour from both tools. The glyph set is otherwise
+`NO_COLOR=1` in the environment strips colour from both tools -- including the shading behind
+the top and bottom bars, which would otherwise print as solid blocks. The glyph set is otherwise
 chosen from the locale, so a terminal without a UTF-8 locale gets the ASCII set automatically.
 
 ## What demo mode cannot show
diff --git a/plc4go/tools/README.md b/plc4go/tools/README.md
index b5a8c3a0..2324f7ab 100644
--- a/plc4go/tools/README.md
+++ b/plc4go/tools/README.md
@@ -128,6 +128,35 @@ modbus-rtu:///dev/ttyUSB0
 firmata:///dev/ttyACM0
 ```
 
+### Reading the screen
+
+Colour carries meaning rather than decoration, so a glance answers a question without reading:
+
+| What | How it reads |
+| --- | --- |
+| A value's data type | by family -- numbers cyan, flags amber, text lime, times violet |
+| An unknown data type | muted, so it is visibly *uncategorised* rather than miscategorised |
+| An outcome | `OK` green, a failure red, in the message list and in Detail alike |
+| A log line | its level marker coloured: `ERR` red, `WRN` amber, `INF` accent, trace and debug muted |
+| A count worth glancing at | the number in the accent, its label muted; a failure count red |
+| The top and bottom bars | a raised band, framing the panes between them |
+
+Two implementation notes, because both have already caused bugs:
+
+A terminal cannot nest a background. An inner style's reset ends the outer background
+mid-row, so a banded row is assembled from styles that each carry the band themselves --
+`Theme.OnSurface` and `Theme.Surfaced` exist for that, and every space in such a row lives
+*inside* a styled run rather than beside one. A bare space between two styled pieces shows the
+terminal's own background through the band and stripes the bar.
+
+For the same reason `bubbles/table` gets a bare cell style. It styles each cell and then styles
+the selected row around them, so any foreground on the cell style ends with a reset that wipes
+the selection from every cell after the first, leaving the selected row indistinguishable.
+
+`NO_COLOR=1` strips all of it. Bold and reverse video stay: they are how a title and a cursor
+still read without colour, and a background is the one thing that cannot degrade gracefully,
+because it prints as a solid block.
+
 ### Wire bytes
 
 With a real connection, the browser records the bytes crossing the transport, and the Detail
@@ -147,6 +176,7 @@ Demo mode records nothing, because a simulated device puts nothing on a wire.
 tools/
   internal/
     tui/          theme, glyph sets, responsive layout, pane chrome, keymap, prompt
+    tuitest/      assertions about rendered output that both tools share
     plcsession/   the seam between a UI and a PLC: Session, Live, Demo, frame capture
     progress/     progress reporting, for a plain CLI and for a Bubble Tea UI alike
   plc4xbrowser/
@@ -191,6 +221,14 @@ go test -race ./tools/...
 go tool -modfile=tools.mod gotestsum -- ./...
 ```
 
+Most view tests render with a colourless ASCII theme, so an assertion on the content is an
+assertion on the content and a width is a count of characters. The `appearance_test.go` files
+are the deliberate exception: the coloured themes are what a user actually sees, and a band that
+stops a cell short of the edge, a style whose reset punches a hole in one, a selection that
+vanishes after the first cell, and a background reaching a `NO_COLOR` terminal are all
+invisible in plain text. `internal/tuitest` holds the escape-sequence assertions both tools
+need, so there is one answer to what the terminal paints rather than two that can drift.
+
 Tests are deterministic: no sleeps as synchronisation, no network, no real terminal, and
 injected clocks wherever time is observable. The terminal interfaces are driven by sending
 typed messages to `Update` and asserting on the rendered output, which needs no terminal;
diff --git a/plc4go/tools/internal/tui/layout.go b/plc4go/tools/internal/tui/layout.go
index 6c4d3f24..4a899866 100644
--- a/plc4go/tools/internal/tui/layout.go
+++ b/plc4go/tools/internal/tui/layout.go
@@ -165,11 +165,17 @@ func Compute(size Size) Layout {
 }
 
 // logHeightFor sizes the log drawer as a fraction of the terminal, within sane bounds.
+//
+// The cap used to be eight rows at any height, which on a tall terminal was the wrong way
+// round: the panes were handed thirty-eight rows they could not fill while the log -- the one
+// region whose content actually grows -- stayed at eight and scrolled. A quarter of the screen
+// up to sixteen rows keeps a short terminal's panes intact while letting a tall one put its
+// spare rows where there is something to read.
 func logHeightFor(layout Layout) int {
 	if !layout.ShowLog {
 		return 0
 	}
-	return clamp(layout.Size.Height/6, 3, 8)
+	return clamp(layout.Size.Height/4, 4, 16)
 }
 
 // TooSmallMessage is what to render when the terminal cannot be drawn in. It states the
diff --git a/plc4go/tools/internal/tui/prompt.go b/plc4go/tools/internal/tui/prompt.go
index a2153217..db9ba6a9 100644
--- a/plc4go/tools/internal/tui/prompt.go
+++ b/plc4go/tools/internal/tui/prompt.go
@@ -131,13 +131,29 @@ func NewPrompt(theme Theme, suggest SuggestFunc) Prompt {
 	// field that is usually focused reads as a value the user did not type.
 	input.Placeholder = ""
 
+	// Every field style carries the band's background, because the row is a raised surface and
+	// a terminal has no way to nest one: whatever the field renders would otherwise punch a
+	// hole in the band the moment its own styling reset.
 	styles := input.Styles()
-	styles.Focused.Text = theme.Value
-	styles.Focused.Suggestion = theme.Muted
-	styles.Blurred.Text = theme.Muted
-	styles.Blurred.Suggestion = theme.Muted
-	styles.Focused.Placeholder = theme.Muted
-	styles.Blurred.Placeholder = theme.Muted
+	styles.Focused.Text = theme.OnSurface(theme.Value)
+	styles.Focused.Suggestion = theme.OnSurface(theme.Muted)
+	styles.Blurred.Text = theme.OnSurface(theme.Muted)
+	styles.Blurred.Suggestion = theme.OnSurface(theme.Muted)
+	styles.Focused.Placeholder = theme.OnSurface(theme.Muted)
+	styles.Blurred.Placeholder = theme.OnSurface(theme.Muted)
+	// The label is rendered by View, so the field's own prompt is empty -- but an unset style
+	// still emits its default, a hardcoded white, and that is a colour reaching a terminal
+	// that asked for none.
+	styles.Focused.Prompt = theme.OnSurface(theme.Muted)
+	styles.Blurred.Prompt = theme.OnSurface(theme.Muted)
+	// The cursor's own colour, too. Left at the bubbles default it is a hardcoded white, which
+	// is a colour reaching a terminal that asked for none, and which on the band reads as a
+	// stray cell rather than as a cursor.
+	if theme.IsNoColor() {
+		styles.Cursor.Color = nil
+	} else {
+		styles.Cursor.Color = theme.CursorColor()
+	}
 	input.SetStyles(styles)
 
 	prompt := Prompt{
@@ -499,19 +515,30 @@ func (p Prompt) View() string {
 		return ""
 	}
 
-	label := p.theme.Key.Render(p.Label)
+	// The marker is drawn in the accent rather than muted: it is the one place on the screen
+	// that takes typing, so it should read as active chrome and not as a label.
+	label := p.theme.OnSurface(p.theme.Accent.Bold(true)).Render(p.Label)
 	status := ""
 	if text := p.statusText(); text != "" {
-		status = " " + p.theme.Accent.Render(text)
+		status = p.theme.OnSurface(p.theme.Accent).Render(" " + text)
 	}
 
 	// The field gets whatever is left. fitLine then forces the assembled row to the exact
 	// width, so a long line scrolls inside the field instead of pushing the status off the
 	// end of the terminal.
 	fieldRoom := max(p.width-lipgloss.Width(label)-lipgloss.Width(status), 1)
-	field := fitLine(p.input.View(), fieldRoom)
+	field := p.padOnSurface(p.input.View(), fieldRoom)
+
+	return p.padOnSurface(label+field+status, p.width)
+}
 
-	return fitLine(label+field+status, p.width)
+// padOnSurface is fitLine with the band's background on the padding, so the raised row runs
+// the full width instead of stopping where the text does.
+func (p Prompt) padOnSurface(line string, width int) string {
+	if actual := lipgloss.Width(line); actual < width {
+		return line + p.theme.Surface.Render(strings.Repeat(" ", width-actual))
+	}
+	return fitLine(line, width)
 }
 
 // CompletionView renders the completion list, at most maxRows entries, or the empty string
diff --git a/plc4go/tools/internal/tui/theme.go b/plc4go/tools/internal/tui/theme.go
index 27b4376a..47171349 100644
--- a/plc4go/tools/internal/tui/theme.go
+++ b/plc4go/tools/internal/tui/theme.go
@@ -29,6 +29,7 @@ package tui
 import (
 	"image/color"
 	"os"
+	"strings"
 
 	"charm.land/lipgloss/v2"
 )
@@ -95,10 +96,27 @@ type Theme struct {
 	// SelectedRow highlights the current row of a list or table.
 	SelectedRow lipgloss.Style
 
+	// Surface is the raised background of the command bar, and OnSurface puts other styles
+	// onto it. A terminal cannot nest a background: an inner style's reset ends the outer
+	// background mid-row, so a banded row has to be assembled from styles that each carry
+	// the background themselves rather than wrapped in one that has it.
+	Surface lipgloss.Style
+
+	// The data-type families. A tag's type is looked up with DataType rather than picked here,
+	// so a call site never has to know which family a type name belongs to.
+	Numeric  lipgloss.Style
+	Boolean  lipgloss.Style
+	Text     lipgloss.Style
+	Temporal lipgloss.Style
+
 	// dark records which variant produced this theme, for tests and for re-resolving.
 	dark bool
 	// noColor records whether colour was stripped.
 	noColor bool
+	// surface is the band's background colour, kept so OnSurface can graft it onto any style.
+	surface color.Color
+	// accent is the accent colour itself, for the few places that need a colour and not a style.
+	accent color.Color
 }
 
 // IsDark reports which background variant this theme was built for.
@@ -117,6 +135,17 @@ var (
 	paletteMuted  = pair{light: "#5C5C66", dark: "#9CA3AF"}
 	paletteText   = pair{light: "#1F2933", dark: "#E5E7EB"}
 	paletteChrome = pair{light: "#9AA0AA", dark: "#4B5563"}
+	// Raised just enough to read as a distinct band against either background, and no more:
+	// the command bar should look like a surface, not like a selection.
+	paletteSurface = pair{light: "#E4E4E9", dark: "#26262F"}
+
+	// Data-type hues. A tag list is read by shape as much as by name -- "which of these are
+	// numbers" is a faster question to answer by colour than by reading each type -- so the
+	// families get their own hues rather than all sharing the muted grey.
+	paletteNumeric  = pair{light: "#0E7490", dark: "#22D3EE"}
+	paletteBoolean  = pair{light: "#B45309", dark: "#F59E0B"}
+	paletteTypeText = pair{light: "#3F6212", dark: "#A3E635"}
+	paletteTemporal = pair{light: "#6D28D9", dark: "#C4B5FD"}
 )
 
 // pair is a light/dark colour pair.
@@ -177,6 +206,11 @@ func NewTheme(options Options) Theme {
 		theme.PaneFocused = theme.PaneFocused.BorderForeground(pick(paletteAccent))
 	}
 
+	theme.Numeric = foreground(paletteNumeric)
+	theme.Boolean = foreground(paletteBoolean)
+	theme.Text = foreground(paletteTypeText)
+	theme.Temporal = foreground(paletteTemporal)
+
 	theme.Chrome = foreground(paletteChrome)
 	theme.ChromeFocused = foreground(paletteAccent)
 
@@ -191,9 +225,140 @@ func NewTheme(options Options) Theme {
 		theme.SelectedRow = lipgloss.NewStyle().Foreground(pick(paletteAccent)).Bold(true)
 	}
 
+	// With colour off there is no band, so Surface is bare and OnSurface is the identity.
+	if !options.NoColor {
+		theme.accent = pick(paletteAccent)
+		theme.surface = pick(paletteSurface)
+		theme.Surface = lipgloss.NewStyle().Background(theme.surface)
+	}
+
 	return theme
 }
 
+// CursorColor is the colour of the text cursor, or nil when colour is off. It is the accent,
+// because the cursor marks the one place on the screen that takes typing.
+func (t Theme) CursorColor() color.Color {
+	if t.noColor {
+		return nil
+	}
+	return t.accent
+}
+
+// OnSurface returns style as it should be drawn on the command bar: the same foreground, with
+// the band's background. It is the identity when colour is off.
+func (t Theme) OnSurface(style lipgloss.Style) lipgloss.Style {
+	if t.noColor || t.surface == nil {
+		return style
+	}
+	return style.Background(t.surface)
+}
+
+// Surfaced returns the theme as it should be drawn on a band: every foreground-only style
+// carries the band's background, so a whole row can be assembled without any segment punching
+// a hole in it. Badge is left alone, because it sets a background of its own and reads as a
+// badge precisely by contrasting with whatever it sits on.
+func (t Theme) Surfaced() Theme {
+	if t.noColor || t.surface == nil {
+		return t
+	}
+	on := func(style lipgloss.Style) lipgloss.Style { return style.Background(t.surface) }
+	surfaced := t
+	surfaced.Title = on(t.Title)
+	surfaced.Muted = on(t.Muted)
+	surfaced.Key = on(t.Key)
+	surfaced.Value = on(t.Value)
+	surfaced.Accent = on(t.Accent)
+	surfaced.Ok = on(t.Ok)
+	surfaced.Warn = on(t.Warn)
+	surfaced.Err = on(t.Err)
+	surfaced.Chrome = on(t.Chrome)
+	surfaced.Numeric = on(t.Numeric)
+	surfaced.Boolean = on(t.Boolean)
+	surfaced.Text = on(t.Text)
+	surfaced.Temporal = on(t.Temporal)
+	return surfaced
+}
+
+// DataType returns the style for a PLC data type, by family.
+//
+// The families are what a reader actually distinguishes: numbers, flags, text and times. An
+// unknown type falls back to Muted rather than to an arbitrary hue, so a type this does not
+// know about is visibly uncategorised instead of miscategorised.
+func (t Theme) DataType(dataType string) lipgloss.Style {
+	switch normaliseDataType(dataType) {
+	case dataNumeric:
+		return t.Numeric
+	case dataBoolean:
+		return t.Boolean
+	case dataText:
+		return t.Text
+	case dataTemporal:
+		return t.Temporal
+	default:
+		return t.Muted
+	}
+}
+
+// dataFamily groups the PLC data types by how they are read.
+type dataFamily int
+
+const (
+	dataUnknown dataFamily = iota
+	dataNumeric
+	dataBoolean
+	dataText
+	dataTemporal
+)
+
+// normaliseDataType maps a plc4x type name onto its family.
+//
+// The names come from IEC 61131-3, so they are a closed and well-known set; matching on the
+// suffix rather than an exhaustive list keeps the sized variants (LREAL, ULINT, WSTRING) in the
+// right family without listing every one.
+func normaliseDataType(dataType string) dataFamily {
+	name := strings.ToUpper(strings.TrimSpace(dataType))
+	switch {
+	case name == "":
+		return dataUnknown
+	case name == "BOOL" || name == "BIT":
+		return dataBoolean
+	case strings.HasSuffix(name, "STRING") || name == "CHAR" || name == "WCHAR":
+		return dataText
+	// IEC 61131-3 spells every long temporal type as the base name with an L in front --
+	// LTIME, LDATE, LTOD, LDT, LDATE_AND_TIME -- so the L is dropped before matching rather
+	// than each spelling being listed. That is safe here only because this branch runs before
+	// the numeric one: LINT, LREAL and LWORD all reduce to names no temporal prefix matches.
+	case isTemporalName(strings.TrimPrefix(name, "L")):
+		return dataTemporal
+	case strings.HasSuffix(name, "REAL") || strings.HasSuffix(name, "INT") ||
+		strings.HasSuffix(name, "WORD") || name == "BYTE":
+		return dataNumeric
+	default:
+		return dataUnknown
+	}
+}
+
+// isTemporalName reports whether an L-stripped type name is a time or a date.
+func isTemporalName(name string) bool {
+	return strings.HasPrefix(name, "TIME") || strings.HasPrefix(name, "DATE") ||
+		strings.HasPrefix(name, "TOD") || name == "DT"
+}
+
+// LogLevel returns the style for a log level, so a wall of log lines has shape.
+func (t Theme) LogLevel(level string) lipgloss.Style {
+	switch strings.ToLower(strings.TrimSpace(level)) {
+	case "error", "err", "fatal", "panic":
+		return t.Err
+	case "warn", "warning":
+		return t.Warn
+	case "info":
+		return t.Accent
+	default:
+		// trace and debug are the noise you turned the level up to see; they stay quiet.
+		return t.Muted
+	}
+}
+
 // PaneStyle returns the chrome for a pane, focused or not.
 func (t Theme) PaneStyle(focused bool) lipgloss.Style {
 	if focused {
diff --git a/plc4go/tools/internal/tui/theme_test.go b/plc4go/tools/internal/tui/theme_test.go
new file mode 100644
index 00000000..7297e855
--- /dev/null
+++ b/plc4go/tools/internal/tui/theme_test.go
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package tui
+
+import (
+	"regexp"
+	"strings"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+)
+
+// TestDataTypeGroupsByFamily pins the mapping from IEC 61131-3 type names onto the four
+// families a reader actually distinguishes. The names are matched by suffix, so the sized and
+// unsized spellings of one type have to land together.
+func TestDataTypeGroupsByFamily(t *testing.T) {
+	theme := NewTheme(Options{Dark: true})
+
+	families := map[string][]string{
+		"numeric":  {"INT", "UINT", "SINT", "USINT", "DINT", "UDINT", "LINT", "ULINT", "REAL", "LREAL", "BYTE", "WORD", "DWORD", "LWORD"},
+		"boolean":  {"BOOL", "BIT"},
+		"text":     {"STRING", "WSTRING", "CHAR", "WCHAR"},
+		"temporal": {"TIME", "LTIME", "DATE", "LDATE", "TIME_OF_DAY", "TOD", "LTOD", "DATE_AND_TIME", "LDATE_AND_TIME", "DT", "LDT"},
+	}
+	want := map[string]string{
+		"numeric":  theme.Numeric.Render("x"),
+		"boolean":  theme.Boolean.Render("x"),
+		"text":     theme.Text.Render("x"),
+		"temporal": theme.Temporal.Render("x"),
+	}
+
+	// The four families have to be visually distinct, or grouping by them buys nothing.
+	seen := map[string]string{}
+	for family, rendered := range want {
+		if other, clash := seen[rendered]; clash {
+			t.Fatalf("families %q and %q render identically", family, other)
+		}
+		seen[rendered] = family
+	}
+
+	for family, types := range families {
+		for _, dataType := range types {
+			assert.Equal(t, want[family], theme.DataType(dataType).Render("x"),
+				"%s should be %s", dataType, family)
+			// Case is not part of the contract: a driver may report either.
+			assert.Equal(t, want[family], theme.DataType(strings.ToLower(dataType)).Render("x"),
+				"%s should be %s in lower case too", dataType, family)
+		}
+	}
+}
+
+// TestDataTypeLeavesUnknownTypesUncategorised is the deliberate choice not to guess: a type
+// this does not know about must read as uncategorised rather than as a wrong family.
+func TestDataTypeLeavesUnknownTypesUncategorised(t *testing.T) {
+	theme := NewTheme(Options{Dark: true})
+	for _, dataType := range []string{"", "STRUCT", "ARRAY", "RAW_BYTES", "unknown"} {
+		assert.Equal(t, theme.Muted.Render("x"), theme.DataType(dataType).Render("x"), dataType)
+	}
+}
+
+// TestLogLevelDistinguishesTheLevelsThatMatter checks that a warning and an error are each
+// visually separable from an ordinary line -- the only reason to colour a log at all.
+func TestLogLevelDistinguishesTheLevelsThatMatter(t *testing.T) {
+	theme := NewTheme(Options{Dark: true})
+
+	info := theme.LogLevel("info").Render("x")
+	warn := theme.LogLevel("warn").Render("x")
+	err := theme.LogLevel("error").Render("x")
+
+	assert.NotEqual(t, info, warn)
+	assert.NotEqual(t, info, err)
+	assert.NotEqual(t, warn, err)
+
+	// trace and debug are the noise you turned the level up to see: they are quieter than an
+	// info line, not louder, and an unknown level is treated as noise rather than as an alarm.
+	quiet := theme.Muted.Render("x")
+	for _, level := range []string{"", "trace", "debug", "nonsense"} {
+		assert.Equal(t, quiet, theme.LogLevel(level).Render("x"), level)
+		assert.NotEqual(t, warn, theme.LogLevel(level).Render("x"), level)
+		assert.NotEqual(t, err, theme.LogLevel(level).Render("x"), level)
+	}
+	assert.NotEqual(t, quiet, info, "an info line should read as more than noise")
+
+	// Spelling and case vary between loggers; the aliases must land on the same style.
+	assert.Equal(t, err, theme.LogLevel("ERROR").Render("x"))
+	assert.Equal(t, err, theme.LogLevel("fatal").Render("x"))
+	assert.Equal(t, err, theme.LogLevel(" panic ").Render("x"))
+	assert.Equal(t, warn, theme.LogLevel("warning").Render("x"))
+	assert.Equal(t, warn, theme.LogLevel("WARN").Render("x"))
+}
+
+// TestNoColorThemeHasNoBandAtAll matters because the band is a background, and a background is
+// exactly what a NO_COLOR terminal must not receive: it would print as solid blocks.
+func TestNoColorThemeHasNoBandAtAll(t *testing.T) {
+	theme := NewTheme(Options{Dark: true, NoColor: true})
+
+	assert.Equal(t, "  ", theme.Surface.Render("  "), "Surface must be inert without colour")
+	assert.NotContains(t, theme.Surface.Render("  "), "\x1b")
+
+	// OnSurface and Surfaced are the identity, so a call site needs no NoColor branch.
+	assert.Equal(t, theme.Accent.Render("x"), theme.OnSurface(theme.Accent).Render("x"))
+	assert.Equal(t, theme.Muted.Render("x"), theme.Surfaced().Muted.Render("x"))
+	for _, rendered := range []string{
+		theme.Surfaced().Title.Render("x"),
+		theme.Surfaced().Err.Render("x"),
+		theme.Surfaced().Numeric.Render("x"),
+	} {
+		assert.NotContains(t, rendered, "\x1b[4", "no background may reach a NO_COLOR terminal")
+	}
+}
+
+// TestSurfacedKeepsForegroundAndAddsBackground is the property the banded rows rely on: the
+// meaning of a style is its foreground, and putting it on the band must not change that.
+func TestSurfacedKeepsForegroundAndAddsBackground(t *testing.T) {
+	for _, dark := range []bool{true, false} {
+		theme := NewTheme(Options{Dark: dark})
+		surfaced := theme.Surfaced()
+		band := theme.Surface.Render(" ")
+		require.Contains(t, band, "\x1b[4", "the band must set a background")
+		background := backgroundOf(t, band)
+
+		for name, pair := range map[string][2]string{
+			"Title":    {theme.Title.Render("x"), surfaced.Title.Render("x")},
+			"Muted":    {theme.Muted.Render("x"), surfaced.Muted.Render("x")},
+			"Accent":   {theme.Accent.Render("x"), surfaced.Accent.Render("x")},
+			"Err":      {theme.Err.Render("x"), surfaced.Err.Render("x")},
+			"Numeric":  {theme.Numeric.Render("x"), surfaced.Numeric.Render("x")},
+			"Temporal": {theme.Temporal.Render("x"), surfaced.Temporal.Render("x")},
+		} {
+			plain, onBand := pair[0], pair[1]
+			assert.NotEqual(t, plain, onBand, "%s should differ on the band", name)
+			assert.Contains(t, onBand, background, "%s should carry the band background", name)
+			for _, code := range foregroundsOf(plain) {
+				assert.Contains(t, onBand, code, "%s should keep its foreground", name)
+			}
+		}
+
+		// The badge sets a background of its own and reads by contrasting with what it sits
+		// on, so Surfaced must leave it alone.
+		assert.Equal(t, theme.Badge.Render("DEMO"), surfaced.Badge.Render("DEMO"))
+	}
+}
+
+// trueColour matches one truecolour SGR parameter run, foreground (38) or background (48).
+// lipgloss merges a style's parameters into a single sequence, so the run and not the whole
+// sequence is what one style's contribution to another's rendering looks like.
+var trueColour = regexp.MustCompile(`(38|48);2;[0-9]+;[0-9]+;[0-9]+`)
+
+// backgroundOf extracts the background parameter run from a rendered string.
+func backgroundOf(t *testing.T, rendered string) string {
+	t.Helper()
+	for _, run := range trueColour.FindAllString(rendered, -1) {
+		if strings.HasPrefix(run, "48;") {
+			return run
+		}
+	}
+	t.Fatalf("no background in %q", rendered)
+	return ""
+}
+
+// foregroundsOf extracts the foreground parameter runs from a rendered string.
+func foregroundsOf(rendered string) []string {
+	var codes []string
+	for _, run := range trueColour.FindAllString(rendered, -1) {
+		if strings.HasPrefix(run, "38;") {
+			codes = append(codes, run)
+		}
+	}
+	return codes
+}
diff --git a/plc4go/tools/internal/tuitest/painted.go b/plc4go/tools/internal/tuitest/painted.go
new file mode 100644
index 00000000..0b026088
--- /dev/null
+++ b/plc4go/tools/internal/tuitest/painted.go
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Package tuitest holds assertions about rendered output that both tools need.
+//
+// It exists rather than each tool keeping a copy because the logic here is fiddly enough to
+// drift: two hand-written SGR parsers that disagree would give two different answers to the
+// same question about the same screen.
+package tuitest
+
+import (
+	"regexp"
+	"strconv"
+	"strings"
+
+	"charm.land/lipgloss/v2"
+)
+
+// Escapes matches one SGR sequence, for tests that need to look at or strip the styling.
+var Escapes = regexp.MustCompile("\x1b\\[[0-9;]*m")
+
+// Strip removes all styling from a rendered string.
+func Strip(rendered string) string { return Escapes.ReplaceAllString(rendered, "") }
+
+// PaintedCells counts the leading cells of a row that the terminal actually fills in.
+//
+// A background set once covers every cell after it until a reset or an explicit
+// default-background takes it away; a foreground or an attribute leaves it alone. That is why
+// this walks cells rather than styled segments: the bug it was written to catch is a bare space
+// *between* two styled pieces, which no per-segment check would see.
+//
+// Reverse video counts as painted. bubbles draws the text cursor that way and its background is
+// not settable, so it is the one cell of a command bar carrying no background of its own -- and
+// it still paints a solid block, which is all this asks about.
+func PaintedCells(line string) int {
+	cells, painted := 0, false
+	rest := line
+	for rest != "" {
+		location := Escapes.FindStringIndex(rest)
+		if location != nil && location[0] == 0 {
+			for param := range strings.SplitSeq(strings.Trim(rest[2:location[1]], "m"), ";") {
+				switch param {
+				case "", "0", "49":
+					painted = false
+				case "7", "48", "40", "41", "42", "43", "44", "45", "46", "47",
+					"100", "101", "102", "103", "104", "105", "106", "107":
+					painted = true
+				}
+			}
+			rest = rest[location[1]:]
+			continue
+		}
+
+		next := len(rest)
+		if location != nil {
+			next = location[0]
+		}
+		if !painted {
+			return cells
+		}
+		cells += lipgloss.Width(rest[:next])
+		rest = rest[next:]
+	}
+	return cells
+}
+
+// ColourCodes returns every SGR sequence in a rendered string that sets a colour, so a test
+// can assert that a NO_COLOR render sets none. Attributes and resets are not colours: NO_COLOR
+// asks for no colour, and bold and reverse video are how a title and a cursor still read
+// without one.
+//
+// The whole sequence is returned rather than the parameter that gave it away, because a
+// failure message naming "\x1b[38;2;167;139;250m" says what leaked and one naming "38" does not.
+func ColourCodes(rendered string) []string {
+	var colours []string
+	for _, code := range Escapes.FindAllString(rendered, -1) {
+		for param := range strings.SplitSeq(strings.Trim(code[2:], "m"), ";") {
+			if !setsColour(param) {
+				continue
+			}
+			colours = append(colours, code)
+			// One report per sequence. 38 and 48 are followed by their arguments, which are
+			// numbers rather than parameters and would otherwise be read as colours of their
+			// own -- an RGB green of 31 is not the SGR red 31.
+			break
+		}
+	}
+	return colours
+}
+
+// setsColour reports whether one SGR parameter selects a colour, as opposed to setting an
+// attribute or resetting one.
+func setsColour(param string) bool {
+	switch param {
+	case "38", "48", "58":
+		// Extended colour: 38;2;R;G;B or 38;5;N.
+		return true
+	}
+	number, err := strconv.Atoi(param)
+	if err != nil {
+		return false
+	}
+	switch {
+	case number >= 30 && number <= 37, number >= 40 && number <= 47,
+		number >= 90 && number <= 97, number >= 100 && number <= 107:
+		return true
+	default:
+		// Everything else is an attribute (bold, reverse) or a reset, including 39 and 49,
+		// which put the terminal's own colours back.
+		return false
+	}
+}
diff --git a/plc4go/tools/plc4xbrowser/browser/appearance_test.go b/plc4go/tools/plc4xbrowser/browser/appearance_test.go
new file mode 100644
index 00000000..87ea25a4
--- /dev/null
+++ b/plc4go/tools/plc4xbrowser/browser/appearance_test.go
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package browser
+
+import (
+	"strconv"
+	"strings"
+	"testing"
+	"time"
+
+	"charm.land/lipgloss/v2"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
+	"github.com/apache/plc4x-extras/plc4go/tools/internal/plcsession"
+	"github.com/apache/plc4x-extras/plc4go/tools/internal/tui"
+	"github.com/apache/plc4x-extras/plc4go/tools/internal/tuitest"
+)
+
+// The rest of the suite renders with the plain theme, because assertions read better against
+// text than against escape sequences. These tests are the exception: they exist because the
+// coloured themes are what a user actually sees, and three of the mistakes made building this
+// screen -- a band that stopped a cell short of the edge, a style whose reset punched a hole
+// in the band, and a background reaching a NO_COLOR terminal -- are invisible in plain text.
+
+// TestBandedRowsCoverTheFullWidth pins the fix for a command bar whose background stopped one
+// cell short of the right edge, which reads as a notch in the bar rather than as a bar.
+func TestBandedRowsCoverTheFullWidth(t *testing.T) {
+	for _, dark := range []bool{true, false} {
+		theme := tui.NewTheme(tui.Options{Dark: dark})
+		m := newTestModelWithTheme(t, theme)
+
+		// Several widths: the status bar drops pieces as it narrows, and each candidate has to
+		// pad back out to the full width.
+		for _, width := range []int{157, 120, 100, 80, 64} {
+			m = sized(t, m, width, 40)
+			rows := strings.Split(m.render(), "\n")
+			require.Len(t, rows, 40)
+
+			for _, row := range []struct {
+				name  string
+				index int
+			}{
+				{"status bar", 0},
+				{"command bar", len(rows) - 2},
+			} {
+				line := rows[row.index]
+				assert.Equal(t, width, lipgloss.Width(line),
+					"%s at %d columns should be exactly the screen width", row.name, width)
+				assert.Equal(t, width, tuitest.PaintedCells(line),
+					"%s at %d columns should be banded across its whole width", row.name, width)
+			}
+		}
+	}
+}
+
+// TestNoColorRenderIsFreeOfColour is the NO_COLOR contract for the whole screen rather than for
+// one style. Bold and reverse video stay: NO_COLOR asks for no colour, and those are how a
+// title and a cursor still read without one. A background is the one thing that cannot degrade
+// gracefully, because it prints as a solid block.
+func TestNoColorRenderIsFreeOfColour(t *testing.T) {
+	m := newTestModelWithTheme(t, tui.NewTheme(tui.Options{Dark: true, NoColor: true}))
+	m = sized(t, m, 120, 40)
+	m.appendLogAt("error", "something failed")
+	m.appendLogAt("warn", "something is odd")
+	render := m.render()
+
+	assert.Empty(t, tuitest.ColourCodes(render), "a NO_COLOR render must set no colour")
+	// Whatever else it does, it must not paint a background anywhere.
+	assert.Equal(t, 0, tuitest.PaintedCells(strings.Split(render, "\n")[0]),
+		"a NO_COLOR status bar must not be banded")
+}
+
+// TestColouredRenderKeepsEveryRowExactlyTheScreenWidth guards the whole screen, not just the
+// bands: a row that miscounts its cells because of an escape sequence tears every row below it.
+func TestColouredRenderKeepsEveryRowExactlyTheScreenWidth(t *testing.T) {
+	m := newTestModelWithTheme(t, tui.NewTheme(tui.Options{Dark: true}))
+	for _, size := range [][2]int{{157, 50}, {100, 30}, {80, 24}, {64, 14}} {
+		m = sized(t, m, size[0], size[1])
+		rows := strings.Split(m.render(), "\n")
+		assert.Len(t, rows, size[1])
+		for i, row := range rows {
+			assert.Equal(t, size[0], lipgloss.Width(row), "row %d at %dx%d", i, size[0], size[1])
+		}
+	}
+}
+
+// TestTagValuesAreColouredByType checks that the four type families reach the screen: the
+// point of typing the values was that a number, a flag, a string and a time read differently.
+func TestTagValuesAreColouredByType(t *testing.T) {
+	theme := tui.NewTheme(tui.Options{Dark: true})
+
+	rendered := map[string]string{}
+	for _, tag := range []plcsession.TagResult{
+		{Name: "a", DataType: "REAL", Value: "21.5"},
+		{Name: "b", DataType: "BOOL", Value: "true"},
+		{Name: "c", DataType: "STRING", Value: "running"},
+		{Name: "d", DataType: "TIME", Value: "1h2m"},
+	} {
+		rendered[tag.DataType] = renderTagValue(theme, tag)
+	}
+
+	seen := map[string]string{}
+	for dataType, value := range rendered {
+		codes := tuitest.Escapes.FindAllString(value, -1)
+		require.NotEmpty(t, codes, "%s should be styled", dataType)
+		if other, clash := seen[codes[0]]; clash {
+			t.Fatalf("%s and %s render in the same colour", dataType, other)
+		}
+		seen[codes[0]] = dataType
+		assert.Contains(t, tuitest.Strip(value), rendered[dataType][:0]+value[:0])
+	}
+}
+
+// TestRenderTagValueSplitsAccessFlags covers the browse case: the value carries the access
+// triple and then the tag's human name, and the two read better apart.
+func TestRenderTagValueSplitsAccessFlags(t *testing.T) {
+	theme := tui.NewTheme(tui.Options{Dark: true, NoColor: true})
+
+	for name, test := range map[string]struct {
+		tag  plcsession.TagResult
+		want string
+	}{
+		"flags and name":  {plcsession.TagResult{Value: "rw- Temperature 1"}, "rw- Temperature 1"},
+		"flags alone":     {plcsession.TagResult{Value: "rws"}, "rws"},
+		"all denied":      {plcsession.TagResult{Value: "--- Hidden"}, "--- Hidden"},
+		"plain value":     {plcsession.TagResult{DataType: "REAL", Value: "21.5"}, "21.5"},
+		"three-char word": {plcsession.TagResult{DataType: "STRING", Value: "off now"}, "off now"},
+	} {
+		assert.Equal(t, test.want, renderTagValue(theme, test.tag), name)
+	}
+}
+
+// TestIsAccessFlagsRejectsLookalikes is why isAccessFlags exists at all: a three-character
+// value that merely looks like a triple must not be styled as one.
+func TestIsAccessFlagsRejectsLookalikes(t *testing.T) {
+	for _, flags := range []string{"rws", "rw-", "r--", "---", "-w-", "--s"} {
+		assert.True(t, isAccessFlags(flags), flags)
+	}
+	for _, other := range []string{"", "rw", "rwsx", "off", "abc", "RWS", "r w", "srw", "wrs"} {
+		assert.False(t, isAccessFlags(other), other)
+	}
+}
+
+// TestRoundDurationDropsNoiseAndKeepsSignal pins the precision rule. A demo read reporting
+// "62.25µs" is noise; a real one taking 1.2 seconds must not be rounded to "1s".
+func TestRoundDurationDropsNoiseAndKeepsSignal(t *testing.T) {
+	for _, test := range []struct {
+		in   time.Duration
+		want string
+	}{
+		{62250 * time.Nanosecond, "62µs"},
+		{999 * time.Nanosecond, "1µs"},
+		{4*time.Millisecond + 213*time.Microsecond, "4.2ms"},
+		{999 * time.Millisecond, "999ms"},
+		{1234 * time.Millisecond, "1.23s"},
+		{2*time.Second + 4*time.Millisecond, "2s"},
+		{90 * time.Second, "1m30s"},
+	} {
+		assert.Equal(t, test.want, roundDuration(test.in), test.in.String())
+	}
+
+	// Whatever the precision, a duration never renders as nothing.
+	for _, d := range []time.Duration{0, time.Nanosecond, time.Hour} {
+		assert.NotEmpty(t, roundDuration(d))
+	}
+}
+
+// TestLogLevelTagsAreAlignedAndDistinct matters because the tags are what gives a wall of log
+// lines shape: unequal widths would ragged the left edge of every message.
+func TestLogLevelTagsAreAlignedAndDistinct(t *testing.T) {
+	tags := map[string]string{}
+	for _, level := range []string{"error", "warn", "info", "debug", "trace", "", "nonsense"} {
+		tag := logLevelTag(level)
+		assert.Len(t, tag, 3, "%q should be a three-letter tag", level)
+		tags[level] = tag
+	}
+
+	assert.Equal(t, "ERR", tags["error"])
+	assert.Equal(t, "WRN", tags["warn"])
+	assert.Equal(t, "INF", tags["info"])
+	// Anything else is an ordinary line rather than a fourth marker.
+	for _, level := range []string{"debug", "trace", "", "nonsense"} {
+		assert.Equal(t, "INF", tags[level], level)
+	}
+}
+
+// TestLogLinesCarryTheirLevel checks the level survives into the rendered console, which is
+// what lets a failure be spotted in the log without reading it.
+func TestLogLinesCarryTheirLevel(t *testing.T) {
+	m := newTestModelWithTheme(t, tui.NewTheme(tui.Options{Dark: true}))
+	m = sized(t, m, 120, 40)
+
+	m.appendLogAt("info", "connected")
+	m.appendLogAt("error", "read failed")
+
+	lines := m.LogLines()
+	require.GreaterOrEqual(t, len(lines), 2)
+	info, failure := lines[len(lines)-2], lines[len(lines)-1]
+
+	assert.Contains(t, tuitest.Strip(info), "INF")
+	assert.Contains(t, tuitest.Strip(failure), "ERR")
+
+	// The two lines have to be told apart by colour and not only by their three letters. The
+	// comparison is over the whole set of codes in each line rather than the first, because
+	// both lines open with the same muted timestamp; it is the level marker that differs.
+	theme := tui.NewTheme(tui.Options{Dark: true})
+	errCode := tuitest.Escapes.FindAllString(theme.Err.Render("x"), -1)[0]
+	assert.Contains(t, tuitest.Escapes.FindAllString(failure, -1), errCode, "an error line should be red")
+	assert.NotContains(t, tuitest.Escapes.FindAllString(info, -1), errCode, "an info line should not")
+}
+
+// TestSelectedMessageRowIsVisuallyDistinct guards a regression that no plain-theme test can
+// see. bubbles/table styles each cell and then styles the selected row around them, so a
+// foreground on the cell style ends with a reset that wipes the selection from every cell
+// after the first -- and the selected row becomes indistinguishable from its neighbours.
+func TestSelectedMessageRowIsVisuallyDistinct(t *testing.T) {
+	theme := tui.NewTheme(tui.Options{Dark: true})
+	m := newTestModelWithTheme(t, theme)
+	m = sized(t, m, 120, 30)
+	for _, address := range []string{"temp/1", "temp/2", "press/1"} {
+		_, cmd := m.Update(tui.PromptSubmitMsg{Line: "read-direct " + plcsession.DemoDeviceOne + " " + address})
+		runCmd(t, m, cmd)
+	}
+	_, total := m.EventCount()
+	require.Equal(t, 3, total)
+
+	rows := messageRows(t, m)
+	require.Len(t, rows, 3)
+
+	// Follow keeps the newest selected, so the last row is the one carrying the selection.
+	selected, plain := rows[2], rows[0]
+	selectionCode := tuitest.Escapes.FindString(theme.SelectedRow.Render("x"))
+	require.NotEmpty(t, selectionCode)
+
+	assert.Contains(t, selected, selectionCode, "the selected row should carry the selection style")
+	assert.NotContains(t, plain, selectionCode, "an unselected row should not")
+
+	// And the selection has to survive past the first cell, which is the actual bug: the row
+	// is styled once, and each cell's own styling would end it at the first reset. The run the
+	// selection opens therefore has to still be open when the time column arrives.
+	run := selected[strings.Index(selected, selectionCode)+len(selectionCode):]
+	if end := tuitest.Escapes.FindStringIndex(run); end != nil {
+		run = run[:end[0]]
+	}
+	assert.Contains(t, run, "12:",
+		"the selection should still be in force at the time column, not ended after the first cell")
+}
+
+// messageRows returns the body rows of the message table, stripped of the pane chrome around
+// them but with their styling intact.
+func messageRows(t *testing.T, m *Model) []string {
+	t.Helper()
+	var rows []string
+	for line := range strings.SplitSeq(m.render(), "\n") {
+		plain := tuitest.Strip(line)
+		for index := 1; index <= 3; index++ {
+			marker := "\u2502" + strconv.Itoa(index) + "   "
+			if strings.Contains(plain, marker) {
+				rows = append(rows, line)
+			}
+		}
+	}
+	return rows
+}
diff --git a/plc4go/tools/plc4xbrowser/browser/keys_test.go b/plc4go/tools/plc4xbrowser/browser/keys_test.go
index 797d33b9..c75f376f 100644
--- a/plc4go/tools/plc4xbrowser/browser/keys_test.go
+++ b/plc4go/tools/plc4xbrowser/browser/keys_test.go
@@ -339,16 +339,18 @@ func TestTheSidebarKeepsTheBrowseCatalogue(t *testing.T) {
 	_, cmd := model.Update(tui.PromptSubmitMsg{Line: "browse-direct " + plcsession.DemoDeviceOne})
 	runCmd(t, model, cmd)
 
+	// While the browse is the selected message the detail pane is already showing this list, so
+	// the sidebar stays out of the way rather than printing the same eight tags a second time.
 	rendered := strings.Join(renderLines(t, model), "\n")
-	assert.Contains(t, rendered, "TAGS", "the browse result belongs in the sidebar's dead space")
-	assert.Contains(t, rendered, "motor/speed", "and it lists the tags")
+	assert.NotContains(t, rendered, "TAGS ",
+		"the sidebar must not repeat the list the detail pane is showing:\n%s", rendered)
 
-	// Move on to a read: the catalogue must persist rather than follow the selection.
+	// Move on to a read: now the catalogue earns its space as a reference.
 	_, cmd = model.Update(tui.PromptSubmitMsg{Line: "read-direct " + plcsession.DemoDeviceOne + " temp/1"})
 	runCmd(t, model, cmd)
 	rendered = strings.Join(renderLines(t, model), "\n")
-	assert.Contains(t, rendered, "motor/speed",
-		"the catalogue is a reference; it must not vanish when the selection moves")
+	assert.Contains(t, rendered, "TAGS ", "once the selection moves on, the catalogue is a reference")
+	assert.Contains(t, rendered, "motor/speed", "and it lists the tags the browse found")
 }
 
 // TestTheStatusBarCountsFailures: a message count says nothing about whether any failed, which
diff --git a/plc4go/tools/plc4xbrowser/browser/model.go b/plc4go/tools/plc4xbrowser/browser/model.go
index 940d997e..c4709afb 100644
--- a/plc4go/tools/plc4xbrowser/browser/model.go
+++ b/plc4go/tools/plc4xbrowser/browser/model.go
@@ -30,6 +30,7 @@ import (
 	"charm.land/bubbles/v2/table"
 	"charm.land/bubbles/v2/viewport"
 	tea "charm.land/bubbletea/v2"
+	"charm.land/lipgloss/v2"
 
 	"github.com/rs/zerolog"
 
@@ -321,7 +322,12 @@ func (m *Model) showConnectionColumn() bool {
 func tableStyles(theme tui.Theme) table.Styles {
 	styles := table.DefaultStyles()
 	styles.Header = theme.Key.Bold(true)
-	styles.Cell = theme.Value
+	// Cell is deliberately bare rather than theme.Value. bubbles/table styles each cell and
+	// then styles the selected row around them, and a cell's own styling ends with a reset --
+	// so any foreground here wipes the selection from every cell after the first and leaves
+	// the selected row indistinguishable. Body text wants the terminal's default colour
+	// anyway, which is what a bare style renders as.
+	styles.Cell = lipgloss.NewStyle()
 	styles.Selected = theme.SelectedRow
 	if theme.IsNoColor() {
 		// Reverse video would be the obvious colourless highlight, but it fights the selection
@@ -906,7 +912,7 @@ func (m *Model) applyCommand(msg commandDoneMsg) (tea.Model, tea.Cmd) {
 		m.composer.submitting = false
 		if msg.err != nil {
 			m.composer.problem = msg.err.Error()
-			m.appendLog(m.theme.Glyphs.Err + " " + msg.err.Error())
+			m.appendLogError(msg.err.Error())
 			return m, nil
 		}
 		m.closeComposer()
@@ -915,7 +921,7 @@ func (m *Model) applyCommand(msg commandDoneMsg) (tea.Model, tea.Cmd) {
 
 	if msg.err != nil {
 		m.toast = msg.err.Error()
-		m.appendLog(m.theme.Glyphs.Err + " " + msg.err.Error())
+		m.appendLogError(msg.err.Error())
 		return m, nil
 	}
 	m.prompt.Reset()
@@ -1011,10 +1017,23 @@ func (m *Model) trimEvents() {
 	}
 }
 
-// appendLog adds a console line, bounded by the configured maximum.
+// appendLog adds a console line at info level.
 func (m *Model) appendLog(line string) {
+	m.appendLogAt("info", line)
+}
+
+// appendLogError adds a console line at error level, so a failure has shape in the pane rather
+// than being one more grey line among many.
+func (m *Model) appendLogError(line string) {
+	m.appendLogAt("error", line)
+}
+
+// appendLogAt adds a console line at a level, bounded by the configured maximum.
+func (m *Model) appendLogAt(level, line string) {
 	stamp := m.options.Now().Format("15:04:05")
-	m.logLines = append(m.logLines, stamp+" "+line)
+	styled := m.theme.Muted.Render(stamp) + " " +
+		m.theme.LogLevel(level).Render(logLevelTag(level)) + " " + line
+	m.logLines = append(m.logLines, styled)
 	if limit := m.options.Config.MaxConsoleLines; limit > 0 && len(m.logLines) > limit {
 		m.logLines = m.logLines[len(m.logLines)-limit:]
 	}
@@ -1022,6 +1041,18 @@ func (m *Model) appendLog(line string) {
 	m.logView.GotoBottom()
 }
 
+// logLevelTag is the three-letter level marker, which keeps the lines aligned.
+func logLevelTag(level string) string {
+	switch level {
+	case "error":
+		return "ERR"
+	case "warn":
+		return "WRN"
+	default:
+		return "INF"
+	}
+}
+
 // AppendLog exposes the console so a caller can write a startup banner before the program runs.
 func (m *Model) AppendLog(line string) { m.appendLog(line) }
 
@@ -1103,7 +1134,10 @@ func (m *Model) refreshMessages() {
 		if withConnection {
 			row = append(row, event.Connection)
 		}
-		rows = append(rows, append(row, firstTagAddress(event), eventCode(event)))
+		// The outcome carries its own colour. bubbles/table styles every cell alike, so the
+		// meaning has to travel in the cell's own text; the table measures width with an
+		// ANSI-aware width function, so the escapes do not disturb the column arithmetic.
+		rows = append(rows, append(row, firstTagAddress(event), m.renderCode(event)))
 	}
 	m.messages.SetRows(rows)
 	if m.follow && len(rows) > 0 {
@@ -1124,6 +1158,20 @@ func firstTagAddress(event plcsession.Event) string {
 	}
 }
 
+// renderCode is eventCode with its meaning in colour: an OK is green and a failure red, so a
+// bad row is findable in a full pane without reading it.
+func (m *Model) renderCode(event plcsession.Event) string {
+	code := eventCode(event)
+	switch {
+	case code == "":
+		return ""
+	case code == plcsession.ResponseCodeOK:
+		return m.theme.Ok.Render(code)
+	default:
+		return m.theme.Err.Render(code)
+	}
+}
+
 // eventCode summarises an event's outcome for the code column.
 func eventCode(event plcsession.Event) string {
 	failed := 0
@@ -1168,6 +1216,16 @@ func (m *Model) SelectedEvent() (plcsession.Event, bool) {
 	return events[cursor], true
 }
 
+// detailShowsCatalogue reports whether the detail pane is currently displaying the same tag
+// list the sidebar keeps as its catalogue.
+func (m *Model) detailShowsCatalogue() bool {
+	event, ok := m.SelectedEvent()
+	if !ok || event.Kind != plcsession.EventBrowse {
+		return false
+	}
+	return event.Connection == m.catalogueConnection && len(event.Tags) == len(m.catalogue)
+}
+
 // FailedCount reports how many held messages carry a failed tag.
 func (m *Model) FailedCount() int {
 	failed := 0
@@ -1290,7 +1348,10 @@ func (m *Model) resize(size tui.Size) {
 	}
 
 	// The prompt and the help footer span the full width less one cell of margin either side.
-	m.prompt.SetWidth(max(size.Width-2, 1))
+	// One cell narrower than the screen, not two: renderPrompt draws a single gutter cell to
+	// the prompt's left, and together they have to cover the row exactly, or the command bar's
+	// band stops one cell short of the right edge.
+	m.prompt.SetWidth(max(size.Width-1, 1))
 	m.help.SetWidth(max(size.Width-2, 1))
 
 	mainWidth := m.layout.MainWidth
diff --git a/plc4go/tools/plc4xbrowser/browser/model_test.go b/plc4go/tools/plc4xbrowser/browser/model_test.go
index 14ad662b..2ffc8939 100644
--- a/plc4go/tools/plc4xbrowser/browser/model_test.go
+++ b/plc4go/tools/plc4xbrowser/browser/model_test.go
@@ -46,6 +46,13 @@ func testTheme() tui.Theme {
 // newTestModel builds a model over a connected demo session.
 func newTestModel(t *testing.T) *Model {
 	t.Helper()
+	return newTestModelWithTheme(t, testTheme())
+}
+
+// newTestModelWithTheme is newTestModel with the theme chosen by the caller, so that a test can
+// exercise the coloured themes rather than only the plain one the assertions read.
+func newTestModelWithTheme(t *testing.T, theme tui.Theme) *Model {
+	t.Helper()
 
 	session := plcsession.NewDemo(plcsession.DemoOptions{
 		SubscriptionInterval: time.Millisecond,
@@ -58,7 +65,6 @@ func newTestModel(t *testing.T) *Model {
 	require.NoError(t, err)
 
 	config := NewConfig()
-	theme := testTheme()
 	model := NewModel(Options{
 		Session: session,
 		Config:  &config,
diff --git a/plc4go/tools/plc4xbrowser/browser/view.go b/plc4go/tools/plc4xbrowser/browser/view.go
index 82bf63e2..b8f3a955 100644
--- a/plc4go/tools/plc4xbrowser/browser/view.go
+++ b/plc4go/tools/plc4xbrowser/browser/view.go
@@ -23,6 +23,7 @@ import (
 	"fmt"
 	"strconv"
 	"strings"
+	"time"
 
 	tea "charm.land/bubbletea/v2"
 	"charm.land/lipgloss/v2"
@@ -106,7 +107,9 @@ func (m *Model) renderTooSmall(width, height int) string {
 // does not fit -- the approved design is about 91 cells wide and the target is 80 -- so pieces
 // are dropped in order of how little they are missed.
 func (m *Model) renderStatus(width int) string {
-	theme := m.theme
+	// The row is a band, so it is drawn with the surfaced theme throughout: the top bar and the
+	// command bar at the foot then frame the panes between them.
+	theme := m.theme.Surfaced()
 	glyphs := theme.Glyphs
 
 	name := "PLC4X Browser"
@@ -114,16 +117,24 @@ func (m *Model) renderStatus(width int) string {
 		name += " " + m.options.Version
 	}
 	shown, total := m.EventCount()
-	counts := fmt.Sprintf("conn %d %s drv %d %s msg %d",
-		len(m.options.Session.Connections()), glyphs.Separator,
-		len(m.options.Session.Drivers()), glyphs.Separator, total)
+	// The numbers carry the accent and their labels stay muted, so the eye lands on the counts
+	// rather than on the words between them.
+	count := func(label string, value int) string {
+		return theme.Muted.Render(label+" ") + theme.Accent.Render(strconv.Itoa(value))
+	}
+	counts := strings.Join([]string{
+		count("conn", len(m.options.Session.Connections())),
+		count("drv", len(m.options.Session.Drivers())),
+		count("msg", total),
+	}, theme.Chrome.Render(" "+glyphs.Separator+" "))
 	if shown != total {
-		counts += fmt.Sprintf(" (%d shown)", shown)
+		counts += theme.Muted.Render(" (" + strconv.Itoa(shown) + " shown)")
 	}
 	// A count of messages says nothing about whether any of them failed, which is the one
-	// number worth glancing at.
+	// number worth glancing at, so it is the one that is red.
 	if failed := m.FailedCount(); failed > 0 {
-		counts += " " + glyphs.Separator + " " + theme.Err.Render(strconv.Itoa(failed)+" failed")
+		counts += theme.Chrome.Render(" "+glyphs.Separator+" ") +
+			theme.Err.Render(strconv.Itoa(failed)+" failed")
 	}
 	logLevel := m.options.Config.LogLevel
 	if logLevel == "" {
@@ -144,7 +155,10 @@ func (m *Model) renderStatus(width int) string {
 		{name, badge},
 		{name},
 	}
-	separator := " " + theme.Muted.Render(glyphs.Separator) + " "
+	// The spaces are inside the styled run, not outside it. A terminal ends a background at
+	// the style's reset, so a bare space between two styled pieces would show the terminal's
+	// own background through the band and stripe the bar.
+	separator := theme.Muted.Render(" " + glyphs.Separator + " ")
 	for _, candidate := range candidates {
 		parts := make([]string, 0, len(candidate))
 		for i, part := range candidate {
@@ -161,9 +175,9 @@ func (m *Model) renderStatus(width int) string {
 			}
 			parts = append(parts, theme.Muted.Render(part))
 		}
-		line := " " + strings.Join(parts, separator)
+		line := theme.Surface.Render(" ") + strings.Join(parts, separator)
 		if lipgloss.Width(line) <= width {
-			return padTo(line, width)
+			return padOnto(theme.Surface, line, width)
 		}
 	}
 	return padTo(" "+theme.Title.Render(name), width)
@@ -248,12 +262,15 @@ func (m *Model) renderSidebarPane(width, height int) string {
 	// The pane had eleven blank rows at the reference size with one connection and one driver.
 	// The last browse goes there as a catalogue you can refer back to while reading individual
 	// tags -- not the selected message's tags, which the detail pane is already showing.
-	if len(m.catalogue) > 0 {
+	// Suppressed while the detail pane is already showing this very list: the catalogue earns
+	// its space as a reference to refer back to once a single tag is being read, not as a
+	// second copy of what is on screen beside it.
+	if len(m.catalogue) > 0 && !m.detailShowsCatalogue() {
 		lines = append(lines, "", theme.Key.Render("TAGS "+m.catalogueConnection))
 		for _, tag := range m.catalogue {
 			label := "  " + tag.Address
 			if tag.DataType != "" {
-				label += " " + theme.Muted.Render(tag.DataType)
+				label += " " + theme.DataType(tag.DataType).Render(tag.DataType)
 			}
 			lines = append(lines, fitInline(label, inner))
 		}
@@ -362,7 +379,7 @@ func (m *Model) renderToast(width int) string {
 // It is emitted after everything droppable and before the help footer, so no layout decision
 // can remove it.
 func (m *Model) renderPrompt(width int) string {
-	return fitInline(" "+m.prompt.View(), width)
+	return fitInline(m.theme.Surface.Render(" ")+m.prompt.View(), width)
 }
 
 // overlayCompletion floats the completion list directly above the prompt.
@@ -442,7 +459,7 @@ func renderEventDetail(theme tui.Theme, event plcsession.Event) string {
 	timing := event.Received.Format("15:04:05.000")
 	if !event.Started.IsZero() {
 		if took := event.Received.Sub(event.Started); took > 0 {
-			timing += " " + glyphs.Separator + " " + took.String()
+			timing += " " + glyphs.Separator + " " + roundDuration(took)
 		}
 	}
 	if len(event.Tags) > 0 {
@@ -464,10 +481,12 @@ func renderEventDetail(theme tui.Theme, event plcsession.Event) string {
 			}
 			line := marker + " " + theme.Value.Render(tag.Address)
 			if tag.DataType != "" {
-				line += " " + theme.Muted.Render(tag.DataType)
+				// The type carries its family's hue: "which of these are numbers" is a
+				// question colour answers faster than reading eight type names.
+				line += " " + theme.DataType(tag.DataType).Render(tag.DataType)
 			}
 			if tag.Value != "" {
-				line += " " + theme.Value.Render(tag.Value)
+				line += " " + renderTagValue(theme, tag)
 			}
 			if !tag.Succeeded() {
 				line += " " + theme.Err.Render(tag.Code)
@@ -479,6 +498,49 @@ func renderEventDetail(theme tui.Theme, event plcsession.Event) string {
 	return strings.Join(lines, "\n")
 }
 
+// renderTagValue styles a tag's value.
+//
+// A browse puts the access flags in the value, and those read better split: the letters say
+// what may be done with the tag, the rest is its human name.
+func renderTagValue(theme tui.Theme, tag plcsession.TagResult) string {
+	value := tag.Value
+	flags, name, isAccess := strings.Cut(value, " ")
+	if isAccess && isAccessFlags(flags) {
+		return theme.Accent.Render(flags) + " " + theme.Muted.Render(name)
+	}
+	if isAccessFlags(value) {
+		return theme.Accent.Render(value)
+	}
+	return theme.DataType(tag.DataType).Render(value)
+}
+
+// isAccessFlags reports whether text is an rws access triple, so a value that merely happens
+// to be three characters long is not mistaken for one.
+func isAccessFlags(text string) bool {
+	if len(text) != 3 {
+		return false
+	}
+	for i, want := range []byte{'r', 'w', 's'} {
+		if text[i] != want && text[i] != '-' {
+			return false
+		}
+	}
+	return true
+}
+
+// roundDuration renders a duration at a precision worth reading. A synthetic read reporting
+// 62.25 microseconds is noise, not information.
+func roundDuration(d time.Duration) string {
+	switch {
+	case d >= time.Second:
+		return d.Round(10 * time.Millisecond).String()
+	case d >= time.Millisecond:
+		return d.Round(100 * time.Microsecond).String()
+	default:
+		return d.Round(time.Microsecond).String()
+	}
+}
+
 // fitScreen forces the rendered rows into exactly height lines of exactly width cells.
 //
 // This is the last line of defence: a pane that miscounts by one cell would otherwise tear
@@ -510,8 +572,14 @@ func fitInline(line string, width int) string {
 
 // padTo pads a line to a width without truncating it.
 func padTo(line string, width int) string {
+	return padOnto(lipgloss.NewStyle(), line, width)
+}
+
+// padOnto is padTo with the padding drawn in a style, so that a banded row's background runs
+// to the edge of the screen rather than stopping where its text does.
+func padOnto(style lipgloss.Style, line string, width int) string {
 	if gap := width - lipgloss.Width(line); gap > 0 {
-		return line + strings.Repeat(" ", gap)
+		return line + style.Render(strings.Repeat(" ", gap))
 	}
 	return line
 }
diff --git a/plc4go/tools/plc4xpcapanalyzer/ui/appearance_test.go b/plc4go/tools/plc4xpcapanalyzer/ui/appearance_test.go
new file mode 100644
index 00000000..8927286d
--- /dev/null
+++ b/plc4go/tools/plc4xpcapanalyzer/ui/appearance_test.go
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package ui
+
+import (
+	"strings"
+	"testing"
+
+	"charm.land/lipgloss/v2"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
+	"github.com/apache/plc4x-extras/plc4go/tools/internal/tui"
+	"github.com/apache/plc4x-extras/plc4go/tools/internal/tuitest"
+)
+
+// The rest of the suite renders with the plain theme, because assertions read better against
+// text than against escape sequences. These are the exception: the coloured themes are what a
+// user actually sees, and a band that stops short of the edge or a style whose reset punches a
+// hole in one is invisible in plain text.
+
+// TestBandedRowsCoverTheFullWidth pins the top bar and the command bar as bars: each has to be
+// painted across its whole width, at every width the status line degrades through.
+func TestBandedRowsCoverTheFullWidth(t *testing.T) {
+	state, _ := demoState(t)
+
+	for _, dark := range []bool{true, false} {
+		for _, width := range []int{157, 120, 100, 80, 64} {
+			m := newTestModelWithTheme(t, state, tui.Size{Width: width, Height: 40},
+				tui.Options{Dark: dark})
+			rows := strings.Split(m.Render(), "\n")
+			require.Len(t, rows, 40)
+
+			for _, row := range []struct {
+				name  string
+				index int
+			}{
+				{"status bar", 0},
+				{"command bar", len(rows) - 2},
+			} {
+				line := rows[row.index]
+				assert.Equal(t, width, lipgloss.Width(line),
+					"%s at %d columns should be exactly the screen width", row.name, width)
+				assert.Equal(t, width, tuitest.PaintedCells(line),
+					"%s at %d columns should be painted across its whole width", row.name, width)
+			}
+		}
+	}
+}
+
+// TestNoColorRenderIsFreeOfColour is the NO_COLOR contract for the whole screen. A band is a
+// background, and a background is the one thing that cannot degrade gracefully: it prints as a
+// solid block on a terminal that was asked for no colour.
+func TestNoColorRenderIsFreeOfColour(t *testing.T) {
+	state, _ := demoState(t)
+	m := newTestModelWithTheme(t, state, tui.Size{Width: 120, Height: 40},
+		tui.Options{Dark: true, NoColor: true, ASCII: true})
+	render := m.Render()
+
+	assert.Empty(t, tuitest.ColourCodes(render), "a NO_COLOR render must set no colour")
+	assert.Equal(t, 0, tuitest.PaintedCells(strings.Split(render, "\n")[0]),
+		"a NO_COLOR status bar must not be banded")
+}
+
+// TestColouredRenderKeepsEveryRowExactlyTheScreenWidth guards the whole screen rather than the
+// bands: a row that miscounts its cells because of an escape sequence tears every row below it.
+func TestColouredRenderKeepsEveryRowExactlyTheScreenWidth(t *testing.T) {
+	state, _ := demoState(t)
+	for _, size := range []tui.Size{{Width: 157, Height: 50}, {Width: 100, Height: 30}, {Width: 80, Height: 24}} {
+		m := newTestModelWithTheme(t, state, size, tui.Options{Dark: true})
+		rows := strings.Split(m.Render(), "\n")
+		assert.Len(t, rows, size.Height)
+		for i, row := range rows {
+			assert.Equal(t, size.Width, lipgloss.Width(row),
+				"row %d at %dx%d", i, size.Width, size.Height)
+		}
+	}
+}
diff --git a/plc4go/tools/plc4xpcapanalyzer/ui/helpers_test.go b/plc4go/tools/plc4xpcapanalyzer/ui/helpers_test.go
index f4bd89c1..8af87080 100644
--- a/plc4go/tools/plc4xpcapanalyzer/ui/helpers_test.go
+++ b/plc4go/tools/plc4xpcapanalyzer/ui/helpers_test.go
@@ -104,7 +104,14 @@ func demoState(t *testing.T) (*State, Demo) {
 // newTestModel builds a model at a size, with a fixed clock and a stable theme.
 func newTestModel(t *testing.T, state *State, size tui.Size) Model {
 	t.Helper()
-	model := NewModel(Options{Theme: testTheme(), State: state, Clock: fixedClock()})
+	return newTestModelWithTheme(t, state, size, testTheme())
+}
+
+// newTestModelWithTheme is newTestModel with the theme chosen by the caller, so that a test can
+// exercise the coloured themes rather than only the plain one the assertions read.
+func newTestModelWithTheme(t *testing.T, state *State, size tui.Size, options tui.Options) Model {
+	t.Helper()
+	model := NewModel(Options{Theme: options, State: state, Clock: fixedClock()})
 	return send(model, tea.WindowSizeMsg{Width: size.Width, Height: size.Height})
 }
 
diff --git a/plc4go/tools/plc4xpcapanalyzer/ui/view.go b/plc4go/tools/plc4xpcapanalyzer/ui/view.go
index ce57ff46..113f3eb7 100644
--- a/plc4go/tools/plc4xpcapanalyzer/ui/view.go
+++ b/plc4go/tools/plc4xpcapanalyzer/ui/view.go
@@ -265,34 +265,41 @@ func (m Model) applyOverlays(lines []string, width int) []string {
 // badge because mistaking a demo capture for a real one is the one mistake this tool must not
 // let a user make.
 func (m Model) statusLine(width int) string {
-	name := m.theme.Title.Render(AppName)
-	version := m.theme.Muted.Render(AppVersion)
+	// Drawn with the surfaced theme throughout, so the top bar and the command bar at the foot
+	// frame the panes between them the same way they do in the browser. Every space is inside
+	// a styled run rather than beside one: a terminal ends a background at the style's reset,
+	// so a bare space between two styled pieces would stripe the bar.
+	theme := m.theme.Surfaced()
+	space := theme.Surface.Render(" ")
+
+	name := theme.Title.Render(AppName)
+	version := theme.Muted.Render(AppVersion)
 	badge := ""
 	if m.state.Demo {
-		badge = m.theme.Badge.Render("DEMO")
+		badge = theme.Badge.Render("DEMO")
 	}
-	separator := " " + m.theme.Chrome.Render(m.theme.Glyphs.Separator) + " "
+	separator := theme.Chrome.Render(" " + theme.Glyphs.Separator + " ")
 
-	protocolText := m.theme.Value.Render(m.state.Protocol.Name)
+	protocolText := theme.Value.Render(m.state.Protocol.Name)
 	clientLong := ""
 	clientShort := ""
 	if m.state.HostIP != "" {
-		clientLong = m.theme.Muted.Render("client ") + m.theme.Value.Render(m.state.HostIP)
-		clientShort = m.theme.Value.Render(m.state.HostIP)
+		clientLong = theme.Muted.Render("client ") + theme.Value.Render(m.state.HostIP)
+		clientShort = theme.Value.Render(m.state.HostIP)
 	}
-	paneText := m.theme.Muted.Render("pane ") + m.theme.Value.Render(m.activePane().String())
+	paneText := theme.Muted.Render("pane ") + theme.Value.Render(m.activePane().String())
 
 	assemble := func(head []string, tail []string) string {
-		left := strings.Join(nonEmpty(head), " ")
+		left := strings.Join(nonEmpty(head), space)
 		right := strings.Join(nonEmpty(tail), separator)
 		if right == "" {
-			return left
+			return padOnto(theme.Surface, left, width)
 		}
 		gap := width - lipgloss.Width(left) - lipgloss.Width(right) - 1
 		if gap < 1 {
 			return ""
 		}
-		return left + strings.Repeat(" ", gap) + right + " "
+		return left + theme.Surface.Render(strings.Repeat(" ", gap)) + right + space
 	}
 
 	for _, candidate := range []string{
@@ -307,7 +314,7 @@ func (m Model) statusLine(width int) string {
 			return fitLine(candidate, width)
 		}
 	}
-	return fitLine(name+" "+badge, width)
+	return padOnto(theme.Surface, name+space+badge, width)
 }
 
 // toastLine renders the notice above the prompt.
@@ -1151,6 +1158,15 @@ func padRows(rows []string, width, count int) []string {
 	return rows[:count]
 }
 
+// padOnto pads a line out to width in a style, so a banded row's background runs to the edge
+// of the screen rather than stopping where its text does. It truncates like fitLine.
+func padOnto(style lipgloss.Style, line string, width int) string {
+	if gap := width - lipgloss.Width(line); gap > 0 {
+		return line + style.Render(strings.Repeat(" ", gap))
+	}
+	return fitLine(line, width)
+}
+
 // fitLine forces one line to exactly width cells, measured in display cells so that styled
 // text and wide glyphs are counted correctly.
 func fitLine(line string, width int) string {