Bump up promkit-widget version to v0.5.0 - #109
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the promkit-widgets dependency and introduces a new --write-to-stdout feature for jnv. The widget API migration replaces Pane/PaneFactory with StyledGraphemes/Widget, and text::State with status::State/Severity for cleaner status message creation. The --write-to-stdout flag allows piping the current JSON result to stdout on exit, with stdout redirection to /dev/tty during TUI rendering on Unix.
Changes:
- Migrates from
Pane/PaneFactory/text::StateAPIs toStyledGraphemes/Widget/status::StateAPIs across all widget usage, and replaces the custom spinner implementation with the library's built-inspinnermodule. - Adds
--write-to-stdoutCLI flag withStdoutRedirectto save/restore stdout fd, enabling piped output while keeping TUI rendering on the terminal (Unix only). - Updates dependency versions (
clap,tokio,promkit-widgets) and addsrustixfor fd manipulation.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates deps, adds rustix, changes promkit-widgets to local path (needs fix) |
| Cargo.lock | Reflects dependency version updates |
| README.md | Documents --write-to-stdout usage examples |
| src/stdout_redirect.rs | New module for Unix stdout fd redirection during TUI |
| src/main.rs | Integrates --write-to-stdout flag and StdoutRedirect |
| src/prompt.rs | Returns Option<String> for stdout output; migrates to new widget APIs |
| src/processor.rs | Migrates Pane → StyledGraphemes in trait and helpers |
| src/processor/monitor.rs | Implements spinner::State trait for ContextMonitor |
| src/processor/spinner.rs | Deleted custom spinner in favor of library's spinner module |
| src/editor.rs | Migrates text::State → status::State for guide messages |
| src/search.rs | Migrates Pane → StyledGraphemes return type |
| src/json.rs | Migrates to status::State/StyledGraphemes for panes and messages |
💡 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
+33
to
+34
| # version = "0.3.0" | ||
| path = "../promkit/promkit-widgets" |
| # or write current result to stdout on exit (UNIX only) | ||
| cat data.json | jnv --write-to-stdout | some-command | ||
| # and also output to file | ||
| cat data.json | jnv -- --write-to-stdout > result.json |
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.
No description provided.