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.
This addresses the missing parts from issue #1612. While I already made F6 (research view) and F12 (spaceship view) work as a toggle, making F7 (wonders of the world), F8 (top 5 cities) and F11 (demographics) work like that is a bit special.
These reports are generic notification popups, which the server triggers to be displayed. The flow is
popup_notify_dialog
This PR changes the behavior of subsequent calls to
popup_notify_dialog
. The former behavior was to refresh an existing notification, the new behavior is to close the existing notification. The notification to be manipulated is, in both cases, identified by caption and headline.A drawback of this implementation is, that toggling a report still needs a round-trip to the server:
Keeping state in the client and closing the notifications without involving the server would require the usage of magic strings to identify relevant notification (this implementation does use string comparisons too, but these strings are provided by the server and, at least from the clients perspective, less magic).
Giving the notifications an "identity" would require either changes in the server and the protocol, or the client would need to deduce it by using magic strings.