Add Bubble Tea TUI with interactive treemap

Cell canvas renderer with frame cache and a perceptual 256-colour
quantizer; responsive geometry (large/medium/small/too-small);
squarified treemap with nested previews, LOD grouping, category
colouring and adaptive labels; spatial arrow navigation with stable
NodeID selection; zoom and breadcrumbs; modal system (info, help,
confirm, save); list, file-type, top-N, scan-info, duplicate and
comparison views; live search/filter; mouse support; move-to-trash.
This commit is contained in:
Andy Dixon
2026-10-02 08:25:35 +01:00
parent e8c831cb47
commit df8b10c6dd
35 changed files with 5294 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
package scan
import "runtime/debug"
// OnPanic is called if a scanner goroutine panics. The default re-panics
// (crashing the process); the TUI replaces it so it can restore the terminal
// before reporting. Programmer bugs are never silently swallowed.
var OnPanic = func(v any, stack []byte) { panic(v) }
func guard() {
if v := recover(); v != nil {
OnPanic(v, debug.Stack())
}
}
+2
View File
@@ -203,6 +203,7 @@ type controller struct {
}
func (c *controller) run(ctx context.Context) {
defer guard()
defer close(c.s.done)
jobs := make(chan *job, c.opts.JobBuffer)
results := make(chan result, c.opts.ResultBuf)
@@ -211,6 +212,7 @@ func (c *controller) run(ctx context.Context) {
wg.Add(1)
go func() {
defer wg.Done()
defer guard()
worker(ctx, jobs, results, c.opts.ChunkSize)
}()
}