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

🎁 Terminal UI basic implementation #139

Merged
merged 4 commits into from Mar 7, 2024

Conversation

cardil
Copy link
Contributor

@cardil cardil commented Jan 10, 2024

Changes

  • 🎁 Terminal UI basic implementation

/kind enhancement

Refers to https://docs.google.com/document/d/15ZY2djwpALUXb-sRag3OksN42NR8zYTSPOggdGawzPY

Copy link

knative-prow bot commented Jan 10, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added kind/enhancement do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 10, 2024
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2024
@knative-prow knative-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 10, 2024
@cardil cardil force-pushed the feature/tui-codeimport branch 2 times, most recently from 576329d to 1caa1cc Compare January 31, 2024 12:00
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2024
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: Patch coverage is 47.35883% with 289 lines in your changes are missing coverage. Please review.

Project coverage is 57.55%. Comparing base (ae3b852) to head (21c6ccc).

Files Patch % Lines
pkg/output/tui/progress.go 0.00% 166 Missing ⚠️
pkg/output/logging/context.go 81.18% 15 Missing and 4 partials ⚠️
pkg/output/tui/choose.go 0.00% 15 Missing ⚠️
pkg/context/wrapper.go 0.00% 14 Missing ⚠️
pkg/output/logging/zap.go 0.00% 12 Missing ⚠️
pkg/output/printer.go 0.00% 12 Missing ⚠️
pkg/config/dir/local.go 70.96% 6 Missing and 3 partials ⚠️
pkg/output/logging/logfile.go 80.00% 4 Missing and 3 partials ⚠️
pkg/output/testing.go 79.31% 4 Missing and 2 partials ⚠️
pkg/output/tui/print.go 0.00% 6 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
- Coverage   58.26%   57.55%   -0.72%     
==========================================
  Files          94      113      +19     
  Lines        7833     8382     +549     
==========================================
+ Hits         4564     4824     +260     
- Misses       3027     3297     +270     
- Partials      242      261      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cardil cardil changed the title [WIP] 🎁 Terminal UI basic implementation 🎁 Terminal UI basic implementation Jan 31, 2024
@cardil cardil marked this pull request as ready for review January 31, 2024 18:00
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2024
@knative-prow knative-prow bot requested a review from ReToCode January 31, 2024 18:01
@cardil
Copy link
Contributor Author

cardil commented Feb 5, 2024

/cc @dsimansk
/cc @lkingland
/cc @matejvasek
/cc @matzew

Can I get a review, please?

@cardil cardil force-pushed the feature/tui-codeimport branch 6 times, most recently from fe80693 to bde83a5 Compare February 7, 2024 10:09
@cardil
Copy link
Contributor Author

cardil commented Feb 7, 2024

Here's a usage in the ghet project: cardil/ghet@046f9b4

Copy link
Contributor

@dsimansk dsimansk left a comment

Choose a reason for hiding this comment

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

A few nits, around imports and used libs. One more significant wrt/ config logic and existing solution in other package.

In general the PR looks like a good start to start with Terminal UI. I have no strong opinions on widget interfaces. Let's polish those as suitable for implementation needs.

Out of curiosity, why is it called Terminal UI? Is it sort of de-facto standard for interactive CLIs? 🤔

pkg/config/dir/local.go Show resolved Hide resolved
go.mod Show resolved Hide resolved
pkg/config/dir/local.go Show resolved Hide resolved
pkg/output/term/env.go Outdated Show resolved Hide resolved
pkg/output/logging/context.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@cardil
Copy link
Contributor Author

cardil commented Feb 8, 2024

@dsimansk Out of curiosity, why is it called Terminal UI? Is it sort of de-facto standard for interactive CLIs? 🤔

Well, it's a UI of the terminal. Some people call it DUX (Developer UX), but that's a more broad term. I also heard CLI UX, but just once. Naming is hard...

Comment on lines +1 to +4
//go:build !race

// TODO: there is a race condition in the progress code that needs to be fixed
// somehow
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dsimansk This is ugly.

There's a race condition, but I think it's in the bubblegum library itself, rather than my code.

Maybe we should investigate that, and at least open an issue on bubblegum project?!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine to keep it here for now. Given we either capture it in issue here at least or preferably on bubblegum lib with further details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try doing a reproducer versus the github.com/charmbracelet/bubbles/progress.

@dsimansk
Copy link
Contributor

@cardil circling back to the topic, was there any update on the changes
?

@cardil
Copy link
Contributor Author

cardil commented Feb 21, 2024

@cardil circling back to the topic, was there any update on the changes ?

Not yet. In fact, today, I'm going back to this PR.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2024
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2024
@dsimansk
Copy link
Contributor

dsimansk commented Mar 7, 2024

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 7, 2024
Copy link

knative-prow bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cardil, dsimansk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2024
@dsimansk
Copy link
Contributor

dsimansk commented Mar 7, 2024

As an initial impl that's suitable. We will refine it over time once put into use in other part of project.

@cardil thanks for pushing it forward!

@dsimansk
Copy link
Contributor

dsimansk commented Mar 7, 2024

/override codecov/project

Copy link

knative-prow bot commented Mar 7, 2024

@dsimansk: Overrode contexts on behalf of dsimansk: codecov/project

In response to this:

/override codecov/project

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot merged commit f170971 into knative:main Mar 7, 2024
21 of 22 checks passed
@cardil cardil deleted the feature/tui-codeimport branch March 7, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants