Skip to content

Commit 6c44c12

Browse files
nrjdalalclaude
andcommitted
feat: show file size in tree, full path in preview header
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3c6618a commit 6c44c12

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

bin/utils/interactive-picker.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ export function interactivePicker(
336336
const idx = scrollOffset + i + 1 // +1 for the dot row
337337
const isCursor = idx === cursor
338338
const checkbox = item.node.selected ? green("●") : dim("○")
339+
const sizeStr =
340+
item.node.type === "blob" && item.node.size > 0
341+
? dim(` ${formatSize(item.node.size)}`)
342+
: ""
339343
const nameStr =
340344
item.node.type === "tree"
341345
? cyan(item.node.name + "/")
@@ -345,7 +349,7 @@ export function interactivePicker(
345349
(item.node.linkTarget.endsWith("/")
346350
? cyan(item.node.linkTarget)
347351
: item.node.linkTarget)
348-
: item.node.name
352+
: item.node.name + sizeStr
349353
const expandIcon =
350354
item.node.type === "tree" ? (item.node.expanded ? dim("▾ ") : dim("▸ ")) : " "
351355
const pointer = isCursor ? yellow(">") : " "
@@ -440,9 +444,9 @@ export function interactivePicker(
440444
if (previewScrollOffset < 0) previewScrollOffset = 0
441445

442446
let out = "\x1B[H\x1B[2J"
443-
const nameStr =
444-
node.type === "symlink" ? yellow(node.name) + dim(" -> ") + node.linkTarget : node.name
445-
out += `\n ${bold(nameStr)} ${dim(formatSize(node.size))}\n\n`
447+
const pathStr =
448+
node.type === "symlink" ? yellow(node.path) + dim(" -> ") + node.linkTarget : node.path
449+
out += `\n ${bold(pathStr)} ${dim(formatSize(node.size))}\n\n`
446450

447451
const visibleCount = Math.min(viewportHeight, lines.length - previewScrollOffset)
448452
for (let i = 0; i < visibleCount; i++) {

0 commit comments

Comments
 (0)