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

Format the description of a studio to remove line breaks to increase readability #488

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

georgi-seqera
Copy link
Contributor

@georgi-seqera georgi-seqera commented Feb 5, 2025

Noticed while doing some testing that for Studios where the description had a line break or was too long, it resulted in the table output being formatted wrong - this PR sanitises the description a bit to avoid badly formatted output and improve readability.

Before:

./tw studios list -w data-studios/data-studios

 Studios at [data-studios / data-studios] workspace:

     ID       | Name                      | Description                                                              | User               | Status
    ----------+---------------------------+--------------------------------------------------------------------------+--------------------+-------------
     abec0e2c | studio-c9f5               | test mount

Started from studio jboxman-test-012725b                     | jason-boxman       | STOPPED
     5dc53d96 | my_name_with_underscore   | NA                                                                       | endre-sukosd       | STOPPED
     93cf086d | studio-c3f6               | NA                                                                       | georgi-hristov     | ERRORED
     aa3ab09d | my-fresh-studio           | NA                                                                       | georgi-hristov     | ERRORED

After:

./tw studios list -w data-studios/data-studios

Studios at [data-studios / data-studios] workspace:

     ID       | Name                      | Description                                                              | User               | Status
    ----------+---------------------------+--------------------------------------------------------------------------+--------------------+-------------
     abec0e2c | studio-c9f5               | test mount Started from studio jboxman-test-012725b                      | jason-boxman       | STOPPED
     5dc53d96 | my_name_with_underscore   | NA                                                                       | endre-sukosd       | STOPPED
     93cf086d | studio-c3f6               | NA                                                                       | georgi-hristov     | ERRORED
     aa3ab09d | my-fresh-studio           | NA                                                                       | georgi-hristov     | ERRORED
     77677145 | gost-refactor-jupyter     | NA                                                                       | weronika-sosnowska | STOPPED

In line with how it is presented on the Frontend as well:
image

Studio with long description capped:

Studios at [data-studios / data-studios] workspace:

     ID       | Name                      | Description                                                                                             | User               | Status
    ----------+---------------------------+---------------------------------------------------------------------------------------------------------+--------------------+-------------
     8dbe08fa | studio-33a2               | Lorem ipsum odor amet, consectetuer adipiscing elit. Est lacinia proin habitasse suspendisse nascetu... | georgi-hristov     | RUNNING
     abec0e2c | studio-c9f5               | test mount Started from studio jboxman-test-012725b                                                     | jason-boxman       | STOPPED
     5dc53d96 | my_name_with_underscore   | NA                                                                                                      | endre-sukosd       | STOPPED
     93cf086d | studio-c3f6               | NA                                                                                                      | georgi-hristov     | ERRORED

@georgi-seqera georgi-seqera force-pushed the no-task/small-readibility-improvements branch from 14d94cf to 0a45dfa Compare February 5, 2025 10:42
@georgi-seqera georgi-seqera marked this pull request as ready for review February 5, 2025 10:51
Copy link
Member

@endre-seqera endre-seqera left a comment

Choose a reason for hiding this comment

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

Good ux improvement!

@georgi-seqera georgi-seqera merged commit 2571851 into master Feb 5, 2025
7 checks passed
@georgi-seqera georgi-seqera deleted the no-task/small-readibility-improvements branch February 5, 2025 11:16
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