8000 Distinguish between first and subsequent progress bar displays by rquadling · Pull Request #19134 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Distinguish between first and subsequent progress bar displays #19134

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

Merged
merged 1 commit into from
Jun 23, 2016

Conversation

rquadling
Copy link
Contributor
@rquadling rquadling commented Jun 21, 2016
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #19133
License MIT
Doc PR reference to the documentation PR, if any

Fixes #19133

When a progress bar is first displayed, if it is multi-line, previously output lines are erased, depending upon the number of lines in the progress bar.

This patch fixes that be distinguishing between the first display (no erasing of previous output) and subsequent displays of the progress bar.

rquadling added a commit to rquadling/symfony that referenced this pull request Jun 21, 2016
With the changes made by symfony#19134, the `\Symfony\Component\Console\Tests\Helper\ProgressBarTest::testMultipleStart()` test fails.

This patch fixes the test for symfony#19134.
@@ -521,21 +521,27 @@ private function setMaxSteps($max)
*/
private function overwrite($message)
{
static $firstTime = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be better as a property, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a private property is fine.

The pain is that this is going to be a test every time the progress bar is updated.

Somewhere there has to be a switch between 1st and not 1st, so I suspect there is no way to not have the test.

@nicolas-grekas
Copy link
Member

Tests need to pass of course, and new tests added to cover the behavior.
(note that I have no opinion yet on the behavior you're suggesting).

@rquadling
Copy link
Contributor Author

I just realised I've submitted to separate PRs as I was editing online. Silly me.

I'll do it properly and get rid of #19134 and #19135. But that'll have to be tomorrow.

@stof
Copy link
Member
stof commented Jun 21, 2016

@rquadling you should get rid of only one of them, and update the other PR to contain all changes

@fabpot
8000
Copy link
Member
fabpot commented Jun 21, 2016

I've closed #19135. You can do the change directly in this PR now. No need to create yet another one.

@rquadling rquadling force-pushed the patch-1 branch 2 times, most recently from a535c71 to 1ca75ad Compare June 21, 2016 22:08
@@ -17,6 +17,7 @@

/**
* @group time-sensitive
* @group pb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you added a new group here?

@fabpot
Copy link
Member
fabpot commented Jun 23, 2016

Thank you @rquadling.

@fabpot fabpot merged commit 3871e1a into symfony:2.7 Jun 23, 2016
fabpot added a commit that referenced this pull request Jun 23, 2016
…lays (rquadling)

This PR was merged into the 2.7 branch.

Discussion
----------

Distinguish between first and subsequent progress bar displays

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19133
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Fixes #19133

When a progress bar is first displayed, if it is multi-line, previously output lines are erased, depending upon the number of lines in the progress bar.

This patch fixes that be distinguishing between the first display (no erasing of previous output) and subsequent displays of the progress bar.

Commits
-------

3871e1a Differentiate between the first time a progress bar is displayed and subsequent times
@rquadling rquadling deleted the patch-1 branch June 23, 2016 14:12
@rquadling
Copy link
Contributor Author

Thank you.


private function isFirstRun()
{
return $this->firstRun;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this method as well as the one below should have been inlined

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! #19163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0