Skip to content

Commit 764e202

Browse files
MrFlounderclaude
andcommitted
fix(session): improve list display
- Header shows "Reviews:" for review ls, "Sessions:" otherwise - Empty summary shows "(no summary)" instead of empty quotes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b59a3d7 commit 764e202

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/crabcode

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,7 +6782,10 @@ session_list() {
67826782
local project_label=""
67836783
[ -n "$PROJECT_ALIAS" ] && project_label="@$PROJECT_ALIAS "
67846784

6785-
echo -e "${BOLD}${project_label}Sessions:${NC}"
6785+
# Header based on filter
6786+
local header="Sessions"
6787+
[[ "$filter" == "review" ]] && header="Reviews"
6788+
echo -e "${BOLD}${project_label}${header}:${NC}"
67866789
echo ""
67876790

67886791
for session_dir in "$sessions_dir"/*/; do
@@ -6822,14 +6825,20 @@ session_list() {
68226825
fi
68236826
fi
68246827

6825-
# Truncate summary if too long
6826-
[ ${#summary} -gt 50 ] && summary="${summary:0:47}..."
6828+
# Format summary
6829+
local summary_display=""
6830+
if [ -n "$summary" ] && [ "$summary" != "null" ]; then
6831+
[ ${#summary} -gt 50 ] && summary="${summary:0:47}..."
6832+
summary_display="\"$summary\""
6833+
else
6834+
summary_display="${GRAY}(no summary)${NC}"
6835+
fi
68276836

68286837
# Color based on type
6829-
local type_color="$GRAY"
6830-
[[ "$type" == "review" ]] && type_color="$CYAN"
6838+
local type_color="$CYAN"
6839+
[[ "$type" == "general" ]] && type_color="$GRAY"
68316840

6832-
printf " ${BOLD}%-20s${NC} ${type_color}%-50s${NC} ${GRAY}%s${NC}\n" "$name" "\"$summary\"" "$time_ago"
6841+
printf " ${BOLD}%-20s${NC} ${type_color}%-50b${NC} ${GRAY}%s${NC}\n" "$name" "$summary_display" "$time_ago"
68336842
done
68346843

68356844
if [ "$found" = false ]; then

0 commit comments

Comments
 (0)