Use half pixels and inverse color by default for thin border + ghostty workaround for ♥ vs ❤#112
Merged
Use half pixels and inverse color by default for thin border + ghostty workaround for ♥ vs ❤#112
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the blackjack game’s border styling and fixes a suit rendering issue by introducing a global Heart variable and new border-related flags while also improving the half pixel drawing behavior via ansipixels.
- Updated tests and game logic to use a global Heart variable instead of the hard-coded "♥".
- Introduced new border customization flags (--no-border, --wide) and additional border color/background settings.
- Modified ansipixels drawing routines to leverage half pixels and inverse colors for improved visual appearance.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| blackjack/blackjack_test.go | Tests updated to use the global Heart variable for suit representation instead of literals. |
| blackjack/blackjack.go | Added new border customization fields/flags and workaround for the ♥ vs ❤ issue. |
| blackjack/README.md | Updated usage instructions to reflect the new version and additional border flags. |
| ansipixels/codes.go | Introduced an Inverse constant for inverse colors in drawing operations. |
| ansipixels/ansipixels.go | Revised drawing functions to support half pixel rendering and updated box border patterns. |
Comments suppressed due to low confidence (4)
blackjack/blackjack.go:382
- [nitpick] The green flag’s description was updated to mention replacing black borders; verify that the description accurately reflects the new behavior.
greenFlag := flag.Bool("green", false, "Use green instead of black around the cards")
blackjack/blackjack.go:386
- Reassigning the global Heart variable based on the TERM environment may produce unexpected side effects in different contexts; consider isolating this behavior or using dependency injection to avoid potential test or concurrency issues.
if os.Getenv("TERM") == "xterm-ghostty" {
ansipixels/ansipixels.go:392
- Verify that replacing the original SquareBottomRight with 'Horizontal' for the bottom border in DrawSquareBox is intentional for the new design.
ap.DrawBox(x, y, w, h, SquareTopLeft, Horizontal, SquareTopRight, Vertical, SquareBottomLeft, Horizontal, SquareBottomRight, false)
ansipixels/ansipixels.go:396
- Ensure that updating the bottom border in DrawRoundBox to use 'Horizontal' instead of RoundBottomRight aligns with the intended visual changes.
ap.DrawBox(x, y, w, h, RoundTopLeft, Horizontal, RoundTopRight, Vertical, RoundBottomLeft, Horizontal, RoundBottomRight, false)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.