Skip to content

Improve TagsField of keywords#12633

Merged
Siedlerchr merged 14 commits into
JabRef:mainfrom
DD248017:fix-for-issue-10984
Mar 7, 2025
Merged

Improve TagsField of keywords#12633
Siedlerchr merged 14 commits into
JabRef:mainfrom
DD248017:fix-for-issue-10984

Conversation

@Lin-Hi

@Lin-Hi Lin-Hi commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

Changes

  1. On paste: If it is possible to add this keyword, directly add it without requiring the user to press Enter

    Before After
    paste-before paste-after
  2. Double click on keyword: remove it and enter edit mode.

    Before After
    doubleClick-before doubleClick-after
  3. Reorder keywords by drag and drop

    Before After
    drag-before drag-after
  4. Alphabetic ordering of keywords. In case the list is already alphabetically ordered, add the new keyword in alphabetical order. Otherwise, add it to the end

    Before After
    order-before order-after

Notes

This pull request is a new version of #12632 but solve checkstyle errors and branch name. The old pull request is closed and ignored.

Closes #10984

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.

ssimli and others added 12 commits March 5, 2025 16:52
- Can now paste multiple or single keywords without pressing enter

Related to JabRef#10984
- implement keyword removing and inserting through drag and drop
- show different color for dragged and dropped keywords (may require admin specify another color)
- run checkstyle with no error
- implement keyword removing and inserting through drag and drop
- show different color for dragged and dropped keywords (may require admin specify another color)
- run checkstyle with no error

Related to JabRef#10984
feat: reorder keywords by drag and drop
feat(keywordsEditor): Added paste function
feat(keywords): double click enters edit mode, new keywords are sorted alphabetically if list is sorted
Related to JabRef#10984
@subhramit subhramit changed the title Fix for issue 10984 Improve TagsField of keywords Mar 6, 2025
keywordTagsField.getEditor().setOnKeyPressed(evt -> {
KeyBindingRepository keyBindingRepository = Injector.instantiateModelOrService(KeyBindingRepository.class);

if (keyBindingRepository.checkKeyCombinationEquality(KeyBinding.PASTE, evt)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please expand the abbreviation "evt"

} else {
event.setDropCompleted(false);
}
draggedKeyword = null;

@subhramit subhramit Mar 6, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer using Optional<Keyword> instead of Keyword for draggedKeyword.

@subhramit subhramit added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 6, 2025
- expand abbreviation `evt` into `event` in line 111
- substitute `Keyword` by `Optional<Keyword>` for `draggedKeyword`

Related to JabRef#10984

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

@trag-bot

trag-bot Bot commented Mar 7, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@trag-bot

trag-bot Bot commented Mar 7, 2025

Copy link
Copy Markdown

Pull request summary

  • Added a new feature to reorder keywords using drag-and-drop functionality in the keyword editor.
  • Implemented automatic alphabetical sorting of keywords when they are added or modified.
  • Enhanced the pasting functionality to allow multiple keywords to be pasted from the clipboard.
  • Introduced a listener to manage the state of the keyword list and ensure it remains sorted.
  • Updated the context menu to support keyword actions such as copy, cut, and delete.
  • Improved user interaction by allowing double-clicking on keywords to edit them directly.
  • Added visual feedback during drag-and-drop operations for better user experience.
  • Ensured that the integrity of the keyword list is maintained during drag-and-drop actions.

@Lin-Hi

Lin-Hi commented Mar 7, 2025

Copy link
Copy Markdown
Contributor Author

Hi, I change code according to your reviews. Contact if there's more problem.

@subhramit subhramit requested a review from koppor March 7, 2025 10:34
@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 7, 2025
Merged via the queue into JabRef:main with commit 9fdcfe0 Mar 7, 2025
@Siedlerchr

Copy link
Copy Markdown
Member

Thanks for your work!

@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve TagsField of keywords

6 participants