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

File folders: Move between global and user-specific #571

Open
koppor opened this issue May 25, 2022 · 15 comments
Open

File folders: Move between global and user-specific #571

koppor opened this issue May 25, 2022 · 15 comments
Assignees
Labels

Comments

@koppor
Copy link
Owner

koppor commented May 25, 2022

JabRef offers multiple file directories.

image

  • a) There is no indication in which folder "type" a file recides
  • b) It is not possible to move between these folders

The UI just shows "file directory"

image

It should be possible to move from the user-specific file directory to the general file directory (and vice versa)

Proposal

  • UI should NOT state "file directory", but "General file directory" and "User-specific file directory". If a file is already contained in one of these directories, the option should be "Move file to user-specific file directory" or "General file directory" respectively.
  • The file icon should be "world + pdf" if stored in the "General file directory"
  • The file icon should be "person+ pdf" if stored in the "user-specific file directory"

Notes

  • It is not clear whether the icons work as desribed. Other solutions should be tried. As last resort, the icon color can be used. If the PDF is stored in "General file directory" , it is full black. If not, it is a light gray (as currently)
@fcengman
Copy link

fcengman commented Mar 26, 2024

Hello @koppor . What should the option be if the file is neither in the user specific directory or the general directory? And what should the option be is either user directory, general directory, or both are not set? And what do you mean by "world + pdf"? I found an icon (FOLDER_ACCOUNT_OUTLINE) in the material designs icon package that resembles "person + pdf", but nothing suitable for "world + pdf". Thanks!

@koppor
Copy link
Owner Author

koppor commented Mar 26, 2024

Hello @koppor . What should the option be if the file is neither in the user specific directory or the general directory?

Two cases:

If in the general preferences the setting is to store next to the bib file, the text should read "Move file next to library".

If other preference: Check which directory will be used by JabRef and use the respective string. Three cases: user-specific file directory, library-specific file directory, and general file directory.

And what do you mean by "world + pdf"?

I think, I meant a new icon, where the PDF icon is shown and enriched by a small world icon. Reason: It is more important to show that it is a PDF than the storage location.

Maybe you can design one. Hints are given at https://devdocs.jabref.org/code-howtos/custom-svg-icons.html

@Watson15
Copy link

Hello @koppor,
What is the difference between a global file directory and a user-specific file directory?
Thank you

@koppor
Copy link
Owner Author

koppor commented Mar 29, 2024

What is the difference between a global file directory and a user-specific file directory?

@Watson15 Oh, did the search on documentation page of JabRef not work? 😱 Here is a deep link: https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files

@koppor
Copy link
Owner Author

koppor commented Mar 29, 2024

@Watson15 You should have learned about the different kinds of directories while solving #678. If not, you are either not part of the course or solved the issue only partially. -- In all cases: Good luck with this issue! 👍

@callumcurtis
Copy link

Hi @koppor, regarding the custom icons, the docs mention that a link to existing icons will be published soon, and that a JSON file must be uploaded to IcoMoon.

I assume that the JSON file described in the docs refers to the selection.json file in the icomoon.zip file that would have been generated the last time the font was exported from IcoMoon. I was unable to locate this JSON file in the docs, repo, or elsewhere.

Where can I find the JSON file described in the docs containing Jabref's icon SVGs? Thank you!

@Siedlerchr
Copy link
Collaborator

@hungry-yumyumman
Copy link

Hello @koppor . What should the option be if the file is neither in the user specific directory or the general directory?

Two cases:

If in the general preferences the setting is to store next to the bib file, the text should read "Move file next to library".

If other preference: Check which directory will be used by JabRef and use the respective string. Three cases: user-specific file directory, library-specific file directory, and general file directory.

And what do you mean by "world + pdf"?

I think, I meant a new icon, where the PDF icon is shown and enriched by a small world icon. Reason: It is more important to show that it is a PDF than the storage location.

Maybe you can design one. Hints are given at https://devdocs.jabref.org/code-howtos/custom-svg-icons.html

Hi @koppor! Just following up on this. It seems this issue got more requirements since I last viewed it lol.
In the second case where we choose Main file directory in the Linked files preferences, the options should now be "Move to User-specific file directory", "Move to General file directory" or "Move to Library-specific file directory"?
Also by "library-specific file directory", are you referring to the LaTeX file directory in Library properties?

I also wanted to clarify that if we just override the Main file directory with either the User-specific file directory, General file directory or Library-specific file directory, what would be its purpose? Would the Main file directory just be useful for searching for files and not actually storing them?
Sorry for asking so many questions. Just really want to understand the changes being requested.

@koppor
Copy link
Owner Author

koppor commented Apr 1, 2024

Hi @koppor! Just following up on this. It seems this issue got more requirements since I last viewed it lol.

Sometimes, clarification points come up while a issue is worked on. When following the SCRUM approach, the dailies are used for clarification of such things. In other development processes (such as the one you are participating), it is more vague and spontaneous... (And the general learning is: An issue might not as simple as it reads)

(I moved that to here to share the idea behind the issue)

I also wanted to clarify that if we just override the Main file directory with either the User-specific file directory, General file directory or Library-specific file directory, what would be its purpose? Would the Main file directory just be useful for searching for files and not actually storing them?

No overriding! This issue is about moving (Files.move in Java AFAIK) files from one directory to another. The main reason is to increase or decrease visibility of a file. In case a file is residing in the user-specific file directory, it is not visible to others. A user might want to change that and provide the files to others. A file is only accessible to others if stored in the library-specific file directory. - The main file directory might not be accessible to all. Therefore, if the file is in any of the two library directories, it should remain in any of these two.

In the second case where we choose Main file directory in the Linked files preferences, the options should now be "Move to User-specific file directory", "Move to General file directory" or "Move to Library-specific file directory"?

Thank you for asking. It would be nice if you had come up with a proposal! You are not just a programmer but a future mastermind!

Let me specify on the fly:

It is not about the preferences, only about the context menu entry.

JabRef offers three directories:

In general, the label of the context menu is "Move file to X", where X is "main file directory" (X1), "library-specific file directory" (X2), and "user-specific file directory (X3).

General idea of the following: user-specific > library-specific > main file directory.

If no file directory exists (unsaved new library!), the context menu entry is disabled.

If one directory is available and file is outside that directory: "Move file to X" and context menu entry enabled.

If two directories exist

  • and file outside of both: show X2 (if exists, otherwise X3, if that does not exist, show X1)
  • and file inside X1, show X2 (if exists, otherwise X3)
  • and file inside X2, show X1 (X3 cannot exist in this case)
  • and file inside X3, show X1 (X2 cannot exist in this case)

If three directories exists, it is more difficult. Lets do as follows and see what users report:

  • and file outside of all: show X2
  • and file inside X1, show X2
  • and file inside X2, show X3
  • and file inside X3, show X2

Side note: Please do a separate pull request renaming "General file directory" to "Library-specific file directory " in the UI.

Also by "library-specific file directory", are you referring to the LaTeX file directory in Library properties?

No, this is a completely separate thing. I meant "General file directory". That string should be renamed (see above)

Sorry for asking so many questions. Just really want to understand the changes being requested.

Sure thing! I hope, I could clarify a bit!

@Siedlerchr
Copy link
Collaborator

@koppor
Copy link
Owner Author

koppor commented Apr 1, 2024

Important detail: The sub directory structure should be kept. Example:

General file directory: E:\lib

User-specific file directory: U:\papers

E:\lib\a\b\c\p.pdf is moved to user-specific directory:

Target path is U:\papers\a\b\c\p.pdf (and not u:\papers\p.pdf)

@fcengman
Copy link

fcengman commented Apr 1, 2024

Hi @koppor. Thanks for all the great feedback. Just a couple more questions for you.

If other preference: Check which directory will be used by JabRef and use the respective string. Three cases: user-specific file
directory, library-specific file directory, and general file directory.

No, this is a completely separate thing. I meant "General file directory". That string should be renamed (see above)

If we rename the general file directory to library specific file directory, should we also rename the main file directory to general file directory in the linked files preferences to match the explanation above?

If three directories exists, it is more difficult. Lets do as follows and see what users report:

  • and file outside of all: show X2
  • and file inside X1, show X2
  • and file inside X2, show X3
  • and file inside X3, show X2

From what I can tell, currently the order in which a directory is chosen is user specific directory (X3), general file directory (X2), main file directory (X1).

From the method header for getFileDirectories in the BibDatabaseContext class.

image

  • and file outside of all: show X2
  • and file inside X1, show X2

Are you suggesting that the general (library-specific) file directory should be given the highest priority instead?

@koppor
Copy link
Owner Author

koppor commented Apr 1, 2024

No, this is a completely separate thing. I meant "General file directory". That string should be renamed (see above)

If we rename the general file directory to library specific file directory, should we also rename the main file directory to general file directory in the linked files preferences to match the explanation above?

No. Then, for different versions of JabRef "General file directory" would mean very different things. -- "Main directory" is the one for all opened libraries if they do not specify something different. We could introduce another term, but I don't come up with a good one - and I think, that would cause even more confusion.

If three directories exists, it is more difficult. Lets do as follows and see what users report:

  • and file outside of all: show X2
  • and file inside X1, show X2
  • and file inside X2, show X3
  • and file inside X3, show X2

From what I can tell, currently the order in which a directory is chosen is user specific directory (X3), general file directory (X2), main file directory (X1).

Yes! The aim of the algorithm above is to keep the file "library-local", either user-specific or library specific; never move it out.

I think, the behavior could be adapted if users dont like it...

  • and file outside of all: show X2
  • and file inside X1, show X2

Are you suggesting that the general (library-specific) file directory should be given the highest priority instead?

Yes, because this is the directory all users of the library can access. The main file directory is the one only valid for the current user.

@fcengman
Copy link

fcengman commented Apr 1, 2024

Yes! The aim of the algorithm above is to keep the file "library-local", either user-specific or library specific; never move it out.

So if 'library specific' is set but 'user specific' is not set, the only option should be to move it to 'library specific' even if it is already in 'library specific' (but greyed out)? The same is true for 'user specific' if 'library specific' is not set? (ie disable the option to move it back to main or next to the library)

Are you suggesting that the general (library-specific) file directory should be given the highest priority instead?

Yes, because this is the directory all users of the library can access. The main file directory is the one only valid for the current user.

Sorry, I'm asking about the general (library-specific) file directory, not the main file directory.

@koppor
Copy link
Owner Author

koppor commented Apr 1, 2024

Yes! The aim of the algorithm above is to keep the file "library-local", either user-specific or library specific; never move it out.

So if 'library specific' is set but 'user specific' is not set, the only option should be to move it to 'library specific' even if it is already in 'library specific' (but greyed out)?

No. Re-iterate on

If two directories exist

and file outside of both: show X2 (if exists, otherwise X3, if that does not exist, show X1)
and file inside X1, show X2 (if exists, otherwise X3)
and file inside X2, show X1 (X3 cannot exist in this case)
and file inside X3, show X1 (X2 cannot exist in this case)

In your case: File is inside library-specific, offer to move to main directory.

The same is true for 'user specific' if 'library specific' is not set? (ie disable the option to move it back to main or next to the library)

In your case: File is inside user-specific, offer to move to main directory.

I know this is inconsistent to the three- directory case. If you feel uncomfortable there, adapt it to cycle X1, X2, X3.

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

No branches or pull requests

7 participants