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

Display "Show in Folder" notification after exporting entries #8195

Closed
HoussemNasri opened this issue Oct 26, 2021 · 12 comments · Fixed by #8567
Closed

Display "Show in Folder" notification after exporting entries #8195

HoussemNasri opened this issue Oct 26, 2021 · 12 comments · Fixed by #8567
Labels
export / save good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement ui

Comments

@HoussemNasri
Copy link
Member

Is your suggestion for improvement related to a problem? Please describe.
Users will likely wanna open the file they exported as soon as possible, it's common among other applications to have this feature so implementing it will improve user experience because users expect it

Describe the solution you'd like
solution 1: show a notification bar with a button to open the directory where the file was exported (Like Typora)
solution 2: open the exported file immediately (Like MS Word)

Additional context
Screenshot from Typora

@Siedlerchr Siedlerchr added this to Normal priority in Features & Enhancements via automation Oct 27, 2021
@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Dec 4, 2021
@LingZhang22
Copy link
Contributor

Hi, I'm Ling and I am a student majoring in computer science. I am new to open source and am interested in this issue. I have some basic knowledge of Java and Web development. Could you give me some suggestions on where to start? Thanks a lot!

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Sponsor Member

Hello @LingZhang22 !
I am not too familiar with these parts of the code, and not sure how I'd put the pieces together, but I'd start looking at the export command (which also happens to be based on the command design pattern).
Then look at how other parts of the code is using the JabRef dialog service (or its interface), e.g., by go to declaration or usage or find everywhere.
Probably you'll need the JabRefDesktop at some point as well

@LingZhang22
Copy link
Contributor

Hi @k3KAW8Pnf7mkmdSMPHz27, thank you so much for your guide! I will look into those code and info!

@LingZhang22
Copy link
Contributor

Hi @k3KAW8Pnf7mkmdSMPHz27 !
I created a PR for this issue. However, I think that this fix might need some improvement.

Firstly, the layout of the dialog is not well designed. The dialog pops up in the center of the main window as follows. It might be better if show a notification bar like Typora on the top of the window. But I didn't find an API for that. Could you give me some hints on where I can find such an API or how should I write such a function?
image

Secondly, when the users click "YES", the saved file folder rather than the file will pop up. However, I also didn't find that API. Could you please give me some hints for that too?

Many thanks!

@ThiloteE
Copy link
Member

Maybe a popover would be suitable for this? https://github.com/controlsfx/controlsfx/wiki/ControlsFX-Features#popover

@LingZhang22
Copy link
Contributor

@ThiloteE Thanks! I will look into this material!

@Siedlerchr
Copy link
Member

For the change detection dialog we use a NotificationPane from Controlsfx, that looks like one in Typora https://controlsfx.github.io/features/notificationspane/

@LingZhang22
Copy link
Contributor

LingZhang22 commented Mar 16, 2022

Hi @Siedlerchr, thank you for your instruction. And I got stuck, is it possible to get some help to go forward?

What I did so far:
I wrap the splitPane (which is the center of the JabRefFrame) into the NotificationPane. (And I tested that the bar can show on the page if I made some actions in the JabRefFrame class. )

image

My question:
In the ExportCommand class, I want to call and add actions to the notificationPane when the user click save. But I don't know how to can I get the notificationPane instance. Is it possible to get a notificationPane instance from the JabRefFrame in the ExportCommand or I am in the wrong direction?

Thanks a lot!

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Sponsor Member

k3KAW8Pnf7mkmdSMPHz27 commented Mar 16, 2022

In the ExportCommand class, I want to call and add actions to the notificationPane when the user click save.

If I am understanding you correctly, you are creating the notificationpane inside of JabRefFrame, in which case you probably want to pass it as an additional argument to the ExportCommand's constructor

@LingZhang22
Copy link
Contributor

Hi @k3KAW8Pnf7mkmdSMPHz27 Thank you so much for your guide!

I have implemented the NotificationPane for the light theme and dark theme.

When I clicked the save button, the notification bar will show on the top.
And if I click open, the folder will open with the file selected and then the bar will disappear.
In addition, if the user doesn't take action, the notification bar will disappear in 10 seconds.

In light theme:
Step1:
image

Step2:
image

Step3:
image

In dark theme:
Step1:
image

Step2:
image

Step3:
image

I have pushed my commits to GitHub. I am not sure whether there is something wrong or missing. If there is, could you please let me know? I will modify it.

Thanks!

@ThiloteE
Copy link
Member

I think the wording could be phrased slightly different:

Instead of "Do you want to open the file in folder?"
it could be: "Press "open" to reveal the folder holding the saved file"
(or shorter: "Open the folder holding the saved file"),
since not actually the file is opened, but rather the folder :-)

@LingZhang22
Copy link
Contributor

@ThiloteE Thank you for your suggestions. I have changed the text. Thanks :)

Features & Enhancements automation moved this from Normal priority to Done Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
export / save good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement ui
Projects
Archived in project
5 participants