Skip to content

v0.12.0#73

Merged
ynqa merged 89 commits intomainfrom
v0.12.0/dev
Mar 15, 2026
Merged

v0.12.0#73
ynqa merged 89 commits intomainfrom
v0.12.0/dev

Conversation

@ynqa
Copy link
Owner

@ynqa ynqa commented Mar 1, 2026

No description provided.

@ynqa ynqa marked this pull request as ready for review March 15, 2026 04:33
Copilot AI review requested due to automatic review settings March 15, 2026 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the v0.12.0 release by refactoring the rendering pipeline from “panes” to keyed StyledGraphemes, and by introducing a terminal harness plus zsh parity scenarios/tests to validate wrap/scroll/resize behavior.

Changes:

  • Replace Pane/PaneFactory with StyledGraphemes/Widget, and update presets/widgets/core renderer accordingly.
  • Add termharness, zsherio, and zsh-render-parity crates to drive scenario-based parity testing against real zsh.
  • Update workspace membership/dependencies, docs, examples, CI, and VHS tapes/scripts for the new structure.

Reviewed changes

Copilot reviewed 63 out of 64 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
Cargo.toml Adds new workspace members and workspace deps (e.g. portable-pty, thiserror).
.github/workflows/ci.yml Installs zsh on CI before running tests.
.gitignore Ignores zsh parity test artifacts output directory.
README.md Updates version to 0.12.0 and refreshes docs/commands/links.
Concept.md Rewrites architecture docs to match the new grapheme-based rendering model and new test tooling.
scripts/render_tapes_gif.sh Adds a helper script to render all .tape files via vhs.
tapes/tree.tape Updates demo command to run a binary instead of an example.
tapes/readline.tape Updates demo command to run a binary instead of an example.
tapes/query_selector.tape Updates demo command to run a binary instead of an example.
tapes/password.tape Updates demo command to run a binary instead of an example.
tapes/listbox.tape Updates demo command to run a binary instead of an example.
tapes/json.tape Updates demo command/args for the JSON binary.
tapes/form.tape Updates demo command to run a binary instead of an example.
tapes/confirm.tape Updates demo command to run a binary instead of an example.
tapes/checkbox.tape Updates demo command to run a binary instead of an example.
tapes/text.tape Adds a new VHS tape for the text binary.
promkit/Cargo.toml Bumps promkit to 0.12.0, updates feature wiring, and bumps promkit-widgets dependency to 0.4.0.
promkit/src/lib.rs Modifies the core event loop (notably around resize events).
promkit/src/preset/tree.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/text.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/readline.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/query_selector.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/listbox.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/json.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/form.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit/src/preset/checkbox.rs Migrates preset rendering from panes to StyledGraphemes via Widget.
promkit-core/Cargo.toml Bumps promkit-core to 0.3.0.
promkit-core/src/lib.rs Replaces PaneFactory with the new Widget trait API.
promkit-core/src/render.rs Refactors renderer storage/update to keyed StyledGraphemes and renames constructor to try_new_with_graphemes.
promkit-core/src/terminal.rs Refactors drawing logic to wrap/draw StyledGraphemes rows instead of panes.
promkit-core/src/grapheme.rs Adds from_lines and wrapped_lines; removes Deref in favor of explicit methods; updates tests.
promkit-core/src/pane.rs Removes the old Pane abstraction entirely.
promkit-widgets/Cargo.toml Bumps promkit-widgets to 0.4.0 and changes default features behavior.
promkit-widgets/src/tree.rs Migrates tree widget from PaneFactory to Widget and returns StyledGraphemes.
promkit-widgets/src/text.rs Migrates text widget from PaneFactory to Widget and returns StyledGraphemes.
promkit-widgets/src/listbox.rs Migrates listbox widget from PaneFactory to Widget and returns StyledGraphemes.
promkit-widgets/src/checkbox.rs Migrates checkbox widget from PaneFactory to Widget and returns StyledGraphemes.
promkit-widgets/src/jsonstream.rs Migrates jsonstream widget from PaneFactory to Widget and returns StyledGraphemes.
promkit-widgets/src/text_editor.rs Migrates text editor widget from PaneFactory to Widget and updates wrapping/slicing logic.
promkit-widgets/src/spinner.rs Updates spinner rendering to update renderer with StyledGraphemes instead of Pane.
termharness/Cargo.toml Adds a new crate for PTY + alacritty-terminal based session/screen simulation.
termharness/src/lib.rs Exposes session and terminal modules.
termharness/src/terminal.rs Introduces TerminalSize type used by the harness.
termharness/src/session.rs Implements PTY-backed session with screen parsing, DSR handling, resizing, and tests.
zsherio/Cargo.toml Adds a new crate for zsh scenario definitions and helpers.
zsherio/src/lib.rs Exposes scenario/session/opts modules and re-exports scenario types.
zsherio/src/session.rs Adds helpers to spawn a generic session or a zsh session.
zsherio/src/opts.rs Adds helpers to write bytes and send cursor/screen control sequences.
zsherio/src/scenario.rs Adds a scenario runner + formatted screen snapshot recording and tests.
zsherio/src/scenarios.rs Adds concrete scenarios used for parity testing (wrap/scroll/resize/etc.).
zsherio/examples/zsh_middle_insert_wrap.rs Adds an example program to run a scenario against real zsh and print snapshots.
zsh-render-parity/Cargo.toml Adds a new crate with a zsh-pretend binary and integration tests comparing to real zsh.
zsh-render-parity/src/main.rs Implements a zsh-pretend loop using promkit Readline.
zsh-render-parity/tests/common/mod.rs Adds shared helpers to wait for prompt, compare runs, and write artifacts.
zsh-render-parity/tests/mid_buffer_insert_wrap.rs Adds parity test for mid-buffer insert wrap behavior.
zsh-render-parity/tests/prompt_initial_render_at_mid_screen.rs Adds parity test for initial prompt render mid-screen.
zsh-render-parity/tests/resize_roundtrip_wrap_reflow.rs Adds (ignored) parity test for aggressive resize wrap/reflow.
zsh-render-parity/tests/tiny_viewport_overflow_wrap_scroll.rs Adds parity test for tiny-viewport overflow wrap/scroll behavior.
examples/byop/Cargo.toml Enables required promkit features (readline, spinner) after feature refactor.
examples/byop/src/byop.rs Updates BYOP example to new Widget/StyledGraphemes renderer API.
examples/tree/src/tree.rs Updates tree example root path selection.
examples/json/src/json.rs Simplifies JSON example by removing CLI title arg and hardcoding a title.
event-dbg/src/main.rs Removes the old event-dbg tool.
event-dbg/README.md Removes the old event-dbg README.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +24 to 25
if height < viewable_rows.len() as u16 {
return Err(anyhow::anyhow!("Insufficient space to display all panes"));
// NOTE: For zsh_pretend/tests/resize_roundtrip_wrap_reflow.rs, skipping
// resize events here
// keeps output closer to zsh than evaluating resize as a normal input event.
if event.is_resize() {
Comment on lines +17 to +22
#[test]
fn zsh_pretend_parity_mid_buffer_insert_wrap() -> anyhow::Result<()> {
let expected = run_zsh()?;
let actual = run_zsh_pretend()?;

write_scenario_run_artifact(&expected)?;
Comment on lines +16 to +19
#[test]
fn zsh_pretend_parity_prompt_initial_render_at_mid_screen() -> anyhow::Result<()> {
let expected = run_zsh()?;
let actual = run_zsh_pretend()?;
Comment on lines +17 to +22
#[test]
fn zsh_pretend_parity_tiny_viewport_overflow_wrap_scroll() -> anyhow::Result<()> {
let expected = run_zsh()?;
let actual = run_zsh_pretend()?;

write_scenario_run_artifact(&expected)?;
Comment on lines +38 to +43
for (pane_index, rows) in viewable_rows.iter().enumerate() {
let max_rows = 1
.max((height as usize).saturating_sub(used + viewable_rows.len() - 1 - pane_index));
let rows = rows.iter().take(max_rows).collect::<Vec<_>>();
let row_count = rows.len();
used += row_count;

```bash
cargo run --manifest-path examples/query_selector/Cargo.toml
cargo run --bin query_selector
Comment on lines +18 to +20
let mut cmd = CommandBuilder::new("/bin/zsh");
cmd.arg("-fi");
cmd.env("PS1", "❯❯ ");
Comment on lines +17 to +23
#[test]
#[ignore = "timing-sensitive and currently unsupported: matching zsh under aggressive \
resize-wrap is too hard right now; run manually with `cargo test --release --test \
resize_roundtrip_wrap_reflow`"]
fn zsh_pretend_parity_resize_roundtrip_wrap_reflow() -> anyhow::Result<()> {
let expected = run_zsh()?;
let actual = run_zsh_pretend()?;
@ynqa ynqa merged commit 5681cd6 into main Mar 15, 2026
5 checks passed
@ynqa ynqa deleted the v0.12.0/dev branch March 15, 2026 09:32
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.

2 participants