-
-
Notifications
You must be signed in to change notification settings - Fork 419
PICARD-2103: Add UI to manage custom columns #2714
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
PICARD-2103: Add UI to manage custom columns #2714
Conversation
I haven't looked at this in detail yet, but have some initial thoughts:
|
I see that many of the files in this PR are also in the API PR #2709 (which you indicated must be merged first). This makes the review of this PR much more difficult because we're either reviewing the same changes twice (in this PR and PR #2709) or it isn't clear what changes in this PR will be applied to modify the changes in PR #2709. My suggestion is that we wait until PR #2709 is merged, and this PR rebased before we review this PR in detail. |
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.
Overall that's a good move, but that's also a lot of changes at once.
I didn't test (just reviewed code), I'll do later.
Also I wonder about how it fits with plugin V3 (we tried to regroup "API" access in picard/extension_points)
Persistence is saved to the global |
I disagree, as adding these menu/dialogs there to an already crowded Options/Settings page. The |
However, as currently handled it is not being managed through option profiles. |
@zas / @phw what are your thoughts on this? My thinking is that by including these under Option Settings we can have a standardized approach (based on something like the tagger scripts page), the UI settings will be accessed in one place, and it will allow the Custom Columns settings to be managed via option profiles. |
As-is, it's pretty seamless to the user (it's opaque to them where these settings get saved). What's the advantage of moving it to profiles? To the user? To the dev? |
c8e47a9
to
63ed30b
Compare
Last night, instead of sleeping, I spent a few hours thinking about this UI and how I believe it should be set up. I offer the following for consideration:
I believe that this would provide the most flexibility while remaining consistent and intuitive in accessing the configuration. The learning curve and impact to the users should be minimal. |
Also, imo column definitions should only be defined once per column/per use-case, in the spirit of DRY. Then they can/should be mapped to different profiles/views. |
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.
Nice. Just a few initial comments after looking at the UI. I'll do a code review once #2709 has been merged.
- It's uncommon to have a "apply" and a "close" button in Picard. We should be consistent and have a button that saves the changes and closes the dialog and a cancel button that closes the dialog without saving changes.
- As a user I couldn't figure out how the "field" column type works. From reading the code I should be able to set one of those field names we use for the standard columns (which gets resolved by the
column
function of the underlying object), but this didn't give me results.
In any case this is a bit difficult option, even if it seems simpler then the script option on first sight. The "column" names currently are an implementation detail. They can be exactly metadata names, but we also have special ones. Maybe if we offer such option we should provide the user with a select box for choosing a value. The values available probably would be a mix of default columns and known metadata tags. - The alignment values in the UI should be lowercase "left" and "right" and be marked as translatable.
- Saving and applying the changes seems a bit wonky. Actual making new columns visible seems to require a restart. And I also managed it somehow to get all custom columns hidden again after editing the custom columns.
- I don't think we need the insert after input. The UI is confusing, and it exposes some internal implementation that does not necessarily reflect actual visual columns position. See my comment at #2709 (comment)
@zas / @phw what are your thoughts on this? My thinking is that by including these under Option Settings we can have a standardized approach (based on something like the tagger scripts page), the UI settings will be accessed in one place, and it will allow the Custom Columns settings to be managed via option profiles.
I actually like the approach here of adding it to the columns context menu. This is already used to customize columns displayed, together with other actions like resizing and reordering which is also done on the header.
I think we'll need to refactor the context menu a bit as one of the next steps, though. It has become quite long. We could add submenus and group the columns a bit. But that's something for a PR afterwards.
Regardless of the UI, I still think it would be good to have the selected columns and position settings managed through the option profiles. |
@phw I struggled with this too. Attempts to make newly created columns in a "live" manner required touching |
Thanks. Will fix. (Grumble: I hate UI dev lol. So many bugs and logical pathways that can go wrong) |
Which is one of the reasons I will usually start with the UI and then build (tweak) the back end to accommodate. I find that having a good vision and understanding of the desired end product (especially the user-facing ones) from the start helps. |
This is the fix: Unchecking views should de-register col from view |
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.
View toggling now works well.
I managed to crash Picard using a Numeric Sort on a %tracknumber%
column.
TypeError: '<' not supported between instances of 'float' and 'QCollatorSortKey'
Traceback (most recent call last):
File "/home/zas/src/picard/picard/ui/itemviews/__init__.py", line 383, in __lt__
return self.sortkey(column) < other.sortkey(column)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'QCollatorSortKey' and 'float'
Traceback (most recent call last):
File "/home/zas/src/picard/picard/ui/itemviews/__init__.py", line 383, in __lt__
return self.sortkey(column) < other.sortkey(column)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'QCollatorSortKey' and 'float'
Traceback (most recent call last):
File "/home/zas/src/picard/picard/ui/itemviews/__init__.py", line 383, in __lt__
return self.sortkey(column) < other.sortkey(column)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'QCollatorSortKey' and 'float'
Traceback (most recent call last):
File "/home/zas/src/picard/picard/ui/itemviews/__init__.py", line 383, in __lt__
return self.sortkey(column) < other.sortkey(column)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Co-authored-by: Laurent Monin <lmonin.zas@gmail.com>
I can't repro this. This is a screencast using numeric and descending numeric on Windows. https://1drv.ms/v/c/0e7c7882e6da112b/EerZviwrTCZPv0oZJDAie74B1H3LYJNEaqLUX5_NZeikpw?e=LmTElu What OS did you see this on? With what files? EDIT: Confirmed sorting numeric working on macos too. ![]() |
@knguyen1 I can't reproduce it either, tried a lot of things but nope, not sure how I managed to have it but for sure it was while I was testing columns and numeric sort. My env is the following:
There's only one place where we generate a Line 282 in 4f2d979
It cannot happen on Windows because of: Lines 238 to 251 in 4f2d979
The crash was because of an infinite loop (the error shown repeated a lot, likely some recursion). |
Can't repro partial refreshes issue. Screencast: https://1drv.ms/v/c/0e7c7882e6da112b/ETxhaWcGUeBIqXjsrvT3TZ0BdEEcuyawNAYJXSSZepgihQ?e=o2UfWl This is after 9 iterations and refreshes are perfect every time. So I can't repro... ![]() Edit: Interestingly the builtin |
I don't see any value in it. |
Since the last time I tested this, I see that there is a new field added to the column definition -- "Sorting" -- with a number of options from which to choose. Is there value to having a brief explanation of each of the choices available, either through a tooltip on the items in the selection list or perhaps in a new tab added to the "Functions" and "Tags" tabs? |
But it's working as intended. For that column, I guess you hardcoded ![]() I could write more code to hide it... But I hesitate to because it's "working as intended". |
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.
It works for me, most issues were fixed, I did a lot of tests and it seems to work as expected (at least on Linux).
Good job, and very nice new feature. I look forward next step (PICARD-3119).
I also look forward to this being managed through option profiles. |
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.
Working well for me. I'd be in favor merging this for now. The ascending/descending sorting issue is something I'd like to see handled better, but we can do so separately.
Summary
Adds a UI to manage custom columns from the header menu: create, edit, duplicate, delete, place, and apply to File/Album views.
Problem
Users had no built-in UI to add/manage custom columns; changes required backend code or were not discoverable from the views.
Solution
Demo
Action
Additional actions required:
Note: API PR #2709 must be merged first; this PR only covers the UI/UX management layer.