implement a metadata view for tracks
ClosedPublic

Authored by astippich on Jan 6 2018, 9:10 AM.

Details

Summary

implements a metadata view for the albumview and alltracksview. metadataview is based on a popup and currently read only.
can be accessed by the new info button for each track. the view is ready for more metadata than currently is available, but does autoresizing depending on what is available
Fixes T6345

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich requested review of this revision.Jan 6 2018, 9:10 AM
astippich created this revision.

Took me quite a while to get everything right regarding positioning etc., but here it is. Two screenshots:


The position of the popup (below or above) is determined by the available size in the listview.
Let me know what you think.

mgallien requested changes to this revision.Jan 7 2018, 9:22 PM

This is really starting to look good. Thanks for your work.
I noticed a couple issues.
The list view for the metadata can be dragged with mouse and overshoot. I have set this off in the other views. I suppose that it would be better to be coherent. What do you think ?

What do you think of making the metadata popup be a proper windows that one can move, hide or close ? That would enable to morph it into a metadata editor if we want to add one (probably expected in a music player).

We could also modify the model to provide all metadata in a hashmap or other way easier on the qml (not needing to manage each data directly). That may be a proper model and is quite fast and easy to do.

This revision now requires changes to proceed.Jan 7 2018, 9:22 PM

One more question. Why do you not make the current window a tooltip other tracks and a real windows (i.e. with the module QtQuick.Window) when clicking the button ?

astippich updated this revision to Diff 24959.Jan 8 2018, 7:11 PM
  • make listview non-interactive and add width to windows theme

This is really starting to look good. Thanks for your work.
I noticed a couple issues.
The list view for the metadata can be dragged with mouse and overshoot. I have set this off in the other views. I suppose that it would be better to be coherent. What do you think ?

I didn't even notice, thanks. I've fixed this in the latest revision.

What do you think of making the metadata popup be a proper windows that one can move, hide or close ? That would enable to morph it into a metadata editor if we want to add one (probably expected in a music player).

Actually that was my long-term plan consisting of:

  1. Get a basic metadata view working (which this diff implements and I think is already useful)
  2. Make all metadata (year, genre, composer etc.) available in the data model and display
  3. Implement editing capabilities
  4. Transform this into a editor

But right now I would like to keep it as is. I want to keep it this way as long as it is read-only so that users do not expect editing capabilities at this point.

We could also modify the model to provide all metadata in a hashmap or other way easier on the qml (not needing to manage each data directly). That may be a proper model and is quite fast and easy to do.

Yes, that sounds like a good idea. I will look into it.

One more question. Why do you not make the current window a tooltip other tracks and a real windows (i.e. with the module QtQuick.Window) when clicking the button ?

When I first started to work on this I wanted to do exactly this.
The look and behavior was roughly inspired by how Cantata metadata hover works. The button was added for touchscreen use cases. andreask reasoned that a hover should not be needed and all required information should be displayed in the view, which I agree with. Hence I removed the hover effect.

This is really starting to look good. Thanks for your work.
I noticed a couple issues.
The list view for the metadata can be dragged with mouse and overshoot. I have set this off in the other views. I suppose that it would be better to be coherent. What do you think ?

I didn't even notice, thanks. I've fixed this in the latest revision.

What do you think of making the metadata popup be a proper windows that one can move, hide or close ? That would enable to morph it into a metadata editor if we want to add one (probably expected in a music player).

Actually that was my long-term plan consisting of:

  1. Get a basic metadata view working (which this diff implements and I think is already useful)
  2. Make all metadata (year, genre, composer etc.) available in the data model and display
  3. Implement editing capabilities
  4. Transform this into a editor

    But right now I would like to keep it as is. I want to keep it this way as long as it is read-only so that users do not expect editing capabilities at this point.

It is really useful in the current form and I like your plan.

Given that the metadata are currently coming from KFileMetaData, it could be useful to check what is needed there and do it as soon as it is possible. I did some work to allow to manage multiple artists in the database but the work is not yet finished.

We could also modify the model to provide all metadata in a hashmap or other way easier on the qml (not needing to manage each data directly). That may be a proper model and is quite fast and easy to do.

Yes, that sounds like a good idea. I will look into it.

One more question. Why do you not make the current window a tooltip other tracks and a real windows (i.e. with the module QtQuick.Window) when clicking the button ?

When I first started to work on this I wanted to do exactly this.
The look and behavior was roughly inspired by how Cantata metadata hover works. The button was added for touchscreen use cases. andreask reasoned that a hover should not be needed and all required information should be displayed in the view, which I agree with. Hence I removed the hover effect.

Did you try also to change the height of the row to display the same information but at the same place (a bit like an extended version of the delegate) ?

Anyway, I will try again the new version and report here.

I have few small comments:

  • the colon is french has a space before and after. You should probably have a look at a way to have the whole string given to i18n functions. You can use placeholder like %1. @ltoscano and others in @kde-i18n-doc can probably give useful advice on this subject;
  • It would feel more natural to me to have the item being shown to also be selected in the ListView (i.e. made the current item) ;
  • what do you think of also adding it to the playlist ? Maybe this can be done in a latter diff.

I have given the whole thing a little more thought with your feedback. Changing the row height and displaying more information this way is quite a neat idea which I didn't think of. I think it makes sense to wait with this until the metadata view has editing capabilities though, as otherwise this would simply be a duplication feature-wise.

While I previously didn't want to add this popup to the playlist so that in doesn't get too packed with buttons, we should probably do this. The user will likely want to read the metadata of the files currently playing, but searching in the whole library is not very intuitive. The current popup version will not work for the playlist due to size and positioning. But a proper window can be displayed anywhere and would work.
So I will change that like you suggested. This shouldn't be too complicated.

I have few small comments:

  • the colon is french has a space before and after. You should probably have a look at a way to have the whole string given to i18n functions. You can use placeholder like %1. @ltoscano and others in @kde-i18n-doc can probably give useful advice on this subject;

Sorry, I don't fully understand. Do you mean that the colon must also be added for translation?

  • It would feel more natural to me to have the item being shown to also be selected in the ListView (i.e. made the current item) ;
  • what do you think of also adding it to the playlist ? Maybe this can be done in a latter diff.

I have given the whole thing a little more thought with your feedback. Changing the row height and displaying more information this way is quite a neat idea which I didn't think of. I think it makes sense to wait with this until the metadata view has editing capabilities though, as otherwise this would simply be a duplication feature-wise.

OK, that sounds a good plan. In general, I kinda like those can of extended view with extra information or editing capability. What do you think ?

While I previously didn't want to add this popup to the playlist so that in doesn't get too packed with buttons, we should probably do this. The user will likely want to read the metadata of the files currently playing, but searching in the whole library is not very intuitive. The current popup version will not work for the playlist due to size and positioning. But a proper window can be displayed anywhere and would work.
So I will change that like you suggested. This shouldn't be too complicated.

If I understand correctly, the Popup component has to be positioned by the code and this is what is important here ?

I have few small comments:

  • the colon is french has a space before and after. You should probably have a look at a way to have the whole string given to i18n functions. You can use placeholder like %1. @ltoscano and others in @kde-i18n-doc can probably give useful advice on this subject;

Sorry, I don't fully understand. Do you mean that the colon must also be added for translation?

Yes I think so. We can ask on the kde-i18n-doc mailing list.

  • It would feel more natural to me to have the item being shown to also be selected in the ListView (i.e. made the current item) ;
  • what do you think of also adding it to the playlist ? Maybe this can be done in a latter diff.
aacid added a subscriber: aacid.Jan 10 2018, 7:46 PM

Unless strictly necessary (which is almost never), do *not* concatenate translatable strings

why would you do

text: i18nc("Rating label for information panel", "Rating") + ": "

instead of

text: i18nc("Rating label for information panel", "Rating:")

?

