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

Double paste using Cmd + V on mac os inside the 'new entry from plain text' dialog #9367

Closed
2 tasks done
Bushuo opened this issue Nov 10, 2022 · 6 comments · Fixed by #9716
Closed
2 tasks done

Double paste using Cmd + V on mac os inside the 'new entry from plain text' dialog #9367

Bushuo opened this issue Nov 10, 2022 · 6 comments · Fixed by #9716
Assignees
Labels

Comments

@Bushuo
Copy link

Bushuo commented Nov 10, 2022

JabRef version

5.7 (latest release)

Operating system

macOS

Details on version and operating system

mac os Monterey 12.6 on M1 Air

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Load a bibtex reference into the clipboard like this one:
@phdthesis{,
    author = {Braun, Felix},
    title = {Application of algorithm-based validation tools for the validation of complex, multi-variant products},
    editor = {},
    booktitle = {},
    series = {},
    journal = {},
    address = {},
    publisher = {},
    edition = {},
    year = {2021},
    isbn = {},
    volume = {},
    number =  {},
    pages = {},
    url = {},
    doi = {},
    keywords = {variant-oriented product portfolios; portfolio validation; portfolio verification; multi-variant products; boolean rules; algorithm-based validation tools},
    abstract = {Based on trends like mass-customization and the individualisation of mass products also in the vehicle manufacturing industry, multi-variant product portfolios are usually required to account for all the necessary variance. As this work is based on a research cooperation between university and a large commercial vehicle manufacturer, such types of a product portfolio are closely observed. In these types of product portfolios, large sets of Boolean portfolio rules are used to describe the product portfolio with all its variants. In the same time, numerous departments within engineering, sales and production work on these portfolio rules with different information flows and perspectives. Therefore, it is difficult to maintain a fully valid and consistent state of the portfolio over time. This is especially challenging, as advanced tools and algorithms are necessary to ensure validity, as the amount of rules and interdependencies is too large to be handled manually in complex product portfolios. This research examines the different types of multi-variant product portfolio descriptions and its requirements regarding validity and consistency described in recent literature. Based on the definition of how validity is reached within a portfolio, existing approaches on how to ensure this validity over time are explained. Taking these findings into account, the current gap in research is identified: neither exists a concise definition of portfolio validity, nor is an integral approach or process presented to ensure validity in the practical application. Therefore, this research proposes a concise definition of the requirements leading to validity within complex, multi-variant product portfolios. Based on these requirements, an integral approach, a procedural model, is proposed to achieve and maintain validity within complex, multi-variant product portfolios. This approach is explained in detail in the main section of this work. This procedural model is implemented in a real-world industry example in the form of a case study jointly executed with the industry partner. In this case study, a fully valid state of the product portfolio, according to the predefined requirements, can be achieved. Hereby, both the applicability and the validity of the proposed procedural model are shown. Finally, the main findings are outlined: a generic data model and documentation logic for complex, multi-variant product portfolios exist. On this basis, general requirements on the validity of a product portfolio definition can be stated. With the help of existing validation tools and algorithms, a procedural model can be used to guide and structure the validation process of the portfolio rules. When this process is being followed, a fully valid state of the product portfolio and its rules can be reached.  This work also helps the industry partner in the commercial vehicle industry to structure and perform its portfolio validation process as part of its daily business.},
    note = {},
    
    school = {Universität der Bundeswehr München},
    
}
  1. Open the 'New entry from plaintext' dialog
  2. Paste the clipboard using Cmd + V
  3. See that an additional entry is created behind the dialog in the main table

Appendix

image

Right after pressing Cmd + V the entry in the top row is created.
image

Expected behavior:
The entry is only created after pressing 'Add to current library‘

@Bushuo
Copy link
Author

Bushuo commented Nov 10, 2022

If I can be of any help, I have programming experience and Java knowledge. I would just need someone to point me in the right direction 🎉

@Bushuo Bushuo changed the title Double paste using Cmd + V on mac os inside the 'new entry from plain text' dialog Double paste using <kbd>Cmd</kbd> + <kbd>V</kbd> on mac os inside the 'new entry from plain text' dialog Nov 10, 2022
@Bushuo Bushuo changed the title Double paste using <kbd>Cmd</kbd> + <kbd>V</kbd> on mac os inside the 'new entry from plain text' dialog Double paste using Cmd + V on mac os inside the 'new entry from plain text' dialog Nov 10, 2022
@Siedlerchr
Copy link
Member

Siedlerchr commented Nov 10, 2022

Thanks for your interest! Any help is appreciated!
The key issue is that JavaFX still has a bug that a key combination like copy or pasting also triggers the menu items and so generates events twice.

https://bugs.openjdk.org/browse/JDK-8205915.

Codwise you would need to check at some place where the focus is

break;
case PASTE:
if (OS.OS_X) { // Workaround for a jdk issue that executes paste twice when using cmd+v in a TextField
// Extra workaround for CodeArea, which does not inherit from TextInputControl
if (!(stateManager.getFocusOwner().isPresent() && (stateManager.getFocusOwner().get() instanceof CodeArea))) {
event.consume();
}
break;

There are also a couple of other related issues
Might be related #9096

@Siedlerchr Siedlerchr moved this to Normal priority in Prioritization Nov 10, 2022
@github-actions
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Bushuo
Copy link
Author

Bushuo commented Nov 10, 2022

Thanks for the info :) I will give it a try over the weekend.

@vigneshdurairaj
Copy link
Contributor

vigneshdurairaj commented Mar 6, 2023

Is the issue still open? Can i work on this?

@ThiloteE ThiloteE assigned vigneshdurairaj and unassigned Bushuo Mar 6, 2023
@vigneshdurairaj
Copy link
Contributor

The menuitem for paste declared in edit menu(screenshot of the code is attaced) is root cause of the replication. Its action get triggered, when cmd+v is pressed inside the 'New entry from plaintext' dialog. Unable to find out which listener is doing this. Note: the stagemanager says focusowner is MainTable, unable to capture the keybinding inside the event listener in MainTable. Screenshot of the debugger is also attached.
Screenshot 2023-03-30 at 3 31 15 AM
Screenshot 2023-03-30 at 3 39 14 AM

Can I get some help in finding the part of code that causes this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants