feat!: improve cli architecture#342
Draft
Cyber-Syntax wants to merge 11 commits into
Draft
Conversation
Introduce a SubProgressType enum and a PROCESSING ProgressType, and propagate sub_type throughout the UI progress system. TaskConfig, TaskInfo and TaskState now include an optional sub_type. ProgressReporter .add_task gained a sub_type parameter and ProgressDisplay/Ascii backend use sub_type to render more specific operation labels. Also replace old operation name mappings with OPERATION_NAMES / SUB_PROCESSING_NAMES and adjust protocol re-exports (protocols.**getattr** lazy-exports). BREAKING CHANGE: ProgressReporter.add_task signature changed (new sub_type arg); TaskConfig/TaskInfo/TaskState include sub_type; callers should update any direct usages (including generate_namespaced_id which now accepts sub_type). Update imports where progress types moved. Run ruff, mypy and tests after making call-site updates.
Introduce TRANSACTION_SUMMARY_HEADER in progress_types and use it in install and update summary logging instead of ad-hoc literal lines. Enhance ASCII progress renderer to append a total downloads summary line that displays total size, average speed, ETA, progress bar and completed count.
Add a helper to format the right-aligned metrics section and use the detected terminal width (with a safe 80-column fallback) to pad the name so size/speed/ETA/bar/percentage align to the right. Use "--" for unknown size/speed and "--:--" for unknown ETA. Simplify size/speed formatting and apply the same right-alignment logic to the total line.
Delegate moving-average calculation to calculate_speed (pure helper) and apply the returned updated history back onto task_info.speed_history (intentional mutation). Clarify docstring and preserve fallback to the last recorded speed when insufficient data is available.
Update tests to expect the new summary header ":: Creating transaction summary..." instead of "Installation Summary:" / "Update Summary:". Adjust progress-related assertions to validate size units, progress bar brackets and percentage (100%) rather than relying solely on a checkmark. Remove obsolete tests that asserted the previous checkmark-only behavior.
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.
Closes #325