chore(fmt): prettier --write pass#21
Conversation
Eight files drifted from prettier formatting and bun run fmt was failing on main. The changes are purely cosmetic — collapsing/expanding lines around prettier's width limit and dropping redundant parens. No behavior changes. Unblocks the fmt check on main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request primarily consists of code formatting and style adjustments across multiple files, such as consolidating multi-line statements and refining whitespace. Review feedback highlights potential logic issues in lib/renderer.ts where the useThemeBg and useThemeFg calculations for inverted cells may not correctly handle default theme colors, potentially leading to incorrect background and text rendering.
| // explicit color (programs emit it for "true black" backgrounds, e.g. | ||
| // letterboxed image renderings). | ||
| const useThemeBg = (cell.flags & CellFlags.INVERSE) ? cell.fgIsDefault : cell.bgIsDefault; | ||
| const useThemeBg = cell.flags & CellFlags.INVERSE ? cell.fgIsDefault : cell.bgIsDefault; |
There was a problem hiding this comment.
The logic for determining useThemeBg when CellFlags.INVERSE is set appears to be incorrect for cells using default colors. If INVERSE is set and cell.fgIsDefault is true, useThemeBg becomes true, which causes the cell to skip painting its background (leaving it as the default theme.background). However, an inverted cell with a default foreground should have its background painted with theme.foreground to reflect the inversion.
| // when the cell has the default fg (tag NONE), not when its explicit | ||
| // RGB happens to be (0,0,0). | ||
| const useThemeFg = (cell.flags & CellFlags.INVERSE) ? cell.bgIsDefault : cell.fgIsDefault; | ||
| const useThemeFg = cell.flags & CellFlags.INVERSE ? cell.bgIsDefault : cell.fgIsDefault; |
There was a problem hiding this comment.
Similarly, the logic for useThemeFg when CellFlags.INVERSE is set seems to result in incorrect text coloring for default colors. If INVERSE is set and cell.bgIsDefault is true, useThemeFg becomes true, causing the text to be painted with theme.foreground. This matches the non-inverted case, meaning the text color does not change when it should likely use theme.background to properly represent the inverted state.
Eight files drifted from prettier formatting and bun run fmt was failing on main. The changes are purely cosmetic — collapsing/expanding lines around prettier's width limit and dropping redundant parens. No behavior changes.
Unblocks the fmt check on main.