refactor: update active download criteria to account for paused, pausing, and resuming states#343
Merged
SuperCoolPencil merged 4 commits intomainfrom Apr 10, 2026
Merged
Conversation
…r default height and width
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.
Close #329
Greptile Summary
This PR updates the TUI's active download criteria to correctly account for
pausing,paused, andresumingstates. Downloads in thepausingstate now correctly appear in the Queued tab (not Active), with consistent logic applied acrossgetFilteredDownloads(),ComputeViewStats(),UpdateListItems(), and the detail-viewisActivecheck. Tests are added infiltering_test.gocovering both the newpausingstate and consistency between tab counts and the filter function.Confidence Score: 5/5
Safe to merge; all filtering, stat-counting, and tab-assignment logic is mutually consistent and backed by targeted tests.
No P0 or P1 issues found. The single P2 finding (
calcTotalSpeedbriefly counting a pausing download's speed) is a transient UX glitch that resolves as soon as the download fully stops. All changed code paths are consistent with each other and well-covered by the new tests.internal/tui/view.go —
calcTotalSpeed(minor, P2 only)Important Files Changed
getFilteredDownloads()updated to excludepausingdownloads from Active and include them in Queued; logic is consistent withComputeViewStatsandUpdateListItems.ComputeViewStatsandisActivedetail-view check correctly excludepausing; howevercalcTotalSpeedstill includes speed from pausing downloads, creating a brief inconsistency between the network graph and the Active tab.UpdateListItemstab-assignment logic updated to include!d.pausingcondition, consistent withgetFilteredDownloads.TestTabFiltering(includingpausingcases) andTestComputeViewStatsConsistencyvalidating count-filter agreement across all tabs.getDownloadStatusforpausingandresumingstates; existing layout/rendering tests unchanged.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[DownloadModel] --> B{d.done?} B -- yes --> DONE[TabDone / DownloadedCount] B -- no --> C{d.paused OR d.pausing?} C -- yes --> QUEUED[TabQueued / QueuedCount] C -- no --> D{Speed > 0 OR Connections > 0 OR resuming?} D -- yes --> ACTIVE[TabActive / ActiveCount] D -- no --> QUEUEDPrompt To Fix All With AI
Reviews (2): Last reviewed commit: "fix: update settings layout constants an..." | Re-trigger Greptile