Skip to content

Hex editor, terminal text selection, F3 size calc, F3/F4 consolidation#16

Merged
bluestreak01 merged 5 commits intomasterfrom
vi_take2
Apr 14, 2026
Merged

Hex editor, terminal text selection, F3 size calc, F3/F4 consolidation#16
bluestreak01 merged 5 commits intomasterfrom
vi_take2

Conversation

@bluestreak01
Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 commented Apr 7, 2026

Summary

  • Hex editor: full editing for binary files — cursor, hex/ASCII editing, undo/redo, pattern search, goto offset, selection with data inspector, unsaved changes prompt
  • F4 auto-detects file type: text → editor, binary → hex editor, parquet → parquet viewer. F3 repurposed.
  • F3 directory size calculation: async recursive scan with live progress spinner, works on selections, parallel dir scanning
  • Terminal text selection: click-drag, double/triple-click in shell and Claude panels. Ctrl+C copies selection (SIGINT when no selection)
  • Zero-allocation hex render loop with compile-time lookup tables
  • 545 total tests passing, zero clippy warnings

Hex Editor

  • Modifications stored as in-place overlay (HashMap) — only changed bytes in memory
  • Save writes only modified bytes with sorted sequential I/O
  • Search scans file in 1MB chunks with overlap for boundary-spanning patterns
  • Data inspector: select 1/2/4/8 bytes to see u/i/float values in both endiannesses
  • Cursor tracking between hex and ASCII panes
  • Uses shared search dialog (F7) and goto dialog (g) consistent with text editor

F3 Size Calculation

  • F3 on directory: async background thread walks recursively, spinner in size column, actual size when done
  • F3 on multi-selection: all dirs scanned in parallel, files summed immediately
  • F3 again on calculated dir: re-scans (force refresh)
  • Sizes persist until panel reload

Test plan

  • cargo test — 545 tests pass
  • cargo clippy — zero warnings
  • cargo fmt --check — clean
  • F4 on binary → hex editor, text → editor, parquet → parquet viewer
  • Hex: edit nibbles, Tab for ASCII, Ctrl+S save, Ctrl+Z undo, F7 search, g goto
  • Hex: Shift+arrows select, status bar shows numeric values for 1/2/4/8 byte selections
  • F3 on directory shows spinner then size
  • F3 on multi-selection calculates all in parallel
  • Shell/Claude: drag select text, Ctrl+C copies selection

🤖 Generated with Claude Code

bluestreak01 and others added 3 commits April 7, 2026 17:04
F4 now auto-detects file type: parquet files open in parquet viewer,
binary files open in hex viewer, and text files open in the editor.
Removes the redundant F3 viewer (text viewer, hex/text toggle) since
the editor and specialized viewers cover all use cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pener

Viewer consolidation:
- F4 auto-detects file type: parquet → parquet viewer, binary → hex
  viewer, text → editor. Removes redundant F3 text viewer.
- Deletes viewer.rs, viewer_view.rs, Action::ViewFile, AppMode::Viewing
- Updates help dialog, footer bar, and hint bars

Terminal text selection:
- Click to position, drag to select, double-click word, triple-click line
- Selected text highlighted with reverse video
- Ctrl+C copies selection to clipboard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hex editor:
- Cursor navigation (arrows, Home/End, PgUp/PgDn, mouse click)
- Edit hex nibbles (0-F) and ASCII characters (Tab to switch)
- Modifications overlay — only changed bytes in memory, in-place save
- Undo/redo per-nibble (Ctrl+Z / Ctrl+Shift+Z)
- Hex pattern search (F7) using shared search dialog, 1MB chunked scan
- Go to offset (g) using shared goto dialog with hex input
- Byte selection (Shift+arrows, Ctrl+A) with copy (Ctrl+C)
- Data inspector: select 1/2/4/8 bytes for signed/unsigned/float in LE/BE
- Cursor tracking between hex and ASCII panes
- Unsaved changes prompt, F10 quit support
- Zero-allocation render with pre-computed lookup tables
- 117 unit tests covering all edge cases

Terminal text selection (shell + claude panels):
- Click-drag, double-click (word), triple-click (line)
- Ctrl+C copies selection to clipboard (SIGINT when no selection)
- Auto-copy on double/triple-click, deferred copy on drag

Also: fix hex click separator bug, sort save writes, clippy/fmt clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bluestreak01 bluestreak01 changed the title Add terminal text selection, consolidate F3/F4 into unified file opener Hex editor, terminal text selection, F3/F4 consolidation Apr 7, 2026
- F3 on a directory starts async recursive size scan in background thread
- Size column shows spinner while scanning, then actual size when done
- F3 on multi-selection calculates all dirs in parallel, sums files immediately
- F3 on files-only selection shows total in status bar
- Pressing F3 again on a calculated dir re-scans (force refresh)
- Calculated sizes persist until panel reload
- Updated footer, help dialog, and README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bluestreak01 bluestreak01 changed the title Hex editor, terminal text selection, F3/F4 consolidation Hex editor, terminal text selection, F3 size calc, F3/F4 consolidation Apr 7, 2026
…tatus bar

- Fix symlink cycle: use symlink_metadata, skip recursing into symlinked dirs
- Cancel background threads on panel reload and F3 re-scan (AtomicBool flag)
- Sort by size uses calculated dir sizes instead of metadata size (4096)
- Auto re-sort when dir size calculation completes
- Render status_message in footer bar (was set but never displayed)
- Clear status_message on next user action
- F3 on ".." calculates parent directory size

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bluestreak01 bluestreak01 merged commit 22af623 into master Apr 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant