Skip to content

fix(tabs): a background pane says which tab it is showing - #32

Merged
HarryCordewener merged 3 commits into
mainfrom
feat/tab-chip-colours
Aug 12, 2026
Merged

fix(tabs): a background pane says which tab it is showing#32
HarryCordewener merged 3 commits into
mainfrom
feat/tab-chip-colours

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Aug 12, 2026

Copy link
Copy Markdown
Member

There was no way to tell which tab an unfocused pane was showing.

PaintTabChips derived the selected chip and its siblings from the same
expression — background and ink — so in a pane that did not hold the focus
every chip was painted byte-identically to the pane's own surface tone. The
was no help either: TabTitles only emits it on the focused pane.

The model

A chip states one fact — is this the tab you are viewing — and states it
relative to its own strip:

chip background ink
selected PaneSurfaceTone theme foreground
unselected WorkspacePalette.Recessed(surface) IdleInk

Pane focus is no longer a parameter. It arrives already folded into that plane —
PaneSurfaceTone has tinted it for the character and lifted it for focus — so
the selection cue is one ratio inside every strip, on every theme, under every
tint, and hue stays free to carry identity. Both inks stay held to the
legibility floor against the chip they actually land on.

Selection is also emboldened, in every pane, so it survives a terminal that
flattens the chips. It composes with the unread tint into one markup tag rather
than two nested ones, because a background pane's front tab collects lines like
any other. Zero cells either way — every width the strip is measured by is
MarkupParser.StripLength.

Two smaller things fixed on the way: the focused pane's active chip used the
untinted ArmedBand(_theme) while the command line beneath it used
ArmedBand(theme, tint), so a tinted character's chip wore the wrong hue; and
UnreadBadge had a doc block that closed <summary> twice.

Verification

New tabs snapshot view: two tabs in the pane that does not hold the focus.
No existing view had that geometry, which is why no frame ever caught this. It
opens a third window for itself alone and re-activates the main window before
splitting, since opening brings a window to the front and a split carries the
tabs that are not.

Read off the rendered frame — right pane, unfocused: selected chip (34,34,38),
its own surface; sibling (26,26,29), recessed. The regression pin fails
against the old expression and passes against the new one (checked by reverting
the one term and re-running).

All five suites green: Core 936, Graphics 83, Scripting 42, Web 37, Tui 1772.

Not fixed here

The between chips and the filling the rest of the strip are hardcoded
Color.Grey in SharpConsoleUI's TabControl.Rendering.cs, in all three header
styles, with no override. That needs an upstream change.

Also on this branch

Two commits trimming comment narration, at the repo owner's request — comments
had grown into changelog (what the code used to do, which report a line
answers, what a previous set of colours measured). Present-tense rationale a
maintainer cannot recover from the code is kept; the history around it is gone.
Eight files so far: WorkspacePalette 338 → 140 comment lines,
WorldsScreenRenderer 599 → 494, ScreenChrome 417 → 337, ScreenModel
279 → 243, Workspace 246 → 176, RailRenderer 175 → 112, plus TabTitles
and UnreadBadge. This is an ongoing sweep — ~26,000 comment lines remain
across the rest of the repo — and more of it will land on this branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_015nuKnWthnELNkrd86q5KWN

Summary by CodeRabbit

  • New Features

    • Added a tabs snapshot view showcasing tab movement across panes.
    • Selected tabs are now visibly bold and distinguishable even in unfocused panes.
    • Unread indicators remain visible alongside selected-tab styling.
    • Added a derived identifier for the demo Scenes window.
  • Documentation

    • Expanded guidance for tab styling, focus cues, workspace restoration, layout, rendering, and screen behavior.
  • Tests

    • Added coverage for tab selection, focus ordering, unread indicators, theme contrast, and stable pane layouts.

HarryCordewener and others added 3 commits August 12, 2026 14:07
PaintTabChips computed an unfocused pane's selected chip and its siblings
from the same expression, background and ink alike, so every chip in a
background pane was painted byte-identically to the pane's own surface
tone. The ▌ was no help: TabTitles only emits it on the focused pane.

A chip now states one fact relative to its own strip — the selected tab is
painted the plane its page is painted on, its siblings are recessed one
BackdropScale step below it. Pane focus is not a parameter; it arrives
folded into PaneSurfaceTone, so the cue is one ratio in every strip, on
every theme, under every tint, and hue stays free to carry identity.

Selection is also emboldened, in every pane, so it survives a terminal
that flattens the chips; it composes with the unread tint into one markup
tag, and costs no cells.

The new `tabs` view is the frame: two tabs in the pane that does not hold
the focus, which no existing view had — and is why no snapshot caught it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015nuKnWthnELNkrd86q5KWN
Comments here had grown into changelog: what the code used to do, which
report a line answers, what a previous set of colours measured. None of
that is recoverable value in pre-release software, and it buried the
rationale that is.

Keeps present-tense why a maintainer could not recover from the code —
the TintDepth bound, the AtLuma direction split, why fields are reserved,
why a route may not reach another session's spawn window — and drops the
history around it. Also fixes a malformed doc block in UnreadBadge that
closed <summary> twice.

WorkspacePalette 338 -> 140 comment lines, RailRenderer 175 -> 112,
Workspace 246 -> 176, TabTitles and UnreadBadge likewise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015nuKnWthnELNkrd86q5KWN
Same pass as the palette cluster, over the settings screens: keeps the
present-tense rule a maintainer needs (why a targeted button is not a
cursor stop, why F5 states its own pane layout, why the password note
names the file it names) and drops the account of which report each line
answers and what the row said before it said this.

ScreenChrome 417 -> 337 comment lines, WorldsScreenRenderer 599 -> 494,
ScreenModel 279 -> 243.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015nuKnWthnELNkrd86q5KWN
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fdc67232-9746-4427-a562-0b76bf47b8af

📥 Commits

Reviewing files that changed from the base of the PR and between 94967fd and d522c7b.

📒 Files selected for processing (13)
  • CLAUDE.md
  • src/SharpMUTerm.Core/Workspace/Workspace.cs
  • src/SharpMUTerm.Tui/DemoScene.cs
  • src/SharpMUTerm.Tui/RailRenderer.cs
  • src/SharpMUTerm.Tui/ScreenChrome.cs
  • src/SharpMUTerm.Tui/ScreenModel.cs
  • src/SharpMUTerm.Tui/SharpMUTermApp.cs
  • src/SharpMUTerm.Tui/TabTitles.cs
  • src/SharpMUTerm.Tui/UnreadBadge.cs
  • src/SharpMUTerm.Tui/WorkspacePalette.cs
  • src/SharpMUTerm.Tui/WorldsScreenRenderer.cs
  • tests/SharpMUTerm.Tui.Tests/TabActivityIndicatorTests.cs
  • tests/SharpMUTerm.Tui.Tests/TabSelectionTests.cs

Walkthrough

The PR adds a tabs snapshot view and separates tab selection styling from pane focus and unread indicators. It also expands XML documentation across workspace and TUI components and adds serialized rendering tests.

Changes

Tab selection and rendering

Layer / File(s) Summary
Tab snapshot and selection rendering
CLAUDE.md, src/SharpMUTerm.Tui/..., tests/SharpMUTerm.Tui.Tests/...
Adds the tabs snapshot, theme-based selected and recessed tab surfaces, selected-title bolding, combined unread styling, and frame-level tests for rendering and geometry stability.
Workspace restoration and routing contract
src/SharpMUTerm.Core/Workspace/Workspace.cs
Documents restoration sequencing, session-scoped window numbering, spawn routing, identifier encoding, ownership reassignment, and unread suppression.
Screen interaction and layout documentation
src/SharpMUTerm.Tui/ScreenChrome.cs, src/SharpMUTerm.Tui/ScreenModel.cs
Clarifies editing, navigation, undo, dropdown, field, button, footer, and responsive layout behavior.
Rail, palette, and world-screen documentation
src/SharpMUTerm.Tui/RailRenderer.cs, src/SharpMUTerm.Tui/WorkspacePalette.cs, src/SharpMUTerm.Tui/WorldsScreenRenderer.cs
Clarifies rail sizing, palette contrast, pane tinting, world-screen forms, security controls, trigger sets, password storage, and login status.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SharpMUTermApp
  participant DemoScene
  participant Workspace
  participant TabTitles
  SharpMUTermApp->>DemoScene: request ScenesWindowId
  DemoScene->>Workspace: create Scenes window identifier
  SharpMUTermApp->>Workspace: split workspace and move tabs
  SharpMUTermApp->>TabTitles: render selected and unread state
  TabTitles-->>SharpMUTermApp: styled tab title
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@HarryCordewener
HarryCordewener merged commit 49d4fed into main Aug 12, 2026
2 of 3 checks passed
@HarryCordewener
HarryCordewener deleted the feat/tab-chip-colours branch August 12, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant