fix: print entire test outcome in inline mode#35
Merged
Conversation
f9eba0c to
9575ff9
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR implements a fix for inline view rendering by introducing a quitting state mechanism that allows the final output to be rendered without viewport truncation. The change addresses an issue where the inline view was not displaying all lines when the program exits.
Key changes:
- Added a
quittingboolean field to track the exit state - Modified quit logic to defer actual quitting until after final render
- Added post-program logic to print the final view output
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/sift/view.go | Added quitting field to siftModel; modified Update() to set quitting state before exit; modified View() to return empty string when quitting; contains a spelling error in comment |
| internal/sift/sift.go | Added logic to reset quitting state and print final view output after program completes |
Comments suppressed due to low confidence (1)
internal/sift/view.go:95
- Corrected comment prefix from 'tt' to '//' (appears to be a typo).
// normalizeSearchQuery removes spaces from the search query since Go replaces
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Currently Bubbletea truncates the viewport based on the terminal window height. Because of this, after the test is completed it can be truncated if it exceeds the terminal window height.
Ref: https://github.com/charmbracelet/bubbletea/blob/main/standard_renderer.go#L186
This is a dirty hack to force the last View() of the model to be empty before quitting. We then do a standard print with the entire View contents before exiting
Mitigates #33