Skip to content

WebUI: filter array elements in-place#23837

Merged
Chocobo1 merged 1 commit intoqbittorrent:masterfrom
Chocobo1:webui_remove
Feb 17, 2026
Merged

WebUI: filter array elements in-place#23837
Chocobo1 merged 1 commit intoqbittorrent:masterfrom
Chocobo1:webui_remove

Conversation

@Chocobo1
Copy link
Member

@Chocobo1 Chocobo1 commented Feb 14, 2026

Currently JS Array have no method to filter element in-place so we provide one which result in less memory allocations and hopefully better performance.

@Chocobo1 Chocobo1 added this to the 5.3 milestone Feb 14, 2026
@Chocobo1 Chocobo1 added WebUI WebUI-related issues/changes Code cleanup Clean up the code while preserving the same outcome labels Feb 14, 2026
@Chocobo1 Chocobo1 changed the title WebUI: simplify removing elements from an array WebUI: filter array elements in-place Feb 14, 2026
@Chocobo1 Chocobo1 marked this pull request as ready for review February 14, 2026 12:58
@Chocobo1 Chocobo1 added Performance and removed Code cleanup Clean up the code while preserving the same outcome labels Feb 14, 2026
@Chocobo1 Chocobo1 requested a review from a team February 14, 2026 12:59
Currently JS `Array` have no method to filter element in-place so we provide one which result
in better performance and less memory allocations.
@thalieht
Copy link
Contributor

Can't find any problems with this PR.

/Off topic
When i check/uncheck the checkbox in the header itself (column of checkboxes) in Content tab i get this:
Uncaught TypeError: can't access property "fileId", node is null

And when i move that column, the checkbox in the header disappears and i get this:
Uncaught (in promise) TypeError: can't access property "state", checkbox is null

@Chocobo1
Copy link
Member Author

Can't find any problems with this PR.

/Off topic
When i check/uncheck the checkbox in the header itself (column of checkboxes) in Content tab i get this:
Uncaught TypeError: can't access property "fileId", node is null

I confirm. Let's ping @Piccirello.

And when i move that column, the checkbox in the header disappears and i get this:
Uncaught (in promise) TypeError: can't access property "state", checkbox is null

I saw it only once and it go away when I F5 refresh the page. Seems a bit hard to reproduce reliably.

@thalieht
Are these issues also in v5.2.x branch? I mean #23823.

@Chocobo1
Copy link
Member Author

Chocobo1 commented Feb 17, 2026

Can't find any problems with this PR.
/Off topic
When i check/uncheck the checkbox in the header itself (column of checkboxes) in Content tab i get this:
Uncaught TypeError: can't access property "fileId", node is null

I confirm. Let's ping @Piccirello.

I fixed it in #23852, sorry for the noise.

@thalieht
Copy link
Contributor

@thalieht
Are these issues also in v5.2.x branch? I mean #23823.

Yes.

And when i move that column, the checkbox in the header disappears and i get this:
Uncaught (in promise) TypeError: can't access property "state", checkbox is null

I saw it only once and it go away when I F5 refresh the page. Seems a bit hard to reproduce reliably.

Yes it goes away with F5. I don't know if it's intended that the checkbox in the header is appended to the Name column in header when the column of checkboxes is not the first column (all these are after a refresh, moving the column of checkboxes makes the checkbox in the header disappear completely until refresh). For me the error starts when i move the column of checkboxes and it repeats on every... sync? (i don't know what it's called) every few seconds until refresh.

@Piccirello
Copy link
Member

Yes it goes away with F5. I don't know if it's intended that the checkbox in the header is appended to the Name column in header when the column of checkboxes is not the first column (all these are after a refresh, moving the column of checkboxes makes the checkbox in the header disappear completely until refresh). For me the error starts when i move the column of checkboxes and it repeats on every... sync? (i don't know what it's called) every few seconds until refresh.

I'll look into this

@Chocobo1 Chocobo1 merged commit edac383 into qbittorrent:master Feb 17, 2026
15 checks passed
@Chocobo1 Chocobo1 deleted the webui_remove branch February 17, 2026 16:16
Chocobo1 added a commit that referenced this pull request Feb 19, 2026
glassez pushed a commit to glassez/qBittorrent that referenced this pull request Feb 19, 2026
@Piccirello
Copy link
Member

Checkbox column movement has been fixed in #23858.

Chocobo1 pushed a commit that referenced this pull request Feb 26, 2026
`selectedRow in rows` incorrectly checks array indices instead of row IDs, so selections could be incorrectly kept or pruned.

Follow up to #23752 and #23837.
PR #23859.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance WebUI WebUI-related issues/changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants