fix: revert workspace display to project name only
Full path wastes horizontal space on Telegram mobile bubbles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2cd1ce5459
commit
ca447569fd
2 changed files with 11 additions and 5 deletions
|
|
@ -1149,10 +1149,16 @@ func buildRichStatus(task *activeTask, isBackground bool, workspace string) stri
|
||||||
sb.WriteByte('/')
|
sb.WriteByte('/')
|
||||||
sb.WriteString(strconv.Itoa(task.MaxIter))
|
sb.WriteString(strconv.Itoa(task.MaxIter))
|
||||||
sb.WriteString(")\n")
|
sb.WriteString(")\n")
|
||||||
// Workspace: always emit for fixed height
|
// Workspace: always emit for fixed height (show project name only)
|
||||||
sb.WriteString("\U0001F4C1 ")
|
sb.WriteString("\U0001F4C1 ")
|
||||||
if workspace != "" {
|
if workspace != "" {
|
||||||
sb.WriteString(workspace)
|
project := workspace
|
||||||
|
if idx := strings.LastIndex(workspace, "/"); idx >= 0 {
|
||||||
|
project = workspace[idx+1:]
|
||||||
|
} else if idx := strings.LastIndex(workspace, "\\"); idx >= 0 {
|
||||||
|
project = workspace[idx+1:]
|
||||||
|
}
|
||||||
|
sb.WriteString(project)
|
||||||
}
|
}
|
||||||
sb.WriteByte('\n')
|
sb.WriteByte('\n')
|
||||||
sb.WriteString(statusSeparator)
|
sb.WriteString(statusSeparator)
|
||||||
|
|
|
||||||
|
|
@ -1663,9 +1663,9 @@ func TestBuildRichStatus_LatestEntryNoInlineResult(t *testing.T) {
|
||||||
if !strings.Contains(got, " \u23F3") {
|
if !strings.Contains(got, " \u23F3") {
|
||||||
t.Errorf("latest entry result should be on indented line, got:\n%s", got)
|
t.Errorf("latest entry result should be on indented line, got:\n%s", got)
|
||||||
}
|
}
|
||||||
// Full workspace path shown (not just project name)
|
// Project name shown
|
||||||
if !strings.Contains(got, "/ws/my-project") {
|
if !strings.Contains(got, "my-project") {
|
||||||
t.Errorf("should show full workspace path, got:\n%s", got)
|
t.Errorf("should show project name, got:\n%s", got)
|
||||||
}
|
}
|
||||||
// No second separator before error section
|
// No second separator before error section
|
||||||
lines := strings.Split(got, "\n")
|
lines := strings.Split(got, "\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue