Eliminate direct console output bypassing UserOutput abstraction#82
Merged
josecelano merged 4 commits intomainfrom Oct 29, 2025
Merged
Eliminate direct console output bypassing UserOutput abstraction#82josecelano merged 4 commits intomainfrom
josecelano merged 4 commits intomainfrom
Conversation
- Add blank_line(), steps(), and info_block() methods to UserOutput - Replace all println! calls in template.rs with UserOutput methods - Replace all eprintln! calls in handle_error with UserOutput methods - Add comprehensive tests for new UserOutput methods - All output now respects verbosity levels and goes through proper channels Co-authored-by: josecelano <[email protected]>
Use info_block() instead of steps() to maintain proper structure of numbered list with sub-items (bullet points). This preserves the exact original output format where main steps are numbered and sub-items are indented with dashes. Co-authored-by: josecelano <[email protected]>
Use steps() method as intended by passing multi-line strings for steps that have sub-items. This provides semantic clarity and automatic numbering while maintaining the exact original output format. Co-authored-by: josecelano <[email protected]>
Copilot
AI
changed the title
[WIP] Eliminate direct console output bypassing UserOutput
Eliminate direct console output bypassing UserOutput abstraction
Oct 29, 2025
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.
The presentation layer directly called
println!()andeprintln!(), bypassing theUserOutputservice abstraction. This violated the architecture, prevented verbosity control, and made output untestable.Changes
Extended UserOutput API with three new methods:
blank_line()- spacing between output sectionssteps()- automatic numbering for sequential instructionsinfo_block()- multi-line information blocksAll methods respect verbosity levels and route output to appropriate channels (stderr for operational messages, stdout for results).
Refactored presentation layer to eliminate all direct console calls:
create/subcommands/template.rs- replaced 11println!()calls withsteps()andblank_line()commands/mod.rs- replaced 3eprintln!()calls inhandle_error()with UserOutput methodsExample
Before:
After:
Output format preserved. All messages now respect verbosity levels and can be tested/redirected.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.