Repository navigation
Conversation
…ash commands, a real updater Six read-only root-cause investigations, then a strictly sequential build, then four adversaries. Measured before fixing; every number is enforced by a test. SCROLL. A full 200x50 frame was 1,270,609 bytes of JSON objects with one heap allocation per cell; cells now travel as tuples with packed colours — 310,795 bytes, 31 B/cell — and an unchanged damage scan allocates nothing (was 10,000) in 111 us (was 247). The PTY reader also held the engine lock while serialising each frame, so a scroll queued behind a running command's output; one painter thread now emits outside that lock, coalescing to one repaint per 8 ms. Snap to bottom sends the diff, not the grid. The painter sets font and fill per style run, not per glyph. The status-bar probes moved off the async runtime: four calls against a wedged git took 8.5 s, serial. STARTUP. No native window background, and CSS injected only after 1.1 MB of wasm compiled — so the canvas was measured at the browser-default 300x150 and the shell was SPAWNED at about 35x8, then reflowed. The native window is now painted in the saved theme before the webview exists, the CSS is inline, and the canvas is measured at its real size first. The cursor was a hardcoded Tokyo Night grey in every theme; the engine computed the right colour and never sent it. A test forbids hardcoded theme colours outside the two theme tables. TRANSPARENCY. Opacity 40-100, default 100. Default-background cells clear; every other background and all glyphs stay opaque. All chrome and the approval bar stay fully opaque at every setting — a security control must never be hard to read — enforced by a test. UPDATER. /update claimed "latest version" when the check had failed. Install is single-flight. A background check that never downloads, a status-bar indicator, a real percentage, failure text that says what to do, skip-this-version. Notes and version come from an unsigned manifest and are sanitised and capped. The check left the IPC surface; the backend emits an event. SLASH. Eight disagreements between the parsers, /help, the completer and the README, fixed — and a test in each crate now parses the OTHER crate's source, so they cannot drift silently. FOUND BY THE ADVERSARIES IN THIS RELEASE'S OWN WORK: emitting outside the engine lock removed the only thing ordering frames, so a resize racing a coalesced frame could deliver them out of diff order — including the frame that paints an approval proposal. An ordering lock, taken before the engine lock and held across the emit, restores the total order without putting the reader back behind serialisation. 153 -> 177 backend tests, 37 -> 49 frontend.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoImprove terminal performance, startup theming, and update workflows
AI Description
Diagram
High-Level Assessment
Files changed (30)
|
Code Review by Qodo
1. Security guide hides update access
|
| - *No updater command exists on the IPC surface at all.* `generate_handler!` names nothing from | ||
| `update.rs`; the background check is a Rust task that does an HTTPS GET and a version compare |
There was a problem hiding this comment.
1. Security guide hides update access 🐞 Bug ⚙ Maintainability
docs/danger-gate.md says no updater command exists on the IPC surface even though the registered run_slash command routes /update to update::slash. The mismatch hides a webview-reachable network operation from maintainers auditing the documented trust boundary, although installation remains native-menu-only.
Agent Prompt
## Issue description
The danger-gate documentation incorrectly states that no updater command exists on the IPC surface. The generic `run_slash` IPC command still exposes `/update` checking through `update::slash`, while only installation is excluded from IPC.
## Fix Focus Areas
- docs/danger-gate.md[75-79]
- src-tauri/src/lib.rs[2195-2205]
- src-tauri/src/lib.rs[2683-2721]
- src-tauri/src/update.rs[154-168]
## Recommended Fix
Clarify that there is no dedicated updater handler and no IPC-accessible installation path, but that webview code can invoke an update check indirectly through the registered `run_slash` command. Retain the explanation that `/update install` is rejected and installation requires a native menu event.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if bg == self.bg { | ||
| self.ctx.clear_rect(x, y, ex + ew - x, h); | ||
| } else { | ||
| self.ctx.set_fill_style_str(&css(bg)); | ||
| self.ctx.fill_rect(x, y, ex + ew - x, h); | ||
| } |
There was a problem hiding this comment.
2. Explicit black backgrounds turn transparent 🐞 Bug ≡ Correctness
Term::draw_line clears every cell whose resolved background RGB equals self.bg, because the wire contract loses whether the colour came from the terminal default or an explicitly selected ANSI/RGB background. When transparency is enabled under the Matrix theme, where both the default background and ANSI black are [0, 0, 0], programs that explicitly request an opaque black background instead render those cell areas see-through at reduced window opacity.
Agent Prompt
## Issue description
The renderer cannot distinguish the default terminal background from an explicitly selected ANSI or RGB colour after both are resolved to RGB. As a result, `draw_line` clears explicit backgrounds that match the theme background, making cells transparent when they should remain opaque.
## Fix Focus Areas
- src-tauri/src/engine.rs[27-58]
- src-tauri/src/engine.rs[264-283]
- src-tauri/src/engine.rs[307-348]
- ui/src/terminal.rs[27-52]
- ui/src/terminal.rs[305-331]
- ui/src/terminal.rs[326-330]
## Recommended Fix
Add a background-origin flag to the cell wire contract that records whether the effective painted background is the terminal default, including when inverse video affects the effective background. Update the Rust serializer and frontend deserializer to carry this flag, then make `draw_line` call `clear_rect` only for default-background cells and use `fill_rect` for every explicitly selected ANSI or RGB background, even when its resolved RGB value equals the theme background. Update the related serializer, deserializer, and rendering tests together.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Investigated first (six read-only root-cause probes), built one unit at a time, then attacked by four adversaries. Every number below was measured before the fix and is enforced by a test.
177 backend tests (was 153) · 49 frontend (was 37) · zero warnings.
Scroll lag — two measured causes
The PTY reader also held the engine lock while serialising each frame, so scrolling queued behind a running command's output. Frames are now emitted outside the lock by one coalescing painter thread.
Startup
The window had no native background and CSS loaded only after 1.1 MB of wasm, so the canvas was measured at the browser default 300x150 and the shell spawned at ~35x8, then reflowed. The cursor was a hardcoded Tokyo Night grey in every theme — the engine computed a per-theme colour and never sent it.
Added
Window transparency (40–100%, default 100%) with all chrome and the approval bar fully opaque at every setting, enforced by a test. Updater: background check that never downloads, status-bar indicator, real progress, actionable failures, skip-this-version; the check is gone from the IPC surface.
What the adversaries found in this release's own work
Emitting frames outside the engine lock removed the only thing ordering them, so a resize racing a coalesced frame could deliver frames out of diff order — including the frame that paints an approval proposal. Fixed with an ordering lock before merge. They also found the manifest
versionreaching the status bar unsanitised.Not verified
Nothing here has been seen running in the app; the GUI cannot be driven reliably on the build machine. Linux is verified by CI only.