Skip to content
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

Upgrade dependencies and other improvements #853

Closed
wants to merge 8 commits into from
Closed

Upgrade dependencies and other improvements #853

wants to merge 8 commits into from

Conversation

rkashapov
Copy link

Thank you for the great UI for mopidy!

I've upgraded the dependencies and implemented some improvements:

  • Load playlist info appeared in Browse page. Previously it displayed "0 tracks" for any playlist there
  • Load subdirectories covers on the Browse page. Previously album art wasn't loaded for directory ref types.
  • Display extension-defined covers for top-level directories on the Browse page.
  • Don't display directories as tiles on the Browse page.
  • Pass title argument for subdirectory names.
  • Removed static directory content. It is populated while building frontend.

Sorry for the big diff

Copy link
Owner

@jaedb jaedb left a comment

Choose a reason for hiding this comment

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

There are a lot of mixed-purpose changes in this one PR, making it a difficult branch to code review. The work you've done on upgrading React Router is great though, something I've struggled to find the time for 👌

A few minor changes required, but overall looks pretty good. The key to preparing this for release will be throughly testing every component that was touched by the upgrades. Unit tests are very lacking so do not provide enough confidence without manual user testing. Once you've confirmed all is working well then we can schedule the release.

Comment on lines +413 to +423
socket.on('state:online', (data) => handleMessage(socket, store, 'state:online', data));
socket.on('state:offline', (data) => handleMessage(socket, store, 'state:offline', data));
socket.on('event:tracklistChanged', (data) => handleMessage(socket, store, 'event:tracklistChanged', data));
socket.on('event:playbackStateChanged', (data) => handleMessage(socket, store, 'event:playbackStateChanged', data));
socket.on('event:seeked', (data) => handleMessage(socket, store, 'event:seeked', data));
socket.on('event:trackPlaybackEnded', (data) => handleMessage(socket, store, 'event:trackPlaybackEnded', data));
socket.on('event:trackPlaybackStarted', (data) => handleMessage(socket, store, 'event:trackPlaybackStarted', data));
socket.on('event:volumeChanged', (data) => handleMessage(socket, store, 'event:volumeChanged', data));
socket.on('event:muteChanged', (data) => handleMessage(socket, store, 'event:muteChanged', data));
socket.on('event:optionsChanged', (data) => handleMessage(socket, store, 'event:optionsChanged', data));
socket.on('event:streamTitleChanged', (data) => handleMessage(socket, store, 'event:streamTitleChanged', data));
Copy link
Owner

Choose a reason for hiding this comment

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

What is the background to this change? Did you observe issues with listening to all emitted events?

@@ -1,5 +1,6 @@
/node_modules/
/Mopidy_Iris.egg-info/
/mopidy_iris/statc/*
Copy link
Owner

Choose a reason for hiding this comment

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

Typo, should be /mopidy_iris/static/*

@@ -10,86 +10,87 @@
},
"main": "app.js",
"dependencies": {
Copy link
Owner

Choose a reason for hiding this comment

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

What has been the process for working through these upgrades? Each dependency upgrade needs testing in isolation (especially high-impact dependencies like react, react-dnd, react-redux, etc). Upgrading in bulk like this is not ideal. Instead I would recommend a separate branch and pull request for each group of upgrades (ie react-based dependencies in one branch).

How much testing have you performed against these upgrades?

Comment on lines +295 to +296
<Route path="modal/*" element={<Modals />} />
<Route path="*" element={<Content />} />
Copy link
Owner

Choose a reason for hiding this comment

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

This is pretty neat, I like the approach here 👍

@@ -78,7 +79,7 @@ const GridItem = ({
type: item?.type?.toUpperCase() || 'UNKNOWN',
item: { item, context: item },
});
const tile = ['playlist_group', 'mood', 'directory', 'category'].indexOf(item?.type) > -1
Copy link
Owner

Choose a reason for hiding this comment

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

What is the reason for removing directory from the tile-like rendering style?

subdirectories: subdirectoriesWithImages,
},
});
const playlistsLoaded = new Promise((resolve) => {
Copy link
Owner

Choose a reason for hiding this comment

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

This may cause really heavy, un-cancellable requests for slow backends or when the directory contains a lot of playlists. Depending on the backend provider, but this could result in the fetching of the entire playlist including its tracks.

Have you tested it against the likes of Mopidy-Ytmusic or Mopidy-Tidal?

Comment on lines +541 to +542
if (data.tracks && data.tracks_total !== undefined) {
playlist.tracks_total = data.tracks_total;
Copy link
Owner

Choose a reason for hiding this comment

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

From memory, this code was to pluck the total sub-property from the tracks object, which if provided, should trump the value of tracks.length. Most providers paginate their APIs, so the tracks.length would typically be that page, rather than the total count.

I recommend undoing this change unless there is a specific bug that relates to this.

Comment on lines +112 to +113
case 'bandcamp':
case 'Bandcamp':
Copy link
Owner

Choose a reason for hiding this comment

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

Given this returns the same as default, is this not redundant?

Comment on lines +214 to +217
<Route path="" element={<Services />} />
<Route path=":services/" element={<Services />} />
<Route path=":services/:service/" element={<Services />} />
<Route path=":services/:service/:id" element={<Services />} />
Copy link
Owner

Choose a reason for hiding this comment

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

If all sub-paths resolve to <Services /> couldn't we just use a wildcard path?

@@ -12,16 +11,13 @@ import * as uiActions from '../services/ui/actions';
import * as mopidyActions from '../services/mopidy/actions';
import * as spotifyActions from '../services/spotify/actions';
import { titleCase } from '../util/helpers';
import { withRouter } from '../util';
import { i18n } from '../locale';

class Search extends React.Component {
Copy link
Owner

Choose a reason for hiding this comment

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

This whole component needs a good bit of spring cleaning. Overhauling the UX and rewriting the logic from scratch is high on my agenda.

jaedb added a commit that referenced this pull request Sep 3, 2022
@jaedb
Copy link
Owner

jaedb commented Sep 24, 2022

@rkashapov any progress on making those review changes?

@jaedb
Copy link
Owner

jaedb commented Nov 13, 2022

@rkashapov I'm going to close this PR as I haven't had any feedback from you on this.

Some of the changes have been implemented in a separate branch, so thanks for your initial contribution!

@jaedb jaedb closed this Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants