Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
41c6116
Fix bulk imports adding entries to navigation history
shubhamk0205 Dec 11, 2025
e760841
Trigger CI
shubhamk0205 Dec 11, 2025
3c5271f
Trigger CI
shubhamk0205 Dec 11, 2025
f1d5717
Trigger CI
shubhamk0205 Dec 11, 2025
bdb70b9
Suppress navigation history updates for bulk insertions
shubhamk0205 Dec 13, 2025
cbd9813
fix formatting issue
shubhamk0205 Dec 13, 2025
4be103c
fix formatting
shubhamk0205 Dec 14, 2025
4fd6f05
fix formatting
shubhamk0205 Dec 14, 2025
b6b2b62
fix formatting
shubhamk0205 Dec 14, 2025
08d6bbd
Trigger CI
shubhamk0205 Dec 14, 2025
0042466
Trigger CI
shubhamk0205 Dec 14, 2025
f43ade9
reverted unrelated formatting changes
shubhamk0205 Dec 15, 2025
db97184
fix CI errors
shubhamk0205 Dec 15, 2025
e4922b9
fix importHandler
shubhamk0205 Dec 15, 2025
3f4cbfb
reverted unrelated changes
shubhamk0205 Dec 15, 2025
7612988
reverted unrelated changes
shubhamk0205 Dec 15, 2025
a75ba39
fixed
shubhamk0205 Dec 15, 2025
db4a930
Refactor navigation suppression to use nesting-aware boolean
shubhamk0205 Dec 23, 2025
14faff5
Refactor navigation suppression to use nesting-aware boolean
shubhamk0205 Dec 23, 2025
2b3aed4
Fix: Prevent ghost navigation history entries from bulk imports (#13878)
shubhamk0205 Jan 3, 2026
efdd797
Fix: Prevent ghost navigation history entries from bulk imports (#13878)
shubhamk0205 Jan 3, 2026
8fd45e8
Merge branch 'main' into fix-for-issue-13878-v2
shubhamk0205 Jan 3, 2026
6ee1150
Move #13878 entry to Unreleased section
shubhamk0205 Jan 3, 2026
23a27e2
update comments
shubhamk0205 Jan 13, 2026
eb293dc
Merge remote-tracking branch 'upstream/main' into fix-for-issue-13878-v2
shubhamk0205 Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an error on startup when using portable preferences. [#14729](https://github.com/JabRef/jabref/issues/14729)
- We fixed an issue when warning for duplicate entries in the "New Entry" dialog. [#14662](https://github.com/JabRef/jabref/pull/14662)
- We fixed the Quality > Automatically set file links button. Now if a file is moved, the button can relink the moved file to the broken linked file. [#9798](https://github.com/JabRef/jabref/issues/9798)
- We fixed an issue where bulk import operations polluted the navigation history, making the Back/Forward buttons navigate through imported entries instead of only user-selected entries. [#13878](https://github.com/JabRef/jabref/issues/13878)
- We fixed an issue where JabRef would not start on Linux ARM due to missing binaries for postgres-embedded [#14783](https://github.com/JabRef/jabref/issues/14783)
- We fixed an issue where JaRef would not correctly remember the opened side panels in the preferences [#14818](https://github.com/JabRef/jabref/issues/14818)

Expand Down
34 changes: 30 additions & 4 deletions jabgui/src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,25 @@ public void insertEntry(final BibEntry bibEntry) {
insertEntries(List.of(bibEntry));
}

/**
* Inserts the given entries into the database and updates the UI accordingly.
* <p>
* For single-entry imports, the entry is selected and optionally opened in the editor
* (based on user preferences), which adds it to the navigation history.
* </p>
* <p>
* For bulk imports (multiple entries), all entries remain selected but individual
* entry focus is skipped. This prevents pollution of the navigation history with
* entries the user never explicitly clicked on.
* </p>
* <p>
* This behavior addresses issue #13878 where bulk imports were creating "ghost"
* navigation history entries.
* </p>
*
* @param entries the list of entries to insert; must not be empty
* @see <a href="https://github.com/JabRef/jabref/issues/13878">Issue #13878</a>
*/
public void insertEntries(final List<BibEntry> entries) {
if (entries.isEmpty()) {
return;
Expand All @@ -831,10 +850,17 @@ public void insertEntries(final List<BibEntry> entries) {
getUndoManager().addEdit(new UndoableInsertEntries(bibDatabaseContext.getDatabase(), entries));
markBaseChanged();
stateManager.setSelectedEntries(entries);
if (preferences.getEntryEditorPreferences().shouldOpenOnNewEntry()) {
showAndEdit(entries.getFirst());
} else {
clearAndSelect(entries.getFirst());

// Only show/select individual entry for single-entry imports.
// For bulk imports (size > 1), we skip the clearAndSelect call.
// This prevents navigation history pollution because the listener
// only adds to history when entries.size() == 1.
if (entries.size() == 1) {
if (preferences.getEntryEditorPreferences().shouldOpenOnNewEntry()) {
showAndEdit(entries.getFirst());
} else {
clearAndSelect(entries.getFirst());
}
}
}

Expand Down