web icon indicating copy to clipboard operation
web copied to clipboard

Fix sorting on peers table

Open geftactics opened this issue 1 year ago • 2 comments

The peers list table has carets in the column headings, indicating that it should be possible to sort by those fields, which does not seem to be the case.

The PR enables sorting by clicking column heading, and defaults to most recent contacts at the top

Closes #146

geftactics avatar Feb 22 '24 12:02 geftactics

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 22 '24 12:02 CLAassistant

Hi @geftactics,

I checked out your code to test it out.

The sort is working but there is an edge case I wanted to bring up. I think you will need to update the table state to resort when the web client receives node information. To do that however there is a deeper problem. This table's rows can change dynamically so using index as a key can lead to issues with DOM updates and I think its also contributing to a bug which is messing with your sort.

davidlpower avatar Mar 11 '24 20:03 davidlpower

I tested this patch on my node and it worked well.

It did require clicking the heading to re-sort when new data comes in, but it was still a better experience than no sorting at all :D

fifieldt avatar May 26 '24 06:05 fifieldt

This has been fixed in another PR.


~~@geftactics I get an error when sorting by the new "Connection" column that was added:~~

image

~~The other columns work fine so I'm sure it's a simple fix.~~

~~Let me know if you need me to fix this bug, if not just update this PR and I'll merge it.~~

~~I'll check back in a week or so and fix it if it's not done by then.~~

Hunter275 avatar Jun 15 '24 20:06 Hunter275

Sorting "Last Heard" doesn't seem to work:

image

Hunter275 avatar Jun 16 '24 15:06 Hunter275

Good work @geftactics

Hunter275 avatar Jun 21 '24 02:06 Hunter275