refactor(ui): route progress messages by FileIndex instead of CurrentIndex#102
Merged
Conversation
…Index Decouples per-file TUI state from a global current-file cursor, enabling concurrent file processing. Removes Model.CurrentIndex field; message handlers now route updates directly via msg.FileIndex. Adds debugSink concurrency primitive for race-safe logging across parallel workers. - Add FileIndex field to ProgressMsg for per-file message routing - Replace CurrentIndex-based handlers with FileIndex routing in Update() - Remove Model.CurrentIndex field and all references - Update footer to show aggregate progress (N files, K complete, J failed) - Add debugSink: mutex-guarded log sink with whole-line atomicity - Add withFilePrefix wrapper for per-file debug markers - Add unit tests: routing, out-of-range safety, aggregate footer, race conditions Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 4/5
- This PR looks safe to merge overall, with risk concentrated in test reliability rather than production behavior.
- In
internal/ui/model_routing_test.go, the expected file slice is aliased instead of copied, so in-place mutations can be hidden and the safety test may give a false pass. - Given the issue is medium severity (6/10) but scoped to a test assertion pattern, the merge risk appears minimal to moderate rather than blocking.
- Pay close attention to
internal/ui/model_routing_test.go- aliased expected slices can mask unintended mutation regressions.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: This PR refactors the TUI's progress message routing from a global current-file index to per-file indices, enabling concurrent processing without altering core audio logic; the changes are limited to UI state management, well-tested with routing and safety tests, and include a mutex-guarded...
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decouples per-file TUI state from a global current-file cursor, enabling concurrent file processing. Removes Model.CurrentIndex field; message handlers now route updates directly via msg.FileIndex. Adds debugSink concurrency primitive for race-safe logging across parallel workers.