Skip to content

Shade a themed layout borders and all; Shaded.Target for borders or text only (2.22.0) - #69

Merged
HarryCordewener merged 4 commits into
mainfrom
claude/project-thread-nt5efq
Oct 21, 2026
Merged

HarryCordewener merged 4 commits into
mainfrom
claude/project-thread-nt5efq

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Release as 2.22.0 (adds public API). SharpMUSH/SharpMUSH#2129 depends on it.

Fixed

  • Theme colours beat the gradient. A Shaded block laid its gradient outside the content's lines and a LayoutTheme's part colours (border, title, labels, headings, bullets, guides) inside, so they won. A box under a game's theme showed the gradient only in its plain text. That is why gradient(box(Sheet,Mannaz,20),hc|hm,{"flow":"diagonal"}) showed no gradient in SharpMUSH telnet. Inside a shaded block the theme's colours for the shaded parts are now left off. Colour the text sets itself is kept, and so is a stripe (a background).
  • Padding stretched the gradient. A table narrower than its layout width was shaded across the whole width, so across/diagonal reached only the first few colours. The colours now run over what is drawn. In HTML a shaded block that holds nothing full-width (no box, rule, flex row or gauge) is width: fit-content, for the same reason.

Added

  • Shaded.Target (GradientTarget.All / Borders / Text): shade only the box drawing (borders and rules, table column separators and heading rules, tree guides, gauge brackets) or only the text. The other part keeps its own or its theme's colour. Box drawing is told apart by an internal data-markup mark (LinePiece) laid on while drawing and taken off after shading. The codec writes tg. HTML adds ms-shade-borders / ms-shade-text, and the stylesheet clips only that part.

Before / after, xterm-256, a box in a theme with a blue border and yellow title, shaded hc|hm diagonally:

before: \e[34m╔════╡ \e[1;33mMannaz\e[0m\e[34m ╞════╗   (theme colours, no gradient)
after:  \e[38;5;14m╔\e[38;5;123m═══\e[38;5;117m═╡ \e[38;5;153mMannaz ...  (cyan → magenta)

Tests

New CompositionTests: a theme colours none of a shaded box's parts; colour the text sets is kept; across runs over what is drawn (fails before the fix); Borders keeps the title's theme colour and writes no background-image in HTML; Text keeps a table's separator and heading-rule theme colours and leaves no data markup behind; Target survives the wire. Full suite: 1366 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TzLbKjac4jFHdFDJtUMwsu

Summary by CodeRabbit

  • New Features

    • Added gradient targeting options for all content, borders only, or text only.
    • Gradients now correctly cover themed layouts and drawn content without extending into trailing padding.
    • Gradient targets are preserved when layouts are serialized and restored.
    • Explicitly colored text remains unchanged when text shading is applied.
  • Bug Fixes

    • Improved shading behavior across borders, text, themed blocks, gauges, and tables.
    • Prevented unrelated themed areas from being recolored by targeted gradients.

A theme's part colours (border, title, labels, headings, bullets, guides)
were laid inside a Shaded block's gradient and won over it, so a box
drawn in a game's theme showed the gradient only in its plain text.
Inside a Shaded block those part colours are now left off; colour the
text sets itself and a table's stripe are kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzLbKjac4jFHdFDJtUMwsu
@HarryCordewener HarryCordewener self-assigned this Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: a6ba7d2b-689d-4468-8a30-25b757cc6166
📥 Commits

Reviewing files that changed from the base of the PR and between 08e467f and e5023b5.

📒 Files selected for processing: 12
  • CHANGELOG.md
  • MarkupString.Html/Emitters/LayoutHtml.cs
  • MarkupString.Html/LayoutCss.cs
  • MarkupString.Tests/Layout/CompositionTests.cs
  • MarkupString/ColorGradient.cs
  • MarkupString/Layout/Blocks/Block.cs
  • MarkupString/Layout/Blocks/Gauge.cs
  • MarkupString/Layout/Blocks/LayoutJson.cs
  • MarkupString/Layout/Blocks/Modifiers.cs
  • MarkupString/Layout/Blocks/Table.cs
  • MarkupString/MarkupText.cs
  • MarkupString/PublicAPI.Unshipped.txt
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzLbKjac4jFHdFDJtUMwsu
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzLbKjac4jFHdFDJtUMwsu
…umns

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzLbKjac4jFHdFDJtUMwsu
@HarryCordewener HarryCordewener changed the title Shade a themed layout borders and all Shade a themed layout borders and all; Shaded.Target for borders or text only (2.22.0) Oct 21, 2026
@HarryCordewener
HarryCordewener marked this pull request as ready for review October 21, 2026 03:40
@HarryCordewener
HarryCordewener merged commit 3675f03 into main Oct 21, 2026
6 of 7 checks passed
@HarryCordewener
HarryCordewener deleted the claude/project-thread-nt5efq branch October 21, 2026 03:43
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