@wierdbytes/pi-facelift 0.4.1 → 0.4.2
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/index.ts +19 -6
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1952,7 +1952,12 @@ export default function piFaceliftExtension(pi: PiFaceliftApi, deps?: PiFacelift
|
|
|
1952
1952
|
}
|
|
1953
1953
|
|
|
1954
1954
|
if (d?._type === "writeDiff") {
|
|
1955
|
-
|
|
1955
|
+
// `+A -B` already conveys the change size. We used to append
|
|
1956
|
+
// `(N diff lines)` to hint at how much was hidden under the
|
|
1957
|
+
// preview cap, but that cap is gone (we always render the
|
|
1958
|
+
// whole diff). N also included context + hunk separators, so
|
|
1959
|
+
// it never matched A+B and just looked like a miscount.
|
|
1960
|
+
const lab = summarizeDiff(d.diff.added, d.diff.removed);
|
|
1956
1961
|
// Diff output is always rendered in full — no compact mode,
|
|
1957
1962
|
// no `… N more lines` footer — so `ctx.expanded` is
|
|
1958
1963
|
// irrelevant to the rendered body and stays out of the key.
|
|
@@ -2136,17 +2141,25 @@ export default function piFaceliftExtension(pi: PiFaceliftApi, deps?: PiFacelift
|
|
|
2136
2141
|
|
|
2137
2142
|
const dc: DiffColors = resolveDiffColors(theme);
|
|
2138
2143
|
const editCount = d.edits.length;
|
|
2139
|
-
const diffLineTotal = d.edits.reduce((acc, e) => acc + e.diff.lines.length, 0);
|
|
2140
2144
|
const summary = summarizeDiff(d.totalAdded, d.totalRemoved);
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2145
|
+
// `+A -B` already conveys the change size. We used to append
|
|
2146
|
+
// `(N diff lines)` here, but N counted context rows + hunk
|
|
2147
|
+
// separators on top of A+B, so it never matched the +A -B
|
|
2148
|
+
// summary and looked like a miscount. With always-full
|
|
2149
|
+
// rendering there's nothing useful to disambiguate either.
|
|
2150
|
+
//
|
|
2151
|
+
// `N edits` keeps the same FG_DIM the old parenthetical used:
|
|
2152
|
+
// it's a quiet meta-label so the colored +A -B summary stays
|
|
2153
|
+
// the visual anchor of the bottom border.
|
|
2154
|
+
const editsCountLabel =
|
|
2155
|
+
editCount === 1 ? `${FG_DIM}1 edit${RST}` : `${FG_DIM}${editCount} edits${RST}`;
|
|
2156
|
+
const lab = `${editsCountLabel} ${summary}`;
|
|
2144
2157
|
|
|
2145
2158
|
// Every edit block is rendered in full — no compact mode,
|
|
2146
2159
|
// no `… N more edit blocks` footer, no per-edit line cap —
|
|
2147
2160
|
// so `ctx.expanded` doesn't affect the body and stays out of
|
|
2148
2161
|
// the key.
|
|
2149
|
-
const key = `editDiff:${themeCacheKey(theme)}:${d.filePath}:${editCount}:${d.totalAdded}:${d.totalRemoved}:${
|
|
2162
|
+
const key = `editDiff:${themeCacheKey(theme)}:${d.filePath}:${editCount}:${d.totalAdded}:${d.totalRemoved}:${w}:${status}`;
|
|
2150
2163
|
if (ctx.state._ek !== key) {
|
|
2151
2164
|
ctx.state._ek = key;
|
|
2152
2165
|
ctx.state._et = frameResultWithBottomLabel("", lab, status, t, w);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wierdbytes/pi-facelift",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Cosmetic facelift for built-in pi tool output — open-right rounded frames, syntax-highlighted reads, status-aware bash summaries, find/grep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|