Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Ui: Show total persons in status bar #803

Closed
wants to merge 2 commits into from

Conversation

yamgent
Copy link
Member

@yamgent yamgent commented Jan 19, 2018

Part of #784. Rebased, and added tests.

Proposed merge commit message:

The status bar does not show how many people are in the address book.
This information could be useful for the user when the user wants to
judge the size of the address book.

Let's modify the status bar to include the total amount of people in the
address book.

Note: For demo purpose, don't merge this to master!

@CanIHasReview-bot
Copy link

v1

@yamgent submitted v1 for review.

(📚 Archive)

Checkout this PR version locally
git fetch https://github.com/se-edu/addressbook-level4.git refs/pr/803/1/head:BRANCHNAME

where BRANCHNAME is the name of the local branch you wish to fetch this PR to.

Copy link
Contributor

@Zhiyuan-Amos Zhiyuan-Amos left a comment

Choose a reason for hiding this comment

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

[1/2] 💯

Commit message can be updated though. For paragraph 3: "Let's modify StatusBarFooter so that it shows the total number of persons in the current address book, so that the user knows the id of the last person.

Copy link
Contributor

@Zhiyuan-Amos Zhiyuan-Amos left a comment

Choose a reason for hiding this comment

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

[2/2] why no commit message? :P

String expectedSyncStatus = String.format(SYNC_STATUS_UPDATED, timestamp);
assertEquals(expectedSyncStatus, handle.getSyncStatus());

assertEquals(String.format(TOTAL_PERSONS_STATUS, totalPersons), handle.getTotalPersonsStatus());
Copy link
Contributor

Choose a reason for hiding this comment

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

we can replace totalPersons with testApp.getModel().getFilteredPersonList().size()

@yamgent yamgent force-pushed the getting-started-ui-status branch 2 times, most recently from e1e7303 to 57e442c Compare January 20, 2018 03:03
@yamgent
Copy link
Member Author

yamgent commented Jan 20, 2018

Note to self: AddressBookChangedEvent does not have filtered list.

@Zhiyuan-Amos Zhiyuan-Amos added the pr.Answer Pull request is answer for a tutorial in developer guide. Do not actually merge. label Jan 20, 2018
@yamgent yamgent force-pushed the getting-started-ui-status branch 7 times, most recently from 26ffce8 to 509eb2d Compare February 9, 2018 03:56
@CanIHasReview-bot
Copy link

v2

@yamgent submitted v2 for review.

(📚 Archive) (📈 Interdiff between v1 and v2)

Checkout this PR version locally
git fetch https://github.com/se-edu/addressbook-level4.git refs/pr/803/2/head:BRANCHNAME

where BRANCHNAME is the name of the local branch you wish to fetch this PR to.

@se-edu se-edu deleted a comment from yamgent Feb 9, 2018
Copy link
Contributor

@Zhiyuan-Amos Zhiyuan-Amos left a comment

Choose a reason for hiding this comment

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

[2/2]

* {@code ClockRule#getInjectedClock()}, total persons was changed to match the total
* number of persons in the address book, while the save location remains the same.
*/
protected void assertStatusBarUnchangedExceptSyncStatusAndTotalPersons() {
Copy link
Contributor

Choose a reason for hiding this comment

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

assertStatusBarChangedExceptSaveLocation? XD

}

/**
* Asserts that only the sync status in the status bar was changed to the timing of
Copy link
Contributor

Choose a reason for hiding this comment

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

the word only seems weird because 2 components in StatusBarFooter are updated.

@@ -125,7 +125,8 @@ void fillInnerParts() {
ResultDisplay resultDisplay = new ResultDisplay();
resultDisplayPlaceholder.getChildren().add(resultDisplay.getRoot());

StatusBarFooter statusBarFooter = new StatusBarFooter(prefs.getAddressBookFilePath());
StatusBarFooter statusBarFooter = new StatusBarFooter(prefs.getAddressBookFilePath(),
logic.getFilteredPersonList().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

this line looks weird because statusBarFooter actually stores the number of persons in the address book, not in the filtered person list :P But well, seems like we can't do anything about this.

@CanIHasReview-bot
Copy link

v3

@yamgent submitted v3 for review.

(📚 Archive) (📈 Interdiff between v2 and v3)

Checkout this PR version locally
git fetch https://github.com/se-edu/addressbook-level4.git refs/pr/803/3/head:BRANCHNAME

where BRANCHNAME is the name of the local branch you wish to fetch this PR to.

@yamgent yamgent mentioned this pull request Aug 4, 2018
7 tasks
@CanIHasReview-bot
Copy link

v4

@yamgent submitted v4 for review.

(📚 Archive) (📈 Interdiff between v3 and v4) (📈 Range-Diff between v3 and v4)

Checkout this PR version locally
git fetch https://github.com/se-edu/addressbook-level4.git refs/pr/803/4/head:BRANCHNAME

where BRANCHNAME is the name of the local branch you wish to fetch this PR to.

@yamgent yamgent requested a review from a team August 9, 2018 05:59
@pyokagan
Copy link
Contributor

pyokagan commented Aug 9, 2018

Seems like adjustments for the following commits were made:

  • 9eac635 (Refactor codebase to use java.nio.file for file/path handling, 2018-04-21)

  • 1b4a6a7 (DarkTheme.css: update styleClass to stack-pane, 2018-04-01)

Would be nice if the other PRs had some kind of similar changelog.

@pyokagan
Copy link
Contributor

pyokagan commented Aug 9, 2018

Would be nice if the other PRs had some kind of similar changelog.

So we can tell if the way the conflicts were resolved are correct or not.

In order to determine the total number of contacts in the address book,
the user has to scroll the list all the way down to the last person, as
the ID of the last person gives an indication of the total number of
persons.

This forces the user to use the graphical user interface to find such an
information.

Let's modify StatusBarFooter so that it shows the total number of
persons in the current address book.
The application now shows the total number of persons in the address
book on the status bar.

Let's modify the system tests to verify the new behavior.
@CanIHasReview-bot
Copy link

v5

@yamgent submitted v5 for review.

(📚 Archive) (📈 Interdiff between v4 and v5) (📈 Range-Diff between v4 and v5)

Checkout this PR version locally
git fetch https://github.com/se-edu/addressbook-level4.git refs/pr/803/5/head:BRANCHNAME

where BRANCHNAME is the name of the local branch you wish to fetch this PR to.

@yamgent
Copy link
Member Author

yamgent commented Aug 18, 2018

This PR had to be rebased again due to conflicts. No other changes otherwise (i.e. no requested changes because there isn't one).

  • 76d8e4e: StatusBarFooterHandle.java - removed the use of this. in both the constructor and setTotalPersons().
  • fe696a3: AddressBookSystemTest.java - since assertApplicationStartingStateIsCorrect() no longer uses try/catch, had to make sure the new code was like that as well.

@yamgent yamgent requested a review from a team August 18, 2018 12:59
@yamgent yamgent requested a review from damithc August 19, 2018 02:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr.Answer Pull request is answer for a tutorial in developer guide. Do not actually merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants