Skip to content

Conversation

@timtatt
Copy link
Owner

@timtatt timtatt commented Nov 2, 2025

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

@timtatt timtatt requested a review from Copilot November 2, 2025 10:50
Copy link

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 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 quitting boolean 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.

@timtatt timtatt merged commit debd84e into main Nov 2, 2025
1 check passed
@timtatt timtatt deleted the fix/inline-mode branch November 2, 2025 10:52
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.

1 participant