Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/src/commands/workspaces/list/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default command({
display: (data) =>
table(
data as Record<string, unknown>[],
["name", "branch", "projectName", "hostName"],
["NAME", "BRANCH", "PROJECT", "HOST"],
["name", "branch", "projectName", "hostName", "id"],
["NAME", "BRANCH", "PROJECT", "HOST", "ID"],
30,
Comment on lines +21 to 23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify how table width is applied and whether truncation occurs.
set -euo pipefail

echo "== Locate table helper implementation =="
fd -i "table" packages | sed -n '1,120p'
rg -n -C3 'export .*table|function table|const table\s*=' packages

echo
echo "== Find truncation/padding logic near table helper =="
rg -n -C4 'truncate|slice|ellipsis|width|maxWidth|pad' packages

echo
echo "== Find other list commands that print IDs and their width settings =="
rg -n -C2 'table\(' packages/cli/src/commands | rg -n 'ID|id|projects list|agents list|hosts list|workspaces list' -n

Repository: superset-sh/superset

Length of output: 50377


🏁 Script executed:

# Get the full table function implementation
head -100 packages/cli-framework/src/output.ts | tail -40

Repository: superset-sh/superset

Length of output: 1102


🏁 Script executed:

# Search for the complete table function to understand width parameter semantics
sed -n '67,150p' packages/cli-framework/src/output.ts

Repository: superset-sh/superset

Length of output: 1284


🏁 Script executed:

# Find other list commands that display IDs and check their width settings
find packages/cli/src/commands -name "*.ts" -type f -exec grep -l "table(" {} \; | head -10

Repository: superset-sh/superset

Length of output: 596


🏁 Script executed:

# Check how other list commands handle ID columns
for file in packages/cli/src/commands/*/list/command.ts packages/cli/src/commands/*/*/list/command.ts; do
  if [ -f "$file" ]; then
    echo "=== $file ==="
    grep -A 5 "table(" "$file" | head -20
  fi
done

Repository: superset-sh/superset

Length of output: 2089


🏁 Script executed:

# Specifically check the hosts list command since it might have IDs
cat packages/cli/src/commands/hosts/list/command.ts | head -60

Repository: superset-sh/superset

Length of output: 769


UUID truncation in the ID column will break the intended workflow

The table() function truncates individual cells when they exceed the maxColWidth parameter (line 23 sets this to 30). UUIDs are 36 characters, so they will be truncated to 29 characters plus an ellipsis, making them non-copyable. This defeats the PR's goal of enabling workspaces open <id> workflows.

Workspace list is the only command using an explicit maxColWidth below the default (60); all other list commands that display IDs use the default. Increase the width to at least 36 (or 40 for safety).

Suggested fix
  display: (data) =>
    table(
      data as Record<string, unknown>[],
      ["name", "branch", "projectName", "hostName", "id"],
      ["NAME", "BRANCH", "PROJECT", "HOST", "ID"],
-     30,
+     40,
    ),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/commands/workspaces/list/command.ts` around lines 21 - 23,
The table's maxColWidth is set too small (30) causing 36-char UUIDs in the "id"
column to be truncated; update the table() call that builds the workspace list
(the one using columns ["name","branch","projectName","hostName","id"] and
headers ["NAME","BRANCH","PROJECT","HOST","ID"]) to use a larger maxColWidth (at
least 36, preferably 40) so full UUIDs are displayed and copyable.

),
run: async ({ ctx, options }) => {
Expand Down
Loading