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

WebUI: Allow to move state icon to name column in torrents table #22118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skomerko
Copy link
Contributor

@skomerko skomerko commented Jan 6, 2025

See #22118 (comment) for updated information.

@stalkerok
Copy link
Contributor

stalkerok commented Jan 7, 2025

This is not a good solution. Some users on the contrary request separate columns for the GUI #18193

I would suggest making a full column for WebUI called “Status Icon” or just “Icon” instead of merging.

@skomerko
Copy link
Contributor Author

skomerko commented Jan 7, 2025

This is not a good solution. Some users on the contrary request separate columns for the GUI #18193

I would suggest making a full column for WebUI called “Status Icon” or just “Icon” instead of merging.

I see, thanks for letting me know. It doesn't hurt to keep the old state icon column so I'll modify the PR and bring it back.

@xavier2k6 xavier2k6 added the WebUI WebUI-related issues/changes label Jan 10, 2025
@skomerko skomerko force-pushed the webui-state-icon-column branch from ad6fafb to 08272b6 Compare January 18, 2025 21:11
@skomerko skomerko changed the title WebUI: Merge 'state icon' and 'name' columns in torrents table WebUI: Allow to move state icon to name column in torrents table Jan 18, 2025
@skomerko
Copy link
Contributor Author

skomerko commented Jan 18, 2025

PR has been updated. Notable changes:

  • By default, standalone state icon column is disabled and state icon is displayed next to torrents name (this part matches the behavior of the GUI):

image

  • When standalone state icon column is enabled, icons in name column are hidden:

image

  • Added name to state icon column
  • State icon column is now sortable

edit: PR title probably should be changed(?), not sure to what though.

@stalkerok
Copy link
Contributor

stalkerok commented Jan 21, 2025

How about the name “Icon”? #22131 (comment)

the column content will always be smaller than the column header

@@ -612,31 +628,21 @@ window.qBittorrent.DynamicTable ??= (() => {
return -1;
},

updateColumn: function(columnName) {
updateColumn: function(columnName, updateCellData = false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Chocobo1, changes made around this method are not strictly necessery - name column could be updated from within onVisibilityChange callback but I thought it's better to improve updateColumn a bit instead (though things are definitely not perfect but I didn't want to change too much).

this.columns["state_icon"].updateTd = function(td, row) {
let state = this.getRowValue(row);
let img_path;
const getStateIconClasses = (state) => {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be singular?

Suggested change
const getStateIconClasses = (state) => {
const getStateIconClass = (state) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It returns a string containing two classes so I think its fine?? Should I still rename it?

Copy link
Member

Choose a reason for hiding this comment

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

It returns a string containing two classes so I think its fine??

OK, never mind.

Also, I wonder is it wise to merge stateIcon into stateClass? It now needs 2 classes while only 1 should be sufficient. I don't insist it be done now, i.e. it could be done later.

src/webui/www/private/scripts/dynamicTable.js Outdated Show resolved Hide resolved
src/webui/www/private/scripts/dynamicTable.js Outdated Show resolved Hide resolved
@skomerko skomerko force-pushed the webui-state-icon-column branch from 08272b6 to a3da699 Compare January 25, 2025 20:43
Chocobo1
Chocobo1 previously approved these changes Jan 26, 2025
@stalkerok
Copy link
Contributor

There is a naming inconsistency when using “State Icon”.
2025-01-26_113744
Is it possible to change the name to the abbreviated “Icon” or at least to “Status Icon”?

@skomerko
Copy link
Contributor Author

skomerko commented Jan 26, 2025

There is a naming inconsistency when using “State Icon”. 2025-01-26_113744 Is it possible to change the name to the abbreviated “Icon” or at least to “Status Icon”?

Sure, changed it to 'Status Icon'.

@skomerko skomerko requested a review from Chocobo1 January 26, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebUI WebUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants