Skip to content

Add numeric suffix to distinguish multiple untitled libraries#203

Closed
Copilot wants to merge 6 commits intomainfrom
copilot/add-numbering-to-empty-libraries
Closed

Add numeric suffix to distinguish multiple untitled libraries#203
Copilot wants to merge 6 commits intomainfrom
copilot/add-numbering-to-empty-libraries

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 29, 2026

When multiple unsaved libraries are open simultaneously, they all display as *untitled, making them indistinguishable in the tab bar.

Changes

  • LibraryTab.updateTabTitle(): When computing the title for an unsaved local library, enumerate all currently open untitled tabs from the tab container and use this tab's position index to generate a unique suffix:

    • 1st untitled tab → *untitled
    • 2nd untitled tab → *untitled (1)
    • 3rd untitled tab → *untitled (2), etc.

    Numbering is dynamic — tabs renumber when any untitled tab is closed. If the tab is not yet registered in the container (defensive fallback), it shows *untitled.

  • JabRef_en.properties: Added localization key untitled (%0) for the numbered form, following JabRef's placeholder convention.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.foojay.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx6g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • central.sonatype.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx6g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • files.jabref.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -jar /home/REDACTED/work/jabref/jabref/gradle/wrapper/gradle-wrapper.jar :jabgui:compileJava --no-daemon -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add numbering to empty library names on creation Add numeric suffix to distinguish multiple untitled libraries Mar 29, 2026
Copilot AI requested a review from InAnYan March 29, 2026 19:33
if (databaseLocation == DatabaseLocation.LOCAL) {
tabTitle.append('*');
tabTitle.append(Localization.lang("untitled"));
List<LibraryTab> untitledTabs = tabContainer.getLibraryTabs().stream()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you put this to a separate method? Like determine untitled count or something

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Extracted the logic into a private getUntitledTabTitle() method in 33d92f4.

Copilot AI requested a review from InAnYan March 30, 2026 07:15
Comment thread jabgui/src/main/java/org/jabref/gui/LibraryTab.java Outdated
…sed at call site

Agent-Logs-Url: https://github.com/InAnYan/jabref/sessions/e19d7098-4d32-469a-95ac-8ea969207b33

Co-authored-by: InAnYan <13097618+InAnYan@users.noreply.github.com>
Copilot AI requested a review from InAnYan March 30, 2026 18:45
Add method to get index for new untitled library.
@InAnYan InAnYan marked this pull request as ready for review March 30, 2026 19:21
@InAnYan InAnYan closed this Apr 11, 2026
@InAnYan InAnYan deleted the copilot/add-numbering-to-empty-libraries branch April 15, 2026 14:54
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.

2 participants