koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 13 forks source link

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

Open koppor opened 2 years ago

koppor commented 2 years ago

JabRef offers multiple file directories.

image

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

Notes

fcengman commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

koppor commented 3 months ago

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 commented 3 months ago

@Watson15 You should have learned about the different kinds of directories while solving https://github.com/koppor/jabref/issues/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 commented 3 months ago

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 commented 3 months ago

@callumcurtis I updated the docs, it now includes the json files (need to upload it as zip file). The json includes the final icons. You can see how the icons are designed when you upload it to icomoon. If you click on the pencil in icomoon toolbar you can see the SVGs in bigger well.

From my personal experience, I can tell you it's not easy to create an icon. It has to be mono colored and must fit the size. You can find some very good existing icons here https://icon-sets.iconify.design/mdi/?prefixes=material-symbols%2Cmaterial-symbols-light%2Cic%2Cmdi%2Cph%2Csolar%2Ctabler%2Cmingcute%2Cri%2Cbi%2Ccarbon%2Ciconamoon%2Ciconoir%2Cion%2Clucide%2Cuil%2Ctdesign%2Cteenyicons%2Cclarity%2Cbx%2Cbxs%2Cmajesticons%2Cant-design%2Cgg%2Cgravity-ui%2Cocticon%2Cmemory%2Ccil%2Cflowbite%2Cmynaui%2Cbasil%2Cpixelarticons%2Cakar-icons%2Cci%2Csystem-uicons%2Ctypcn%2Cradix-icons%2Czondicons%2Cep%2Ccircum%2Cmdi-light%2Cfe%2Ceos-icons%2Cbitcoin-icons%2Ccharm%2Cprime%2Chumbleicons%2Cuiw%2Cuim%2Cuit%2Cuis%2Cmaki%2Cgridicons%2Cmi%2Cquill%2Cgala%2Clets-icons%2Cf7%2Cmage%2Cfluent%2Cicon-park-outline%2Cicon-park-solid%2Cicon-park-twotone%2Cicon-park%2Cvscode-icons%2Cjam%2Cheroicons%2Ccodicon%2Cpajamas%2Cpepicons-pop%2Cpepicons-print%2Cpepicons-pencil%2Cbytesize%2Cei%2Cstreamline%2Cguidance%2Cfa6-solid%2Cfa6-regular%2Cooui%2Cnimbus%2Coui%2Cformkit

hungry-yumyumman commented 3 months ago

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 commented 3 months ago

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

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

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 commented 3 months ago

Some more context https://docs.jabref.org/setup/databaseproperties#override-default-file-directories

koppor commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.