Don't add analysis view to stack if already in it.#580
Merged
Conversation
Before this commit, if a user pressed `v` multiple times, they would have to press `q` the same number of times to get to the previous view. This commit makes it so that an analysis view entry is only pushed into the navigation stack if the current view isn't an analysis one.
Contributor
Author
|
I think this might be an issue with most views, but it would be quite complex to add it for the others, such as album and artist ones. So I still think it makes sense to add it for this specific one. |
Owner
|
@all-contributors please add @ericonr for code |
Contributor
|
I've put up a pull request to add @ericonr! 🎉 |
Contributor
Author
|
@Rigellute I was thinking of checking if analysis was the current view in the function that pushes it into the stack, but to make that work we'd probably require a bigger design change. I am interested in trying to look into this to make it more generalized. Perhaps return an error from the function that pushes into the stack if the current view is the same? And use that as a conditional for the other actions? |
lanej
pushed a commit
to lanej/spotify-tui
that referenced
this pull request
Jul 13, 2021
Before this commit, if a user pressed `v` multiple times, they would have to press `q` the same number of times to get to the previous view. This commit makes it so that an analysis view entry is only pushed into the navigation stack if the current view isn't an analysis one.
nighi
pushed a commit
to nighi/spotify-tui
that referenced
this pull request
Jul 11, 2025
Before this commit, if a user pressed `v` multiple times, they would have to press `q` the same number of times to get to the previous view. This commit makes it so that an analysis view entry is only pushed into the navigation stack if the current view isn't an analysis one.
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.
Before this commit, if a user pressed
vmultiple times, they wouldhave to press
qthe same number of times to get to the previous view.This commit makes it so that an analysis view entry is only pushed into
the navigation stack if the current view isn't an analysis one.