Skip to content

✨ Add border-cell backgrounds#94

Open
rauhryan wants to merge 5 commits into
mainfrom
issue-68-border-bg
Open

✨ Add border-cell backgrounds#94
rauhryan wants to merge 5 commits into
mainfrom
issue-68-border-bg

Conversation

@rauhryan

@rauhryan rauhryan commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

✨ Add border-cell backgrounds

Closes #68

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/clayterm@94

commit: ad2cdc7

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Size Increased — +0.4 KB

108.2 KB unpacked

@rauhryan rauhryan marked this pull request as ready for review June 9, 2026 15:16

@dreyfus92 dreyfus92 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.

awesome job @rauhryan, left 2 nits not blockers btw. ✌🏻

Comment thread test/color.test.ts
let beforeCorner = ansi.slice(0, corner);
expect(beforeCorner).toContain(bg.sgr);
});

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.

i'm here thinking if we should tighten this test a bit more, from what i'm reading this is asserting the bg SGR appears somewhere in the slice(0, corner), which can pass for the wrong reason, the SGR could've been emitted earlier in the stream for something unrelated. better to assert the SGR appears immediately preceding the and ideally check an edge and a second corner too, since the spec explicitly promises corners, horizontal & vertical edges. this is not a blocker btw just a future ref in case we hit a loose bug somewhere.

Comment thread src/clayterm.c
Clay_BorderRenderData *b = &cmd->renderData.border;
uint32_t fg = color(b->color);
uint32_t bg = ATTR_DEFAULT;
uint32_t bg = (uint32_t)(uintptr_t)cmd->userData;

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.

we should leave a comment on top of this, something like "userData is currently exclusively the border-bg word"

@dreyfus92 dreyfus92 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.

lgtm, thank you ryan. woops there are some conflicts that still need some attention 😄

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.

💡 Border background color

2 participants