ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
788 stars 68 forks source link

UI: separate files in trash from rest of file tree #48

Open murchu27 opened 3 years ago

murchu27 commented 3 years ago

Any files/folders that are in the tablet's Trash folder show up on the top level of the UI's documents page. They should instead be shown in a separate "Trash" folder, or just hidden from the UI altogether.

Whenever a client requests the documents UI, a warning message is generated for each file that is in the trash, presumably because it doesn't know what folder to show it under.

Apr 29 21:37:52 raspberrypi rmfakecloud-armv7[22860]: time="2021-04-29T21:37:52+01:00" level=info msg="[GIN] 2021/04/29 - 21:37:52 | 304 |     216.165µs |   51.171.96.109 | GET      \"/documents\""
Apr 29 21:37:53 raspberrypi rmfakecloud-armv7[22860]: time="2021-04-29T21:37:53+01:00" level=info msg="[ui-authmiddleware] User from token: murchu27"
**Apr 29 21:37:53 raspberrypi rmfakecloud-armv7[22860]: time="2021-04-29T21:37:53+01:00" level=warning msg="parent not found: trash"**
Apr 29 21:37:53 raspberrypi rmfakecloud-armv7[22860]: time="2021-04-29T21:37:53+01:00" level=info msg="[GIN] 2021/04/29 - 21:37:53 | 200 |   27.189767ms |   51.171.96.109 | GET      \"/ui/api/documents\""
Apr 29 21:37:53 raspberrypi rmfakecloud-armv7[22860]: time="2021-04-29T21:37:53+01:00" level=info msg="[GIN] 2021/04/29 - 21:37:53 | 200 |    1.181601ms |   51.171.96.109 | GET      \"/favicon.ico\""

The metadata of a file in the trash is like so:

reMarkable: ~/.local/share/remarkable/xochitl/ cat 4906df0c-5d5f-43e4-acdb-d1d5b570983d.metadata
{
    "deleted": false,
    "lastModified": "1619728667344",
    "lastOpenedPage": 0,
    "metadatamodified": false,
    "modified": false,
    "parent": "trash",
    "pinned": false,
    "synced": true,
    "type": "DocumentType",
    "version": 2,
    "visibleName": "Weekly Schedules copy"
}

Hopefully this will be helpful in getting the UI to identify and filter these files/folders.

ddvk commented 3 years ago

ok, should be no longer shown, the trash will be added later to the UI, probably

murchu27 commented 3 years ago

Crazy turnaround, thanks a mil. I'll take a look tomorrow. Will probably leave this issue open until a decision is made about adding trash to the UI

murchu27 commented 3 years ago

File/folders in the trash are hidden in the UI now, just like you said, thanks for that!