-
Notifications
You must be signed in to change notification settings - Fork 864
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
Make history page remember last query string & search limit #5192
base: development
Are you sure you want to change the base?
Make history page remember last query string & search limit #5192
Conversation
I understand where you're are coming from but this behavior is also not apparent in Playlists tab, Channel tab, and a Channel page. Channel page one also applies to Nr 6 on the list of issue #2446 which is a way bigger issue Just to clarify im not against this but I think we should do it for all pages instead of one for the sake of a consistent UX |
I'd also like to know rationale, as I don't see any requests for this. I'm not necessarily opposed to it, but I don't have any reason to believe that the app remembering my last query would cause fewer irksome moments than the app not remembering it. |
Making it work like search query page |
If you want, you can share the build & I can try it out for a while in personal use. It sounds nice in theory, but it feels more horizontal of a change for the use cases where you want to go to the initial page state & now have to click to clear the input. The search bar is also omnipresent, so you wouldn't ever forget what was going on, but here I could see it leading to momentary confusion and re-familiarizing yourself with the context of what's going on & what you were searching beforehand. Seems like maybe "open in a new tab" covers the type of use case you're mentioning better (albeit I guess not if you didn't expect to misclick). |
434c7d5
to
cfbda54
Compare
Used About the Update 1: Use my custom build if you want - https://github.com/PikachuEXE/FreeTube/actions/runs/9345433122 |
Just retested it but my opinion on this hasnt changed. |
@efb4f5ff-1298-471a-8973-3d47447115dc |
That sounds like it would be a pretty sizable change to the codebase for a small feature. I would personally advise putting this one on the backburner just because I'm not sure if the feature would provide enough utility versus the effort to maintain it. |
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Sure:
|
Q: Why does it take a while for the thumbnails to appear when navigating back to the History tab? Why isnt it instantly shown? VirtualBoxVM_bZgbgCWrV7.mp4 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
3c71c71
to
987b10a
Compare
Fixed |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Also done but for the Creator Channel page one I am not really confident (even though I tested it a bit |
Change if (isNewSearch) {
this.searchResults = results
} else {
this.searchResults = this.searchResults.concat(results)
} to if (isNewSearch) {
this.searchResults = results
results.forEach(e => {
if (e.type === 'video') console.log(`${e.type}: ${e.videoId}`)
else if (e.type === 'playlist') console.log(`${e.type}: ${e.playlistId}`)
else console.log(`${e.type}`)
})
} else {
this.searchResults = this.searchResults.concat(results)
}
|
* development: (35 commits) Translated using Weblate (Hungarian) Translated using Weblate (French) Translated using Weblate (Chinese (Simplified Han script)) Translated using Weblate (Serbian) Translated using Weblate (Italian) Translated using Weblate (English (United Kingdom)) Translated using Weblate (French) Translated using Weblate (Czech) Translated using Weblate (Bulgarian) Translated using Weblate (Italian) Translated using Weblate (Turkish) Translated using Weblate (German) Translated using Weblate (Spanish) Add Playlist Sort By Video Duration (FreeTubeApp#5627) Translated using Weblate (Estonian) Translated using Weblate (Italian) Translated using Weblate (French) Translated using Weblate (Chinese (Simplified Han script)) Translated using Weblate (Serbian) Translated using Weblate (Serbian) ...
I can simply find a channel and type something on search input and keep pressing enter and gets results sorted slightly differently sometimes Update 1: If you try IV API it's even more random, I even saw a playlist jump to 3rd place once Screen.Recording.2024-10-12.at.16.20.05.mp4 |
As the goal of this pull request seems to have changed a lot, could you please update the pull request description and title with what this pull request actually does. |
@absidue |
It briefly shows that there are 0 results for the search i made before showing the actual search results VirtualBoxVM_POiZPMF3AU.mp4Edit: it also seems to do this on dev branch so i dont think its related to this PR but i could be wrong. |
* development: (30 commits) Translated using Weblate (Azerbaijani) Translated using Weblate (French) Translated using Weblate (Estonian) Bump the babel group with 3 updates (FreeTubeApp#5858) Bump electron-builder from 25.1.7 to 25.1.8 (FreeTubeApp#5862) Bump stylelint from 16.9.0 to 16.10.0 in the stylelint group (FreeTubeApp#5860) Bump the eslint group with 2 updates (FreeTubeApp#5859) Bump globals from 15.10.0 to 15.11.0 (FreeTubeApp#5861) Bump sass from 1.79.4 to 1.79.5 (FreeTubeApp#5863) Bump electron from 32.1.2 to 32.2.0 (FreeTubeApp#5864) Translated using Weblate (Icelandic) Translated using Weblate (Russian) Translated using Weblate (Hebrew) Translated using Weblate (Chinese (Traditional Han script)) Translated using Weblate (Italian) Translated using Weblate (Chinese (Simplified Han script)) Translated using Weblate (Serbian) Translated using Weblate (Czech) Translated using Weblate (Japanese) Translated using Weblate (Portuguese (Brazil)) ...
@efb4f5ff-1298-471a-8973-3d47447115dc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are now adding the data limits to the URLs, there isn't really a need to duplicate them into session storage too, so we can probably remove that code.
Additionally the code for the channel page seems a bit messy, but in an unusual move for me I think I would be okay with it, assuming that it will be refactored soon anyway when we migrate the component to the composition API or start saving the selected tab in the URL, whichever happens sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To future after RC reviewer me: LGTM
@absidue I can make a PR later for storing |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
* development: (273 commits) Translated using Weblate (Serbian) Translated using Weblate (Czech) Translated using Weblate (French) Translated using Weblate (German) Translated using Weblate (Spanish) Fix text colour in player overflow menu (FreeTubeApp#6213) Add warning message to proxy settings (FreeTubeApp#6099) Migrate SubscribedChannels view to Composition API (FreeTubeApp#6131) Translated using Weblate (Croatian) Translated using Weblate (English (United Kingdom)) Translated using Weblate (Afrikaans) Translated using Weblate (Afrikaans) Better player error handling (FreeTubeApp#6180) Translated using Weblate (Arabic) Translated using Weblate (Afrikaans) local API: Fix playlists and podcasts not appearing in search results (FreeTubeApp#6196) Translated using Weblate (Serbian) Translated using Weblate (Hungarian) Bump shaka-player from 4.11.11 to 4.12.1 (FreeTubeApp#6193) Translated using Weblate (French) ... # Conflicts: # src/renderer/views/SubscribedChannels/SubscribedChannels.js
Conflicts have been resolved. A maintainer will review the pull request shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't got round to testing the pull request yet, so for the moment here is a code review with a bunch suggestions and one question.
@@ -207,6 +207,7 @@ | |||
v-if="showSearchBar" | |||
ref="searchBar" | |||
:placeholder="$t('Channel.Search Channel')" | |||
:value="props.query" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:value="props.query" | |
:value="query" |
class="card channelDetails" | ||
@change-tab="changeTab" | ||
@search="newSearch" | ||
@search="(v) => newSearchWithStatePersist(v)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@search="(v) => newSearchWithStatePersist(v)" | |
@search="newSearchWithStatePersist" |
;(() => { | ||
document.addEventListener('keydown', keyboardShortcutHandler) | ||
getSubscription() | ||
}) | ||
|
||
const oldQuery = route.query.searchQueryText ?? '' | ||
if (oldQuery !== null && oldQuery !== '') { | ||
// `handleQueryChange` must be called after `filterHistoryDebounce` assigned | ||
handleQueryChange(oldQuery, true) | ||
} | ||
})() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain why you changed this from an onMounted callback to an immediately invoked function?
await this.$router.replace({ path: `/channel/${this.id}` }).catch(failure => { | ||
if (isNavigationFailure(failure, NavigationFailureType.duplicated)) { | ||
return | ||
} | ||
|
||
throw failure | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the code more readable please pick one of the Promise syntaxes either async-await or chaining, instead of combining both of them. When using async-await, you can just use a normal try-catch.
This suggestion applies to all files that have this construct introduced by this pull request.
Pull Request Type
Related issue
Description
Make several page types remember last query string & search limit to deal with
Page types:
Screenshots
No video I am lazy
Testing
Desktop
Additional context
There are 2 commits & first one is refactor
Might easier to review per commit