- Notifications
You must be signed in to change notification settings - Fork1k
feat(cli): show workspace favorite status in list output#11878
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -22,6 +22,7 @@ type workspaceListRow struct { | ||
codersdk.Workspace `table:"-"` | ||
// For table format: | ||
Favorite bool `json:"-" table:"favorite"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It feels a bit weird to occupy this much prime real-estate at the beginning of the table for this, but I think I understand the motivation for having it first (to make the sort order obvious). Would it be weird to have favorite be "Fav" and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah I was playing around with that idea as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I thought about that too, and I like it, but I worry if it might be problematic (re: parsing), then again, anyone parsing should just be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah that's a fair point.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
I think we are also using emojis to highlight things, for example "Workspace is outdated ". Maybe we could just have a "star" for favorite ones? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
Something like this?
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. or ⭐️ + column padding. One more question: favs have sorting priority, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Padding to the width of an emoji glyph is going to be tricky; AFAICT there doesn't appear to be a space character equal to the width of an emoji. | ||
WorkspaceName string `json:"-" table:"workspace,default_sort"` | ||
Template string `json:"-" table:"template"` | ||
Status string `json:"-" table:"status"` | ||
@@ -46,9 +47,15 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace) | ||
if status == "Starting" || status == "Started" { | ||
healthy = strconv.FormatBool(workspace.Health.Healthy) | ||
} | ||
favIco := " " | ||
if workspace.Favorite { | ||
favIco = "★" | ||
} | ||
workspaceName := favIco + " " + workspace.OwnerName + "/" + workspace.Name | ||
return workspaceListRow{ | ||
Favorite: workspace.Favorite, | ||
Workspace: workspace, | ||
WorkspaceName:workspaceName, | ||
Template: workspace.TemplateName, | ||
Status: status, | ||
Healthy: healthy, | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.