Skip to content

Add surface primitives: frames, fills and layout - #221

Open
raiseCatError wants to merge 1 commit into
feature/171-chromafrom
feature/165-surfaces
Open

raiseCatError wants to merge 1 commit into
feature/171-chromafrom
feature/165-surfaces

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Implements #165.

Stacked on #220 (feature/171-chroma), on #219, #218, #217 and #203. Merge order: #203, #217, #218, #219, #220, then this PR.

What changed

  • src/ui/surface.ts: renderSurface(rows, columns, spec) places rows in a surface. The spec has:
    • frame: none, top line, square, rounded, double or heavy;
    • frame color and fill, each either a Chroma color or a left-to-right gradient;
    • padding, inset, width (fill or content) and alignment.
  • Frame and fill are independent. No frame with a fill, a frame with no fill, both, and a gradient fill are all covered by tests.
  • Surfaces only hold Chroma color references. Color resolution and capability fallback (truecolor, 256, none) stay in Chroma.
  • Fills stay behind styled content: the background is re-applied per glyph, so resets inside a row do not punch holes.
  • Safe glyph mode draws ASCII frames.
  • Narrow widths degrade padding first, then boxed frames fall back to a top line. Rows never exceed columns. With no color, geometry is kept and fills and frame colors disappear.

Consumer

  • framePanel in PanelShell is now a top-line surface using the theme separator color, so every existing panel (Settings, palette, layout, syntax, transcript, providers) goes through it. Output is unchanged; tests assert that.
  • The other frame and fill styles are available but no panel uses them yet. That is intentional: this PR does not redesign panels.

Verification

tests/surface.test.ts; full suite 649/649, typecheck, build and git diff --check clean.

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