Skip to content

Fix import selected groups#11271

Merged
Siedlerchr merged 3 commits into
mainfrom
fixImportSelectedGroups
May 2, 2024
Merged

Fix import selected groups#11271
Siedlerchr merged 3 commits into
mainfrom
fixImportSelectedGroups

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented May 1, 2024

Copy link
Copy Markdown
Member

Fixes #11085
Fixes #11269
Fixes #8933

Equals/hashcode changes too much

  1. Create a new empty library
  2. add a subgroup
  3. Paste two or more entries in the subgroup

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • 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.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 1, 2024
Comment thread CHANGELOG.md Outdated
* @return The generated UID in UUIDv4 format
*/
public String getUid() {
return uid;

@HoussemNasri HoussemNasri May 1, 2024

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.

The usage of a plain UUID as a key was confusing while using the debugger, it wasn't intuitive to know what database/library it was referring to:

image

Maybe we do something like {databasename}_{uid}? Or just the database name, I don't know if that would work though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was thinking about such things as well and tried some things, however

  1. A new unsaved database doesn't have a path
  2. If it's a shared database it doesn't have a path as well, it has a shared database
  3. Saving under a new path/name will change the key, and we lose the reference

However, I now added the prefix bibdatabasecontext to. make it a bit more clear where the uid is related to

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.

How about?

if databasename is empty:
     uid = "bibdatabasecontext_${uid}"
else 
    uid = "${databasename}_${uid}"

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.

Saving under a new path/name will change the key, and we lose the reference

Ah okay I see, I'm fine with the bibdatabasecontext_ prefix for now but we really should consider other options later.

Comment thread src/main/java/org/jabref/gui/StateManager.java
@github-actions

github-actions Bot commented May 1, 2024

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@Siedlerchr Siedlerchr enabled auto-merge May 1, 2024 18:44

@HoussemNasri HoussemNasri left a comment

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.

LGTM! Sorry for the delay to approve.

@Siedlerchr Siedlerchr added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit ca16e86 May 2, 2024
@Siedlerchr Siedlerchr deleted the fixImportSelectedGroups branch May 2, 2024 09:39
@koppor koppor mentioned this pull request Jun 20, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected group loses focus after paste doi Import from bibtex on clipboard to a custom group New entry: not always added to the selected group

2 participants