-
Notifications
You must be signed in to change notification settings - Fork 31
Issue/65 show sync messages #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Previously, pdd sync hid all interactive prompts and error messages because the animation used screen=True mode which created an alternate screen that captured all output. This made debugging difficult as users could not see what was happening during operations. Changes: - Added output capture using io.StringIO and redirect_stdout/stderr - Created _display_operation_output() function to show captured output - Wrapped all 7 operations (auto-deps, generate, example, crash, verify, test, fix, update) with output capture and display - Animation temporarily pauses to show output, then resumes - Output displayed in formatted Rich panels (green for STDOUT, red for STDERR) - Clear operation headers and footers for better readability Benefits: - Users can now see detailed command output during sync - Error messages are visible for debugging - Interactive prompts are no longer hidden - Separate sections for STDOUT and STDERR when present - Animation still provides nice visual progress feedback Fixes promptdriven#65
Long file paths and output were breaking panel layout with expand=False. Changed to expand=True so panels use full terminal width and wrap text properly for better readability.
Removed Rich Panel wrapper for stdout/stderr display to avoid nested formatting conflicts. The output now uses simple headers with raw content printing, which: - Avoids broken nested box characters - Preserves original Rich formatting from operations - Provides cleaner, more readable output - Reduces pause time from 1.0s to 0.5s for better UX Also removed unused Panel import.
…tdriven#65) - Add unit tests for _display_operation_output function * Test basic stdout/stderr display functionality * Test quiet flag is respected * Test empty output is handled gracefully - Add integration tests for output capture * Test output capture works during operations * Test operation success detection is preserved * Test quiet mode suppresses output throughout workflow * Test output is displayed even when operations fail All tests pass successfully (30 tests in test_sync_orchestration.py)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements output capture and display functionality for PDD sync operations to address issue #65. The changes enable users to see stdout/stderr from operations like generate, test, and fix, which were previously hidden during the animated sync process.
Key Changes:
- Added
_display_operation_output()function to pause animation and display captured output with formatted headers - Wrapped all 8 sync operations (auto-deps, generate, example, crash, verify, test, fix, update) with stdout/stderr capture using
io.StringIOand context managers - Output display respects the
--quietflag and resumes animation after showing results
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pdd/sync_orchestration.py | Added output capture infrastructure and wrapped all sync operations with stdout/stderr redirection |
| tests/test_sync_orchestration.py | Added 7 comprehensive tests covering basic functionality, quiet mode, empty output, integration scenarios, and failure cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Signal animation to pause | ||
| stop_event.set() | ||
| time.sleep(0.3) # Give animation time to clean up |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 0.3 should be documented or extracted to a constant explaining why this specific duration is needed for animation cleanup.
| console.print(f"{'='*80}\n") | ||
|
|
||
| # Small pause so user can see the output | ||
| time.sleep(0.5) # Reduced from 1.0s |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment 'Reduced from 1.0s' implies this was changed but doesn't explain why 0.5s is the appropriate value. Consider documenting the rationale or extracting to a named constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Fixes #65
Changes
redirect_stdout/redirect_stderr_display_operation_output()to display captured output after each operation--quietflag to suppress output when neededImplementation Details
io.StringIO()andcontextlib.redirect_stdout/stderrstop_eventTesting
test_sync_orchestration.pypytest --covfor coverage verification