codewalk 0.1.5 → 0.1.7
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/dist/index.js +6 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20698,8 +20698,9 @@ function getTrackedCommits(trackedCommits) {
|
|
|
20698
20698
|
}
|
|
20699
20699
|
function aggregateByReasoning(cwd, trackedCommits) {
|
|
20700
20700
|
const reasoningMap = new Map;
|
|
20701
|
+
let insertionCounter = 0;
|
|
20701
20702
|
const commitDiffs = new Map;
|
|
20702
|
-
for (const tc of trackedCommits) {
|
|
20703
|
+
for (const tc of [...trackedCommits].reverse()) {
|
|
20703
20704
|
if (!tc.tracking)
|
|
20704
20705
|
continue;
|
|
20705
20706
|
if (!commitDiffs.has(tc.commit.shortSha)) {
|
|
@@ -20711,7 +20712,8 @@ function aggregateByReasoning(cwd, trackedCommits) {
|
|
|
20711
20712
|
if (!reasoningMap.has(key)) {
|
|
20712
20713
|
reasoningMap.set(key, {
|
|
20713
20714
|
reasoning: change.reasoning,
|
|
20714
|
-
files: []
|
|
20715
|
+
files: [],
|
|
20716
|
+
insertionOrder: insertionCounter++
|
|
20715
20717
|
});
|
|
20716
20718
|
}
|
|
20717
20719
|
const group = reasoningMap.get(key);
|
|
@@ -20740,7 +20742,7 @@ function aggregateByReasoning(cwd, trackedCommits) {
|
|
|
20740
20742
|
}
|
|
20741
20743
|
}
|
|
20742
20744
|
}
|
|
20743
|
-
return Array.from(reasoningMap.values()).filter((group) => group.files.length > 0).sort((a, b) =>
|
|
20745
|
+
return Array.from(reasoningMap.values()).filter((group) => group.files.length > 0).sort((a, b) => a.insertionOrder - b.insertionOrder);
|
|
20744
20746
|
}
|
|
20745
20747
|
|
|
20746
20748
|
// src/utils/settings.ts
|
|
@@ -21019,32 +21021,6 @@ function hunksToUnifiedDiff(filePath, hunks) {
|
|
|
21019
21021
|
}
|
|
21020
21022
|
return diff;
|
|
21021
21023
|
}
|
|
21022
|
-
function getFileType(filePath) {
|
|
21023
|
-
const ext = filePath.split(".").pop()?.toLowerCase();
|
|
21024
|
-
const typeMap = {
|
|
21025
|
-
ts: "typescript",
|
|
21026
|
-
tsx: "tsx",
|
|
21027
|
-
js: "javascript",
|
|
21028
|
-
jsx: "jsx",
|
|
21029
|
-
py: "python",
|
|
21030
|
-
rb: "ruby",
|
|
21031
|
-
go: "go",
|
|
21032
|
-
rs: "rust",
|
|
21033
|
-
java: "java",
|
|
21034
|
-
c: "c",
|
|
21035
|
-
cpp: "cpp",
|
|
21036
|
-
h: "c",
|
|
21037
|
-
hpp: "cpp",
|
|
21038
|
-
css: "css",
|
|
21039
|
-
scss: "scss",
|
|
21040
|
-
html: "html",
|
|
21041
|
-
json: "json",
|
|
21042
|
-
md: "markdown",
|
|
21043
|
-
yaml: "yaml",
|
|
21044
|
-
yml: "yaml"
|
|
21045
|
-
};
|
|
21046
|
-
return ext ? typeMap[ext] : undefined;
|
|
21047
|
-
}
|
|
21048
21024
|
|
|
21049
21025
|
class TreeView {
|
|
21050
21026
|
renderer;
|
|
@@ -21331,7 +21307,6 @@ class TreeView {
|
|
|
21331
21307
|
});
|
|
21332
21308
|
if (isFileExpanded && file.hunks.length > 0) {
|
|
21333
21309
|
const diffContent = hunksToUnifiedDiff(file.path, file.hunks);
|
|
21334
|
-
const fileType = getFileType(file.path);
|
|
21335
21310
|
const diffBox = new BoxRenderable(this.renderer, {
|
|
21336
21311
|
width: "100%",
|
|
21337
21312
|
border: true,
|
|
@@ -21347,7 +21322,6 @@ class TreeView {
|
|
|
21347
21322
|
diff: diffContent,
|
|
21348
21323
|
view: "unified",
|
|
21349
21324
|
showLineNumbers: true,
|
|
21350
|
-
filetype: fileType,
|
|
21351
21325
|
addedBg: "#1a3d1a",
|
|
21352
21326
|
removedBg: "#3d1a1a",
|
|
21353
21327
|
contextBg: "#1a1a2e",
|
|
@@ -21407,7 +21381,7 @@ class TreeView {
|
|
|
21407
21381
|
this.footerBox.remove(child.id);
|
|
21408
21382
|
}
|
|
21409
21383
|
const totalItems = this.selectableItems.length;
|
|
21410
|
-
const currentPos = this.state.selectedIndex + 1;
|
|
21384
|
+
const currentPos = totalItems > 0 ? this.state.selectedIndex + 1 : 0;
|
|
21411
21385
|
const footerText = new TextRenderable(this.renderer, {
|
|
21412
21386
|
content: `\u2191/\u2193 or scroll: navigate \u2502 Enter/click: expand \u2502 q: quit [${currentPos}/${totalItems}]`,
|
|
21413
21387
|
fg: "#888888"
|