pi-better-goal 0.1.17 → 0.1.18
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/goal-clock.ts +5 -6
package/package.json
CHANGED
package/src/goal-clock.ts
CHANGED
|
@@ -81,20 +81,19 @@ export function renderGoalClockLine(
|
|
|
81
81
|
const timing = goalTiming(goal, now);
|
|
82
82
|
const heading = `goal ${goal.status}`;
|
|
83
83
|
const active = formatClockDuration(timing.activeSeconds);
|
|
84
|
-
const fixedWidth = visibleWidth(
|
|
84
|
+
const fixedWidth = visibleWidth(`${heading} ${active} `);
|
|
85
85
|
if (fixedWidth >= width) {
|
|
86
|
-
return truncateToWidth(
|
|
86
|
+
return truncateToWidth(`${heading} ${active}`, width);
|
|
87
87
|
}
|
|
88
88
|
const objective = truncateToWidth(goal.objective, width - fixedWidth);
|
|
89
|
-
return styleGoalRailLine(
|
|
89
|
+
return styleGoalRailLine(heading, `${active} ${objective}`, fg);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function styleGoalRailLine(
|
|
93
|
-
marker: string,
|
|
94
93
|
heading: string,
|
|
95
94
|
tail: string,
|
|
96
95
|
fg?: (color: string, value: string) => string,
|
|
97
96
|
): string {
|
|
98
|
-
if (!fg) return `${
|
|
99
|
-
return `${fg("
|
|
97
|
+
if (!fg) return `${heading} ${tail}`;
|
|
98
|
+
return `${fg("warning", heading)} ${fg("dim", tail)}`;
|
|
100
99
|
}
|