Allow reading from a Read/Write pair (where possible)#123
Open
grunweg wants to merge 4 commits intoconsole-rs:mainfrom
Open
Allow reading from a Read/Write pair (where possible)#123grunweg wants to merge 4 commits intoconsole-rs:mainfrom
grunweg wants to merge 4 commits intoconsole-rs:mainfrom
Conversation
Contributor
Author
|
To clarify what this does and does not do:
|
benesch
pushed a commit
to benesch/console
that referenced
this pull request
Dec 4, 2022
…s#123) The current method of displaying warnings is as list of all individual tasks with warnings on the task list screen. As discussed in the comments on PR console-rs#113, this may not be the ideal approach when there are a very large number of tasks with warnings. This branch changes this behavior so that the details of a particular warning for a given task is shown only on the task details screen. On the task list screen, we instead list the different _categories_ of warnings that were detected, along with the number of tasks with that warning. This means that when a large number of tasks have warnings, we will only use a number of lines equal to the number of different categories of warning that were detected, rather than the number of individual tasks that have that warning. Each individual task that has warnings shows a warning icon and count in a new column in the task list table. This makes it easy for the user to find the tasks that have warnings and get details on them, including sorting by the number of warnings. Implementing this required some refactoring of how warnings are implemented. This includes: * Changing the `Warn` trait to have separate methods for detecting a warning, formatting the warning for an individual task instance, and summarizing the warning for the list of detected warning types * Introducing a new `Linter` struct that wraps a `dyn Warning` in an `Rc` and clones it into tasks that have lints. This allows the task details screen to determine how to format the lint when it is needed. It also allows tracking the total number of tasks that have a given warning, by using the `Rc`'s reference count. ## Screenshots To demonstrate how this design saves screen real estate when there are many tasks with warnings, I modified the `burn` example to spawn several burn tasks rather than just one. Before, we spent several lines on warnings (one for each task):  After, we only need one line:  The detailed warning text for the individual tasks are displayed on the task details view:  And, it still looks okay in ASCII-only mode:   Signed-off-by: Eliza Weisman <eliza@buoyant.io>
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.
Attempt at fixing #108: make read_line on a Read/Write pair go through Read.
Along with some documentation edits as I was in the area. Feel free to accept or decline those!