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

Switch torrents Table to MantineReactTable with filter/sort function #1557

Merged
merged 16 commits into from
Dec 7, 2023
Merged

Switch torrents Table to MantineReactTable with filter/sort function #1557

merged 16 commits into from
Dec 7, 2023

Conversation

InterN0te
Copy link
Contributor

@InterN0te InterN0te commented Nov 7, 2023

Category

Feature

Overview

Switch Torrents Table to MantineReactTable

Issue Number (if applicable)

Related issue: #1354 #1484 #1555

New Vars

Add dependencies "mantine-react-table": "^1.3.4"

Screenshot

image

@InterN0te InterN0te marked this pull request as draft November 7, 2023 14:51
@InterN0te InterN0te changed the title Add sort function on Torrents list item Switch torrents Table to MantineReactTable with filter/sort function Nov 8, 2023
@InterN0te InterN0te marked this pull request as ready for review November 8, 2023 00:50
@InterN0te
Copy link
Contributor Author

InterN0te commented Nov 8, 2023

This generally works, except that I don't understand why the ETA, upload Speed or download Speed columns are not automatically displayed in large screen with :

      columnVisibility: {
        isCompleted: false,
        dateAdded: false,
        name: true,
        totalSize: true,
        uploadSpeed: width > MIN_WIDTH_MOBILE,
        downloadSpeed: width > MIN_WIDTH_MOBILE,
        eta: width > MIN_WIDTH_MOBILE,

If I display those values in the Search field, they are OK and well compare

@ajnart
Copy link
Owner

ajnart commented Nov 8, 2023

I can’t really review right now but don’t you think these feature are overkill ? The screenshots seem to completely break from the simple aesthetic that homarr wants to achieve

@InterN0te
Copy link
Contributor Author

InterN0te commented Nov 8, 2023

I don't it's overkill but I understand your point of view

I will try to switch to the minimalist table to have something like that :
image

@ajnart
Copy link
Owner

ajnart commented Nov 8, 2023

I don't it's overkill but I understand your point of view

I will try to switch to the minimalist table to have something like that : image

Yeah I think this makes a lot more sense. I don’t think anyone would need to have a highly configurable sorting for their torrent download list.
Regarding the sorting options you can save them in local storage using the mantine hook provided for that (if that’s not already saved)

@InterN0te
Copy link
Contributor Author

With the minimal table, filters work great (one or two click to set order and a third click to disable sort and use default sorting (dateAdded descending)
image

I still have an issue with displaying columns only on big screen with :

      columnVisibility: {
        isCompleted: false,
        dateAdded: false,
        name: true,
        totalSize: true,
        uploadSpeed: width > MIN_WIDTH_MOBILE,
        downloadSpeed: width > MIN_WIDTH_MOBILE,
        eta: width > MIN_WIDTH_MOBILE,
      },

@InterN0te
Copy link
Contributor Author

I think I got it !

Small screen :
image

Normal screen :
image
image

@ajnart
Copy link
Owner

ajnart commented Nov 9, 2023

Nice ! It looks so good now. I will review it later

@InterN0te
Copy link
Contributor Author

I don't give up but I don't have much time now : It's seems good, but it isn't, the column size aren't good for small screen

@ajnart
Copy link
Owner

ajnart commented Nov 12, 2023

I want to change the other tables in the app to reflect this too, I will try to do it with Docker page, would you want to try it on your own? I thibk you talked with tag about this on discord ?

@ajnart
Copy link
Owner

ajnart commented Nov 12, 2023

If you are ok with us working on your PR we could (and and I) unify the look of the other tables by using mantine react table in other places in the app. IM my opinion it would make sense to unify all these

@InterN0te
Copy link
Contributor Author

I'm ok with you all working on my PR, I don't really like working on UI, I prefer back-end coding

I could try for years and never be satisfied of my visual

@@ -91,6 +91,10 @@
"html-entities": "^2.3.3",
"i18next": "^22.5.1",
"immer": "^10.0.2",
"js-file-download": "^0.4.12",
"mantine-react-table": "^1.3.4",
"moment": "^2.29.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already have dayjs. Do you really need moment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it came with mantine-react-table because I don't remember installing it. Is it possible ?

dateAdded: false,
name: true,
totalSize: true,
// uploadSpeed: width > MIN_WIDTH_MOBILE,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is with this commented out code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In initialState, it doesn't correctly compare : width seems to be egal to 0 so I softly removed it to keep a track of this try

Comment on lines 307 to 325
/* // OldTable
return (
<Flex direction="column" sx={{ height: '100%' }} ref={ref}>
<ScrollArea sx={{ height: '100%', width: '100%' }} mb="xs">
<Table striped highlightOnHover p="sm">
<thead>
<tr>
<th>{t('card.table.header.name')}</th>
<th>{t('card.table.header.size')}</th>
{width > MIN_WIDTH_MOBILE && <th>{t('card.table.header.download')}</th>}
{width > MIN_WIDTH_MOBILE && <th>{t('card.table.header.upload')}</th>}
{width > MIN_WIDTH_MOBILE && <th>{t('card.table.header.estimatedTimeOfArrival')}</th>}
<th>{t('card.table.header.progress')}</th>
<th style={{cursor: "pointer"}} onClick={() => requestSort('name')}>{t('card.table.header.name')}</th>
<th style={{cursor: "pointer"}} onClick={() => requestSort('totalSize')}>{t('card.table.header.size')}</th>
{width > MIN_WIDTH_MOBILE && (
<th style={{cursor: "pointer"}} onClick={() => requestSort('downloadSpeed')}>
{t('card.table.header.download')}
</th>
)}
{width > MIN_WIDTH_MOBILE && (
<th style={{cursor: "pointer"}} onClick={() => requestSort('uploadSpeed')}>{t('card.table.header.upload')}</th>
)}
{width > MIN_WIDTH_MOBILE && (
<th style={{cursor: "pointer"}} onClick={() => requestSort('eta')}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove commented out code

@manuel-rw manuel-rw merged commit 2170201 into ajnart:dev Dec 7, 2023
1 check passed
@InterN0te InterN0te deleted the dev-sortTorrents branch December 9, 2023 13:33
truecharts-admin referenced this pull request in truecharts/public Dec 31, 2023
…45f163b by renovate (#16654)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/ajnart/homarr](https://togithub.com/ajnart/homarr) | patch |
`0.14.2` -> `0.14.3` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>ajnart/homarr (ghcr.io/ajnart/homarr)</summary>

### [`v0.14.3`](https://togithub.com/ajnart/homarr/releases/tag/v0.14.3)

[Compare
Source](https://togithub.com/ajnart/homarr/compare/v0.14.2...v0.14.3)

### 🎆🎆 Happy new Year!

Thank you for all your support in 2023 - we really appreciate it.
Homarr has been downloaded almost 4 million times with over 400'000
instances running the latest versions.
Due to the increase in traffic, we have upgraded our website at
https://homarr.dev/ significantly and moved our infrastructure to a
hosting provider.
We are looking forward to see you in 2024!

#### Better user management


![image](https://togithub.com/ajnart/homarr/assets/30572287/5bf6221b-0803-46df-8ae7-9666e6662fe6)

#### Redesigned torrent table

Thanks to [@&#8203;InterN0te](https://togithub.com/InterN0te) , our
torrent widget has received a great upgrade:

![image](https://togithub.com/ajnart/homarr/assets/30572287/1f16c5d9-448f-48f7-948e-9b9f8d75ecb4)

#### Gravatar support

Homarr now integrates seamlessly with Gravatar. Simply upload a profile
picture to Gravatar and you're good to go!


![image](https://togithub.com/ajnart/homarr/assets/30572287/f5cbd6eb-26dd-41e6-8423-39bf4d411873)

#### Updated docker integration

We've added back the Docker integration to your boards.
It's now easier to use than ever.


![image](https://togithub.com/ajnart/homarr/assets/30572287/2308915a-04ac-4504-ad10-24f70eaf9c90)

![image](https://togithub.com/ajnart/homarr/assets/30572287/401db133-2dc5-42af-aef5-cd86ed1ebd33)

#### CLI tool

Did you get locked out? Using our CLI tool, you can reset your password
to recover your Homarr instance:

![image](https://togithub.com/ajnart/homarr/assets/30572287/b8fb30cd-c7e7-4bd3-ab43-d0b5f955197f)

#### What's Changed

- Update acceptableStatusCodes.ts by
[@&#8203;jeffersonraimon](https://togithub.com/jeffersonraimon) in
[https://github.com/ajnart/homarr/pull/1709](https://togithub.com/ajnart/homarr/pull/1709)
- ✨ [#&#8203;1616](https://togithub.com/ajnart/homarr/issues/1616)
Recovery script in Docker container by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1726](https://togithub.com/ajnart/homarr/pull/1726)
- 🐛 About page and manage user pages not translated by
[@&#8203;ajnart](https://togithub.com/ajnart) in
[https://github.com/ajnart/homarr/pull/1724](https://togithub.com/ajnart/homarr/pull/1724)
- ✨ Use gravatar with user email by
[@&#8203;Tagaishi](https://togithub.com/Tagaishi) in
[https://github.com/ajnart/homarr/pull/1688](https://togithub.com/ajnart/homarr/pull/1688)
- Switch torrents Table to MantineReactTable with filter/sort function
by [@&#8203;InterN0te](https://togithub.com/InterN0te) in
[https://github.com/ajnart/homarr/pull/1557](https://togithub.com/ajnart/homarr/pull/1557)
- ⚡️ Improve code in manage layout page by
[@&#8203;Tagaishi](https://togithub.com/Tagaishi) in
[https://github.com/ajnart/homarr/pull/1681](https://togithub.com/ajnart/homarr/pull/1681)
- Updated entityStateSchema to handle nullables by
[@&#8203;gfomichev](https://togithub.com/gfomichev) in
[https://github.com/ajnart/homarr/pull/1744](https://togithub.com/ajnart/homarr/pull/1744)
- feature/[#&#8203;1616](https://togithub.com/ajnart/homarr/issues/1616)
better user management by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1748](https://togithub.com/ajnart/homarr/pull/1748)
- New Crowdin updates by [@&#8203;ajnart](https://togithub.com/ajnart)
in
[https://github.com/ajnart/homarr/pull/1701](https://togithub.com/ajnart/homarr/pull/1701)
- fix: umlaute in RSS by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1755](https://togithub.com/ajnart/homarr/pull/1755)
- New Crowdin updates by [@&#8203;ajnart](https://togithub.com/ajnart)
in
[https://github.com/ajnart/homarr/pull/1761](https://togithub.com/ajnart/homarr/pull/1761)
- ⚡️ Remove location based timezone resolving by
[@&#8203;Tagaishi](https://togithub.com/Tagaishi) in
[https://github.com/ajnart/homarr/pull/1680](https://togithub.com/ajnart/homarr/pull/1680)
- Import to docker form board, Docker button on boards by
[@&#8203;ajnart](https://togithub.com/ajnart) in
[https://github.com/ajnart/homarr/pull/1714](https://togithub.com/ajnart/homarr/pull/1714)
- Update FUNDING.yml by [@&#8203;ajnart](https://togithub.com/ajnart) in
[https://github.com/ajnart/homarr/pull/1768](https://togithub.com/ajnart/homarr/pull/1768)
- 🔧 Configure Stale Action by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1752](https://togithub.com/ajnart/homarr/pull/1752)
- 🔧 Configure greetings by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1753](https://togithub.com/ajnart/homarr/pull/1753)
- New Crowdin updates by [@&#8203;ajnart](https://togithub.com/ajnart)
in
[https://github.com/ajnart/homarr/pull/1770](https://togithub.com/ajnart/homarr/pull/1770)
- fix: outdated config schema by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1769](https://togithub.com/ajnart/homarr/pull/1769)
- chore: increase version in package.json by
[@&#8203;manuel-rw](https://togithub.com/manuel-rw) in
[https://github.com/ajnart/homarr/pull/1771](https://togithub.com/ajnart/homarr/pull/1771)
- Docker import fix by [@&#8203;ajnart](https://togithub.com/ajnart) in
[https://github.com/ajnart/homarr/pull/1773](https://togithub.com/ajnart/homarr/pull/1773)

#### New Contributors

- [@&#8203;jeffersonraimon](https://togithub.com/jeffersonraimon) made
their first contribution in
[https://github.com/ajnart/homarr/pull/1709](https://togithub.com/ajnart/homarr/pull/1709)
- [@&#8203;gfomichev](https://togithub.com/gfomichev) made their first
contribution in
[https://github.com/ajnart/homarr/pull/1744](https://togithub.com/ajnart/homarr/pull/1744)

**Full Changelog**:
ajnart/homarr@v0.14.2...v0.14.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 10pm on monday" in timezone
Europe/Amsterdam, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMTUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjExNS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
@kingp0dd
Copy link

is this already available in the latest version? i can't see the new options:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants