chore(deps): upgrade OpenTUI to 0.4.2#513
Conversation
Bumps the github-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [taiki-e/install-action](https://github.com/taiki-e/install-action) and [suzuki-shunsuke/pinact-action](https://github.com/suzuki-shunsuke/pinact-action). Updates `actions/checkout` from 6.0.2 to 7.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@de0fac2...9c091bb) Updates `taiki-e/install-action` from 2.79.2 to 2.82.0 - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@213ccc1...b8cecb8) Updates `suzuki-shunsuke/pinact-action` from 2.0.0 to 3.0.0 - [Release notes](https://github.com/suzuki-shunsuke/pinact-action/releases) - [Commits](suzuki-shunsuke/pinact-action@cf51507...896d595) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: taiki-e/install-action dependency-version: 2.82.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: suzuki-shunsuke/pinact-action dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryThis PR upgrades
Confidence Score: 4/5Safe to merge — the runtime change is a single config addition and the dependency upgrade sheds many heavy transitive packages with no breaking surface in the application code. The only substantive concern is the
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["capturedTestColorToHex(color)"] --> B{"buffer exists?"}
B -- No --> C["return null"]
B -- Yes --> D["componentToHex(value)"]
D --> E{"value > 1?"}
E -- Yes\nbyte-scale --> F["use value as-is"]
E -- No\nnormalized --> G["value × 255"]
F --> H["clamp to 0–255, round"]
G --> H
H --> I["toString(16).padStart(2)"]
I --> J["return #rrggbb string"]
subgraph "src/main.tsx – renderer startup"
K["createCliRenderer()"] --> L["screenMode: alternate-screen"]
L --> M["Uses terminal alternate buffer"]
M --> N["Primary screen restored on exit"]
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["capturedTestColorToHex(color)"] --> B{"buffer exists?"}
B -- No --> C["return null"]
B -- Yes --> D["componentToHex(value)"]
D --> E{"value > 1?"}
E -- Yes\nbyte-scale --> F["use value as-is"]
E -- No\nnormalized --> G["value × 255"]
F --> H["clamp to 0–255, round"]
G --> H
H --> I["toString(16).padStart(2)"]
I --> J["return #rrggbb string"]
subgraph "src/main.tsx – renderer startup"
K["createCliRenderer()"] --> L["screenMode: alternate-screen"]
L --> M["Uses terminal alternate buffer"]
M --> N["Primary screen restored on exit"]
end
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
test/helpers/test-color-helpers.ts:8-11
The `value > 1` threshold misclassifies a byte-scale channel value of exactly `1` as normalized, scaling it to `255` instead of keeping it as `1`. Any theme color with a channel component of `0x01` (e.g. `#010000`) would produce a wrong hex string. A threshold of `> 1.0` (or equivalently checking `Number.isInteger`) is more robust — since OpenTUI now returns integer byte values, checking for an integer cleanly disambiguates the two formats.
```suggestion
const componentToHex = (value: number) =>
Math.max(0, Math.min(255, Math.round(Number.isInteger(value) ? value : value * 255)))
.toString(16)
.padStart(2, "0");
```
Reviews (1): Last reviewed commit: "chore(deps): upgrade opentui to 0.4.2" | Re-trigger Greptile |
| const componentToHex = (value: number) => | ||
| Math.max(0, Math.min(255, Math.round(value * 255))) | ||
| Math.max(0, Math.min(255, Math.round(value > 1 ? value : value * 255))) | ||
| .toString(16) | ||
| .padStart(2, "0"); |
There was a problem hiding this comment.
The
value > 1 threshold misclassifies a byte-scale channel value of exactly 1 as normalized, scaling it to 255 instead of keeping it as 1. Any theme color with a channel component of 0x01 (e.g. #010000) would produce a wrong hex string. A threshold of > 1.0 (or equivalently checking Number.isInteger) is more robust — since OpenTUI now returns integer byte values, checking for an integer cleanly disambiguates the two formats.
| const componentToHex = (value: number) => | |
| Math.max(0, Math.min(255, Math.round(value * 255))) | |
| Math.max(0, Math.min(255, Math.round(value > 1 ? value : value * 255))) | |
| .toString(16) | |
| .padStart(2, "0"); | |
| const componentToHex = (value: number) => | |
| Math.max(0, Math.min(255, Math.round(Number.isInteger(value) ? value : value * 255))) | |
| .toString(16) | |
| .padStart(2, "0"); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/helpers/test-color-helpers.ts
Line: 8-11
Comment:
The `value > 1` threshold misclassifies a byte-scale channel value of exactly `1` as normalized, scaling it to `255` instead of keeping it as `1`. Any theme color with a channel component of `0x01` (e.g. `#010000`) would produce a wrong hex string. A threshold of `> 1.0` (or equivalently checking `Number.isInteger`) is more robust — since OpenTUI now returns integer byte values, checking for an integer cleanly disambiguates the two formats.
```suggestion
const componentToHex = (value: number) =>
Math.max(0, Math.min(255, Math.round(Number.isInteger(value) ? value : value * 255)))
.toString(16)
.padStart(2, "0");
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
@opentui/coreand@opentui/reactto 0.4.2screenMode: "alternate-screen"Validation
bun run typecheckbun test ./src ./packages ./scripts ./test/cli ./test/sessionbun run test:integrationbun run test:tty-smokebun run lintThis PR description was generated by Pi using OpenAI GPT-5