Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port UI to bubbletea #1385

Merged
merged 9 commits into from
Jul 13, 2023
Merged

Port UI to bubbletea #1385

merged 9 commits into from
Jul 13, 2023

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Jul 12, 2023

This is a follow up to anchore/syft#1888, allowing ingestion of the new syft bubbletea handler as well as porting grype to using bubbletea components as well.

This nudges grype in the right direction for the cmd package layout as well, following the new patterns in quill. In doing so, all current cmd/*.go sources have been moved to cmd/grype/cli/legacy/.

Note: one notable change here is that this enables support for the TUI on windows 🎉

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman changed the title Port to bubbletea UI Port UI to bubbletea Jul 12, 2023
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman requested a review from a team July 12, 2023 18:55
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

I don't see anything blocking, but main question about windows + bubbletea (maybe this is just a drop-in replacement and the idea is to enable TUI on windows in another PR?)

}

// remove all whitespace padding from the end of the report
reports = append(reports, strings.TrimRight(report, "\n ")+"\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be best to just directly output the report, unchanged? Maybe there happen to be some weird whitespace requirements? (I noticed Syft was changed this way, too, and the same comment applies there, probably more applicable to Syft)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes the sender of the report not responsible for how they should look when conjoined with potentially other reports. That is the responsibility of the receiver / UI itself.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
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