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:
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user