Add ability to add row in a loop to existing table#190
Merged
swissspidy merged 6 commits intomainfrom Jan 20, 2026
Merged
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Reset border cache when widths change in Ascii renderer - Update displayRow() to properly handle width updates - Improve example to better demonstrate incremental row display - All tests pass (lint, phpcs, phpstan, phpunit) Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Copilot stopped work on behalf of
swissspidy due to an error
January 19, 2026 13:19
This comment was marked as resolved.
This comment was marked as resolved.
- Fix duplicate border issue when displaying table with headers but no rows - Update test to reflect correct behavior (single border after headers) - Improves visual consistency for incremental row display - All tests pass Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
swissspidy
reviewed
Jan 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to incrementally display table rows in a loop, addressing the feature request to render rows without re-rendering the entire table including headers and previously added rows.
Changes:
- Added
resetRows()method to clear only row data while preserving headers and footers - Added
displayRow()method to display individual rows without headers or top borders - Fixed border rendering issues in the Ascii renderer to prevent duplicate borders
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/cli/Table.php | Implements core functionality with resetRows() and displayRow() methods, plus state tracking |
| lib/cli/table/Ascii.php | Fixes border cache invalidation when column widths change |
| tests/Test_Table.php | Adds comprehensive test coverage for new methods |
| tests/Test_Table_Ascii.php | Removes expected duplicate bottom border from test output |
| examples/incremental-table.php | Demonstrates usage patterns for incremental table row display |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
As requested in review feedback. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
- Remove unused $_displayed property - Fix assignment in function argument (use false directly) - Add proper cleanup with try-finally blocks in tests - Ensure temp files are cleaned up even if assertions fail Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
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.
Implementation Plan for Incremental Table Row Display
resetRows()method to clear only rows (not headers/footers)displayRow()method to display single row without headers/bordersOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.