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:
dj-oyu 2026-02-22 05:21:31 +09:00
parent 2081c447ba
commit 1e9154f8a5
2 changed files with 11 additions and 5 deletions

View file

@ -1149,10 +1149,16 @@ func buildRichStatus(task *activeTask, isBackground bool, workspace string) stri
sb.WriteByte('/')
sb.WriteString(strconv.Itoa(task.MaxIter))
sb.WriteString(")\n")
// Workspace: always emit for fixed height
// Workspace: always emit for fixed height (show project name only)
sb.WriteString("\U0001F4C1 ")
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.WriteString(statusSeparator)

View file

@ -1663,9 +1663,9 @@ func TestBuildRichStatus_LatestEntryNoInlineResult(t *testing.T) {
if !strings.Contains(got, " \u23F3") {
t.Errorf("latest entry result should be on indented line, got:\n%s", got)
}
// Full workspace path shown (not just project name)
if !strings.Contains(got, "/ws/my-project") {
t.Errorf("should show full workspace path, got:\n%s", got)
// Project name shown
if !strings.Contains(got, "my-project") {
t.Errorf("should show project name, got:\n%s", got)
}
// No second separator before error section
lines := strings.Split(got, "\n")