cc-sidebar 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/RawSidebar.tsx +24 -21
package/package.json
CHANGED
|
@@ -914,24 +914,9 @@ export class RawSidebar {
|
|
|
914
914
|
|
|
915
915
|
// Header padding
|
|
916
916
|
lines.push(bgLine);
|
|
917
|
+
lines.push(bgLine);
|
|
917
918
|
|
|
918
|
-
// Repo and branch at top (always computed locally per-instance)
|
|
919
919
|
const { statusline } = this.state;
|
|
920
|
-
let branch = '';
|
|
921
|
-
let repo = '';
|
|
922
|
-
try {
|
|
923
|
-
branch = execSync('git rev-parse --abbrev-ref HEAD 2>/dev/null', { encoding: 'utf8' }).trim();
|
|
924
|
-
} catch {}
|
|
925
|
-
const cwd = getEffectiveCwd();
|
|
926
|
-
const parts = cwd.split('/').filter(Boolean);
|
|
927
|
-
repo = parts[parts.length - 1] || cwd;
|
|
928
|
-
const branchDisplay = branch ? `${branch}` : '';
|
|
929
|
-
const repoDisplay = repo ? `${repo}` : '';
|
|
930
|
-
const headerContent = branchDisplay && repoDisplay
|
|
931
|
-
? `${repoDisplay} · ${branchDisplay}`
|
|
932
|
-
: repoDisplay || branchDisplay;
|
|
933
|
-
lines.push(`${bg} ${text}${headerContent}${ansi.clearToEnd}${ansi.reset}`);
|
|
934
|
-
lines.push(bgLine); // Space after header
|
|
935
920
|
|
|
936
921
|
// Content width: total width - 2 (margin) - 4 (indicator like "[ ] ") - 2 (right padding)
|
|
937
922
|
const maxContentWidth = this.width - 8;
|
|
@@ -1004,7 +989,7 @@ export class RawSidebar {
|
|
|
1004
989
|
lines.push(`${bg} ${prefix}${text}${line}${padding}${ansi.reset}`);
|
|
1005
990
|
});
|
|
1006
991
|
} else if (inboxTasks.length === 0) {
|
|
1007
|
-
lines.push(`${bg} ${ansi.gray} [ ]
|
|
992
|
+
lines.push(`${bg} ${ansi.gray} [ ] a to add tasks${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1008
993
|
}
|
|
1009
994
|
lines.push(bgLine);
|
|
1010
995
|
|
|
@@ -1015,7 +1000,7 @@ export class RawSidebar {
|
|
|
1015
1000
|
if (clarifiedTasks.length > 0) {
|
|
1016
1001
|
clarifiedTasks.forEach((task, index) => renderTask(task, index, "clarified"));
|
|
1017
1002
|
} else {
|
|
1018
|
-
lines.push(`${bg} ${ansi.gray} [ ]
|
|
1003
|
+
lines.push(`${bg} ${ansi.gray} [ ] c to clarify tasks${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1019
1004
|
}
|
|
1020
1005
|
lines.push(bgLine);
|
|
1021
1006
|
|
|
@@ -1025,7 +1010,7 @@ export class RawSidebar {
|
|
|
1025
1010
|
const content = activeTask.content.slice(0, maxContentWidth);
|
|
1026
1011
|
lines.push(`${bg} ${ansi.green}▸ ${content}${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1027
1012
|
} else {
|
|
1028
|
-
lines.push(`${bg} ${ansi.gray} [ ]
|
|
1013
|
+
lines.push(`${bg} ${ansi.gray} [ ] ↵ to send tasks${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1029
1014
|
}
|
|
1030
1015
|
lines.push(bgLine);
|
|
1031
1016
|
|
|
@@ -1041,13 +1026,13 @@ export class RawSidebar {
|
|
|
1041
1026
|
lines.push(`${bg} ${color}${icon}${content}${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1042
1027
|
});
|
|
1043
1028
|
} else {
|
|
1044
|
-
lines.push(`${bg} ${ansi.gray} [ ]
|
|
1029
|
+
lines.push(`${bg} ${ansi.gray} [ ] d to mark as done${ansi.reset}${bg}${ansi.clearToEnd}${ansi.reset}`);
|
|
1045
1030
|
}
|
|
1046
1031
|
lines.push(bgLine);
|
|
1047
1032
|
|
|
1048
1033
|
// Fill remaining space
|
|
1049
1034
|
const contentHeight = lines.length;
|
|
1050
|
-
const footerHeight = statusline ?
|
|
1035
|
+
const footerHeight = statusline ? 6 : 4;
|
|
1051
1036
|
const remainingHeight = this.height - contentHeight - footerHeight;
|
|
1052
1037
|
for (let i = 0; i < remainingHeight; i++) {
|
|
1053
1038
|
lines.push(bgLine);
|
|
@@ -1086,7 +1071,25 @@ export class RawSidebar {
|
|
|
1086
1071
|
const durationDisplay = `${statusline.durationMin}m`;
|
|
1087
1072
|
const statusInfo = `${ctxDisplay} ${costDisplay} ${durationDisplay}`;
|
|
1088
1073
|
lines.push(`${bg} ${statusInfo}${ansi.clearToEnd}${ansi.reset}`);
|
|
1074
|
+
lines.push(bgLine);
|
|
1089
1075
|
}
|
|
1076
|
+
|
|
1077
|
+
// Repo and branch at bottom
|
|
1078
|
+
let branch = '';
|
|
1079
|
+
let repo = '';
|
|
1080
|
+
try {
|
|
1081
|
+
branch = execSync('git rev-parse --abbrev-ref HEAD 2>/dev/null', { encoding: 'utf8' }).trim();
|
|
1082
|
+
} catch {}
|
|
1083
|
+
const cwd = getEffectiveCwd();
|
|
1084
|
+
const parts = cwd.split('/').filter(Boolean);
|
|
1085
|
+
repo = parts[parts.length - 1] || cwd;
|
|
1086
|
+
const branchDisplay = branch ? `${branch}` : '';
|
|
1087
|
+
const repoDisplay = repo ? `${repo}` : '';
|
|
1088
|
+
const repoContent = branchDisplay && repoDisplay
|
|
1089
|
+
? `${repoDisplay} · ${branchDisplay}`
|
|
1090
|
+
: repoDisplay || branchDisplay;
|
|
1091
|
+
lines.push(`${bg} ${muted}${repoContent}${ansi.clearToEnd}${ansi.reset}`);
|
|
1092
|
+
|
|
1090
1093
|
lines.push(bgLine); // Bottom padding
|
|
1091
1094
|
|
|
1092
1095
|
// Output everything at once with synchronized output to prevent partial renders
|