Skip to content

Conversation

@benlevycmp
Copy link
Contributor

@benlevycmp benlevycmp commented Feb 18, 2025

This adds an option to "General->User Interface" to manually enable/disable the prompt that asks the user if they would like to include cross-references when using "Copy to".

This is primarily to allow users to re-enable the prompts if they have disabled them from within the prompt.

Closes #12501

Screenshot 2025-02-17 182257

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

github-actions[bot]

This comment was marked as outdated.

@subhramit
Copy link
Member

Do not force-push! Force push is off limits and very bad style when working together on a project. (Mainly because it is not supported well by GitHub istself.) Commits will be lost, comments on commits will loose their context. This makes it harder to review. In the end, all commits will be squashed either way before being merged into the `main`` branch.

False alarm? @koppor

@subhramit
Copy link
Member

Instead of the prompt, I think the issue asks for a preference whether to "Include cross-referenced entries when using the 'Copy To' option".
cc: @priyanshu16095

I think a prompt every time we copy an entry/ are copying multiple entries is useless if we have such a preference in the first place.
If we really want to use prompts, we can ask the user just once after jabref installation, or just once for each session when he tries to copy.

inspectionWarningDuplicateProperty.setValue(workspacePreferences.shouldWarnAboutDuplicatesInInspection());

confirmDeleteProperty.setValue(workspacePreferences.shouldConfirmDelete());
shouldAskForIncludingCrossReferencesProperty.setValue(preferences.getCopyToPreferences().getShouldAskForIncludingCrossReferences());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Unrelated to PR)
@calixtus shouldn't this preference have gone to WorkspacePreferences instead of the root preference class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always depends on how complex it is. If possible, maintain flat hierarchies. If necessary, introduce a new preference class. Otherwise you wont find anything anymore and it gets harder for newcomers to read the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#12526 (comment)

@subhramit, after the updates, should I move this to Workspace Preferences or not?

@koppor
Copy link
Member

koppor commented Feb 18, 2025

Related to issue #12501

What does this mean?

Does it close the issue or just contribute to a part of it?

(We as maintainers should not be forced to read the issue itself - we should invest our time in providing feedback to the code or keep the development setup running)

@koppor
Copy link
Member

koppor commented Feb 18, 2025

Do not force-push! Force push is off limits and very bad style when working together on a project. (Mainly because it is not supported well by GitHub istself.) Commits will be lost, comments on commits will loose their context. This makes it harder to review. In the end, all commits will be squashed either way before being merged into the `main`` branch.

False alarm? @koppor

Should be fixed.

github-actions[bot]

This comment was marked as resolved.

@benlevycmp
Copy link
Contributor Author

Related to issue #12501

What does this mean?

Sorry, I should have been more specific. The issue brings up that once you ask not to be given the prompt again, there's no way to undo that. This fixes that problem, even though it doesn't implement the feature requested in the issue. This is why I said "related to" rather than "closes". I plan to make another pull request that closes the issue.

@benlevycmp
Copy link
Contributor Author

I think a prompt every time we copy an entry/ are copying multiple entries is useless if we have such a preference in the first place.
If we really want to use prompts, we can ask the user just once after jabref installation, or just once for each session when he tries to copy.

I can envision a scenario where a user is doing multiple copies and wants to include cross-refs for some but not others. In this case the user might have to open up the preferences many times to switch back and forth if there's no prompt. Also, if the prompt is easy to disable then it won't be an annoyance to users who don't need it.

@subhramit
Copy link
Member

I can envision a scenario where a user is doing multiple copies and wants to include cross-refs for some but not others. In this case the user might have to open up the preferences many times to switch back and forth if there's no prompt. Also, if the prompt is easy to disable then it won't be an annoyance to users who don't need it.

You have a point.

@priyanshu16095
Copy link
Contributor

priyanshu16095 commented Feb 19, 2025

@benlevycmp @subhramit In that scenario, user can select the entries which they want to copy and can choose whether they want to include cross-referenced entries or not, next time the same process, the dialog box will appear always until he chooses to not to show the dialog box.

This is what I mean.

Recording.2025-02-19.mp4

Have I understood the scenario correctly?

@subhramit
Copy link
Member

@benlevycmp @subhramit In that scenario, user can select the entries which they want to copy and can choose whether they want to include cross-referenced entries or not, next time the same process, the dialog box will appear always until he chooses to not to show the dialog box.

This is what I mean.

Recording.2025-02-19.mp4

Have I understood the scenario correctly?

Yep, this works.
This should be it.
So only a preference for the prompt.

@subhramit
Copy link
Member

subhramit commented Feb 21, 2025

@benlevycmp do you have any questions, after the discussion above?

@priyanshu16095 maybe you can guide him and help him complete the PR? I think the problem is clear now more or less. If possible, (in case I forget) - once this is merged, try to migrate "copy to" to a workspace preference. Tag this comment in the description, a separate issue isn't needed since it's a minor code quality fix.

@priyanshu16095
Copy link
Contributor

I have tried this, it works fine and solves the issue.
I will migrate the preferences to workspace preferences.

@benlevycmp
Copy link
Contributor Author

Is there anything else I need to do?

Copy link
Member

@subhramit subhramit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment

CHANGELOG.md Outdated
- The LibreOffice integration for CSL styles is now more performant. [#12472](https://github.com/JabRef/jabref/pull/12472)
- The "automatically sync bibliography when citing" feature of the LibreOffice integration is now disabled by default (can be enabled in settings). [#12472](https://github.com/JabRef/jabref/pull/12472)
- For the Citation key generator patterns, we reverted how `[authorsAlpha]` would behave to the original pattern and renamed the LNI-based pattern introduced in V6.0-alpha to `[authorsAlphaLNI]`. [#12499](https://github.com/JabRef/jabref/pull/12499)
- Added option to "General->User Interface" to enable/disable the prompt for including cross-references when using "Copy To".
Copy link
Member

@subhramit subhramit Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove changelog entry. "Copy to" is a feature introduced in an unreleased version. Also uncheck the mandatory check.
[Note that even if we were to keep it, we would have had to refine it using more context - "in preferences" etc.]

@ThiloteE ThiloteE changed the title Adds option to manually enable/disable the prompt for including cross-references when using Copy To Add manual prompt control for cross-references in Copy To Feb 24, 2025
@ThiloteE ThiloteE changed the title Add manual prompt control for cross-references in Copy To Preferences: Add manual prompt control for cross-references in Copy To Feb 25, 2025
@subhramit
Copy link
Member

@benlevycmp almost there, can you resolve the conflicts?

@benlevycmp
Copy link
Contributor Author

@subhramit done, thank you for your help.

@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 28, 2025
Merged via the queue into JabRef:main with commit 85e9478 Feb 28, 2025
@benlevycmp benlevycmp deleted the confirm-crossreff-copy-option branch March 11, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a preference for the "Copy to" option to include or exclude cross-reference entries

7 participants