Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 5f7e8e6

Browse files
staticoclaude
andcommitted
Improve nodes view: page navigation and emoji width
- Add page up/down (Ctrl+d/u, PageDown/PageUp) navigation - Add vim-style g/G for first/last node - Expand emoji width detection to cover more Unicode ranges (Misc Technical, Enclosed Alphanumerics, Geometric shapes, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cf79b53 commit 5f7e8e6

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/ui/App.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,23 @@ export function App({ address, packetStore, nodeStore, skipConfig = false }: App
584584
setMode("nodes");
585585
}
586586
} else if (mode === "nodes") {
587+
const nodePageSize = Math.max(1, terminalHeight - 16);
587588
if (input === "j" || key.downArrow) {
588589
setSelectedNodeIndex((i) => Math.min(i + 1, nodes.length - 1));
589590
}
590591
if (input === "k" || key.upArrow) {
591592
setSelectedNodeIndex((i) => Math.max(i - 1, 0));
592593
}
594+
// Page up/down
595+
if ((key.ctrl && input === "d") || key.pageDown) {
596+
setSelectedNodeIndex((i) => Math.min(i + nodePageSize, nodes.length - 1));
597+
}
598+
if ((key.ctrl && input === "u") || key.pageUp) {
599+
setSelectedNodeIndex((i) => Math.max(i - nodePageSize, 0));
600+
}
593601
// Home/End keys
594-
const isNodeHome = input === "\x1b[H" || input === "\x1b[1~" || input === "\x1bOH";
595-
const isNodeEnd = input === "\x1b[F" || input === "\x1b[4~" || input === "\x1bOF";
602+
const isNodeHome = input === "g" || input === "\x1b[H" || input === "\x1b[1~" || input === "\x1bOH";
603+
const isNodeEnd = input === "G" || input === "\x1b[F" || input === "\x1b[4~" || input === "\x1bOF";
596604
if (isNodeHome) {
597605
setSelectedNodeIndex(0);
598606
}

src/ui/components/NodesPanel.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ function stringWidth(str: string): number {
1111
for (const char of str) {
1212
const code = char.codePointAt(0) || 0;
1313
// Emoji and wide characters take 2 spaces
14-
if (code > 0x1F000 || (code >= 0x2600 && code <= 0x27BF) || (code >= 0x1F300 && code <= 0x1F9FF)) {
14+
// Covers: Misc Technical (23xx), Enclosed Alphanumerics (24xx), Geometric (25xx),
15+
// Misc Symbols (26xx), Dingbats (27xx), Misc Symbols (2Bxx), and SMP emojis (1Fxxx)
16+
if (
17+
code > 0x1F000 ||
18+
(code >= 0x2300 && code <= 0x23FF) ||
19+
(code >= 0x2460 && code <= 0x24FF) ||
20+
(code >= 0x25A0 && code <= 0x25FF) ||
21+
(code >= 0x2600 && code <= 0x27BF) ||
22+
(code >= 0x2B00 && code <= 0x2BFF) ||
23+
(code >= 0x3000 && code <= 0x303F)
24+
) {
1525
width += 2;
1626
} else {
1727
width += 1;

0 commit comments

Comments
 (0)