In D9696#189051, @aacid wrote:

Unless strictly necessary (which is almost never), do *not* concatenate translatable strings

why would you do

text: i18nc("Rating label for information panel", "Rating") + ": "

instead of

text: i18nc("Rating label for information panel", "Rating:")

?

I somehow thought that colons as a generic separator should not be translated, but I was obviously wrong here.

I have given the whole thing a little more thought with your feedback. Changing the row height and displaying more information this way is quite a neat idea which I didn't think of. I think it makes sense to wait with this until the metadata view has editing capabilities though, as otherwise this would simply be a duplication feature-wise.

OK, that sounds a good plan. In general, I kinda like those can of extended view with extra information or editing capability. What do you think ?

While I like the idea for a detailed and read-only view, I'm not really convinced for editing purposes. But I'll have to try at some point.

While I previously didn't want to add this popup to the playlist so that in doesn't get too packed with buttons, we should probably do this. The user will likely want to read the metadata of the files currently playing, but searching in the whole library is not very intuitive. The current popup version will not work for the playlist due to size and positioning. But a proper window can be displayed anywhere and would work.
So I will change that like you suggested. This shouldn't be too complicated.

If I understand correctly, the Popup component has to be positioned by the code and this is what is important here ?

I think there is just not enough space in order to position the popup above the playlist view. But if it's a window it doesn't matter.

I have few small comments:

  • the colon is french has a space before and after. You should probably have a look at a way to have the whole string given to i18n functions. You can use placeholder like %1. @ltoscano and others in @kde-i18n-doc can probably give useful advice on this subject;

Sorry, I don't fully understand. Do you mean that the colon must also be added for translation?

Yes I think so. We can ask on the kde-i18n-doc mailing list.

  • It would feel more natural to me to have the item being shown to also be selected in the ListView (i.e. made the current item) ;

Shall we do this for every button or just the information button?

astippich updated this revision to Diff 25315.Jan 14 2018, 2:06 PM
  • convert to dialog
  • also add metadata view to playlist
astippich updated this revision to Diff 25318.Jan 14 2018, 2:08 PM
  • remove now unneeded flickable object var
mgallien requested changes to this revision.Jan 14 2018, 10:02 PM
  • convert to dialog
  • also add metadata view to playlist

Good job.
I have noticed that the title (for example) does not get properly truncated when too long to fit the size of the dialog.
I will finish as soon as possible to review but this is looking good to me.

This revision now requires changes to proceed.Jan 14 2018, 10:02 PM

I have given the whole thing a little more thought with your feedback. Changing the row height and displaying more information this way is quite a neat idea which I didn't think of. I think it makes sense to wait with this until the metadata view has editing capabilities though, as otherwise this would simply be a duplication feature-wise.

OK, that sounds a good plan. In general, I kinda like those can of extended view with extra information or editing capability. What do you think ?

While I like the idea for a detailed and read-only view, I'm not really convinced for editing purposes. But I'll have to try at some point.

No problem from my side.

While I previously didn't want to add this popup to the playlist so that in doesn't get too packed with buttons, we should probably do this. The user will likely want to read the metadata of the files currently playing, but searching in the whole library is not very intuitive. The current popup version will not work for the playlist due to size and positioning. But a proper window can be displayed anywhere and would work.
So I will change that like you suggested. This shouldn't be too complicated.

If I understand correctly, the Popup component has to be positioned by the code and this is what is important here ?

I think there is just not enough space in order to position the popup above the playlist view. But if it's a window it doesn't matter.

Yes, but my point about selecting the track was only linked to the popup. With the dialog, I do not think it is useful or necessary.

astippich updated this revision to Diff 25415.Jan 15 2018, 8:12 PM
  • fix text elide
mgallien accepted this revision.Jan 15 2018, 9:19 PM

Thanks. As a later diff, could you provide tooltips for elided labels ?

This revision is now accepted and ready to land.Jan 15 2018, 9:19 PM
This revision was automatically updated to reflect the committed changes.