Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
db4b49f
Implement user playlist grid view
kommunarr Apr 12, 2024
1b65a7c
Update to use listType setting for user playlist display type
kommunarr Apr 12, 2024
47e7dda
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 16, 2024
e46d897
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 17, 2024
8843c46
Implement styling fixes & adjustments
kommunarr Apr 17, 2024
5cabcc2
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 17, 2024
93e73db
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 17, 2024
8a89024
Update ft-refresh-widget to use fixed-top-bar mixin
kommunarr Apr 17, 2024
49c8165
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 18, 2024
c931596
Fix mixin
kommunarr Apr 18, 2024
0d8ce5c
Disable quick bookmark button on Quick Bookmark playlist
kommunarr Apr 18, 2024
7d2eec5
Fix isLoading artifact
kommunarr Apr 18, 2024
7e897e1
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 19, 2024
91f1e68
Implement missing Edit Mode properties for grid view
kommunarr Apr 21, 2024
a30687c
Make playlist title fixed height
kommunarr Apr 21, 2024
6684baf
Standardize gap between top bar and bottom section using CSS variable…
kommunarr Apr 21, 2024
70c8d30
Make effectiveListType computed property
kommunarr Apr 24, 2024
14f6036
Force list view on playlists for mobile devices
kommunarr Apr 24, 2024
1a47ec4
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr Apr 25, 2024
85503a6
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 2, 2024
c348a1a
Merge branch 'development' into feat/user-playlists-as-grid
kommunarr May 4, 2024
036712c
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 4, 2024
bc70bd0
Update to adjust height properly when playlist only has one item, not…
kommunarr May 4, 2024
ecc2866
Move is-side-nav-open and fixed-top-bar mixins to new partial file
kommunarr May 17, 2024
af1af9d
Add height threshold for forcing list view on playlist route
kommunarr May 19, 2024
a866963
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 20, 2024
63172c6
Make user playlist grid top section sticky, not fixed
kommunarr May 20, 2024
6faf21b
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into fe…
kommunarr May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Force list view on playlists for mobile devices
  • Loading branch information
kommunarr committed Apr 24, 2024
commit 14f603627ba29689f43d3ab2353c484cbaab93d8
6 changes: 5 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ const SyncEvents = {
// Utils
const MAIN_PROFILE_ID = 'allChannels'

// Width threshold in px at which we switch to using a more heavily altered view for mobile users
const MOBILE_WIDTH_THRESHOLD = 680

export {
IpcChannels,
DBActions,
SyncEvents,
MAIN_PROFILE_ID
MAIN_PROFILE_ID,
MOBILE_WIDTH_THRESHOLD
}
8 changes: 4 additions & 4 deletions src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FtSearchFilters from '../ft-search-filters/ft-search-filters.vue'
import FtProfileSelector from '../ft-profile-selector/ft-profile-selector.vue'
import debounce from 'lodash.debounce'

import { IpcChannels } from '../../../constants'
import { IpcChannels, MOBILE_WIDTH_THRESHOLD } from '../../../constants'
import { openInternalPath } from '../../helpers/utils'
import { translateWindowTitle } from '../../helpers/strings'
import { clearLocalSearchSuggestionsSession, getLocalSearchSuggestions } from '../../helpers/api/local'
Expand Down Expand Up @@ -98,7 +98,7 @@ export default defineComponent({
},
mounted: function () {
let previousWidth = window.innerWidth
if (window.innerWidth <= 680) {
if (window.innerWidth <= MOBILE_WIDTH_THRESHOLD) {
this.showSearchContainer = false
}

Expand All @@ -113,7 +113,7 @@ export default defineComponent({
// Don't change the status of showSearchContainer if only the height of the window changes
// Opening the virtual keyboard can trigger this resize event, but it won't change the width
if (previousWidth !== window.innerWidth) {
this.showSearchContainer = window.innerWidth > 680
this.showSearchContainer = window.innerWidth > MOBILE_WIDTH_THRESHOLD
previousWidth = window.innerWidth
}
})
Expand All @@ -124,7 +124,7 @@ export default defineComponent({
goToSearch: async function (query, { event }) {
const doCreateNewWindow = event && event.shiftKey

if (window.innerWidth <= 680) {
if (window.innerWidth <= MOBILE_WIDTH_THRESHOLD) {
this.$refs.searchContainer.blur()
this.showSearchContainer = false
} else {
Expand Down
1 change: 0 additions & 1 deletion src/renderer/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/* stylelint-disable length-zero-no-unit */
--top-bar-push-down-adjustment-has-description: 0px;
--top-bar-push-down-adjustment-edit-mode: 0px;
--top-bar-push-down-adjustment-mobile: 0px;
--top-bar-push-down-adjustment-empty: 0px;
/* stylelint-enable length-zero-no-unit */
}
Expand Down
13 changes: 12 additions & 1 deletion src/renderer/views/Playlist/Playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '../../helpers/api/local'
import { extractNumberFromString, setPublishedTimestampsInvidious, showToast } from '../../helpers/utils'
import { invidiousGetPlaylistInfo, youtubeImageUrlToInvidious } from '../../helpers/api/invidious'
import { MOBILE_WIDTH_THRESHOLD } from '../../../constants'

const SORT_BY_VALUES = {
DateAddedNewest: 'date_added_descending',
Expand Down Expand Up @@ -75,6 +76,7 @@ export default defineComponent({
isLoadingMore: false,
getPlaylistInfoDebounce: function() {},
playlistInEditMode: false,
forceListView: false,

videoSearchQuery: '',

Expand Down Expand Up @@ -104,7 +106,7 @@ export default defineComponent({
return this.$route.params.id
},
listType: function () {
return this.isUserPlaylistRequested ? this.$store.getters.getListType : 'list'
return this.isUserPlaylistRequested && !this.forceListView ? this.$store.getters.getListType : 'list'
},
userPlaylistsReady: function () {
return this.$store.getters.getPlaylistsReady
Expand Down Expand Up @@ -285,6 +287,11 @@ export default defineComponent({
},
mounted: function () {
this.getPlaylistInfoDebounce()
this.forceListView = window.innerWidth <= MOBILE_WIDTH_THRESHOLD
window.addEventListener('resize', this.handleResize)
},
beforeDestroy: function () {
window.removeEventListener('resize', this.handleResize)
},
methods: {
getPlaylistInfo: function () {
Expand Down Expand Up @@ -562,6 +569,10 @@ export default defineComponent({
}
},

handleResize: function () {
this.forceListView = window.innerWidth <= MOBILE_WIDTH_THRESHOLD
},

...mapActions([
'updateSubscriptionDetails',
'updatePlaylist',
Expand Down
14 changes: 1 addition & 13 deletions src/renderer/views/Playlist/Playlist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

&.grid {
flex-direction: column;
margin-block-start: calc(var(--top-bar-push-down-adjustment-default) + var(--top-bar-push-down-adjustment-edit-mode) + var(--top-bar-push-down-adjustment-mobile) + var(--top-bar-push-down-adjustment-has-description) + var(--top-bar-push-down-adjustment-empty));
margin-block-start: calc(var(--top-bar-push-down-adjustment-default) + var(--top-bar-push-down-adjustment-edit-mode) + var(--top-bar-push-down-adjustment-has-description) + var(--top-bar-push-down-adjustment-empty));

&.hasPlaylistDescription {
--top-bar-push-down-adjustment-has-description: 19px;
Expand Down Expand Up @@ -158,15 +158,3 @@
.message {
color: var(--tertiary-text-color);
}

@media only screen and (width <= 680px) {
.routerView{
&.grid {
--top-bar-push-down-adjustment-mobile: 20px;

.playlistInfoContainer {
position: absolute;
}
}
}
}