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

feat: pin files to top of gcode files list #1684

Closed
wants to merge 6 commits into from

Conversation

4rnoP
Copy link

@4rnoP 4rnoP commented Dec 13, 2023

Description

Add the possibility to pin gcode file to the files view and file panel in dashboard
The pin/unpin action can be done through right click, and the icon of the file change to a pin icon to show that a file is currently pinned (while avoiding too much space).
The saved files list is store in the Moonraker DB under gcodefiles.pinnedFiles.

However, I'm not sure of the implementation design.
My idea is to add a property isPinned to the FileStateGcodefile[] that the panel get, and sort the files according to this property in the sortFiles function in plugins/helpers.
I placed the actions/mutations in the store/gui/ as the gcodefiles db index was already accessible from there, and I also modified the getter getGcodeFiles to add the property to the FileStateGcodefile objects it returns, as well as the getDeleteFile action to remove the file from the pinnedFiles list (to avoid that if you delete a pinned file, then upload a file with the same name, it is automatically pinned).

Related Tickets & Documents

Fixes #1257

Mobile & Desktop Screenshots/Recordings

image
image
image

4rnoP and others added 4 commits December 13, 2023 23:13
Add the ability to pin gcode files to top of dashboard file panel and gcode files view

Signed-off-by: Arno Pigeon <[email protected]>
Add translation support

Signed-off-by: Arno Pigeon <[email protected]>
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0

@meteyou
Copy link
Member

meteyou commented Dec 16, 2023

hey @4rnoP ! I merged this PR (#1678). pls update your branch. what do you think about icons instead of the text labels in the tabs? i would also prefer a separate tab for pinned files.

Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0

@SwiftingSpeed
Copy link

How does it handle gcode files with preview thumbnails? The ones you have in your examples all have the default file icon so maybe you haven't thought of the thumbnails since you aren't using them yourself?

Are thumbnails replaced with the pin icon as well or are they layered? Some users may have usage for the thumbnails, removing them may not be the best option.

@4rnoP
Copy link
Author

4rnoP commented Dec 18, 2023

Indeed, with the current solution, the pin icon have precedence over the preview thumbnail.

However, with the separated tab for pinned files in the main dashboard, it isn't necessary to change the file icon/preview there.
For the file panel, how should the pinned files stand out if you still want the preview thumbnails visible ?

One idea is to add a small pin icon in the top right corner of the icon, like the following example
image

Icons for dashboard status card
Separated pinned files tab
Small pin icon without overriding preview thumbnails

Signed-off-by: Arno Pigeon <[email protected]>
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 3

@meteyou
Copy link
Member

meteyou commented Feb 3, 2024

@4rnoP sry for the late response...

maybe a small icon before the filename? this would also be very prominent and easy to see.

@meteyou
Copy link
Member

meteyou commented Nov 14, 2024

I close this PR, because of no response. Pls create a new PR, when you continue to work on it.

@meteyou meteyou closed this Nov 14, 2024
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.

Pin files to top of gcode files list.
3 participants