Skip to content

Show the opened map's library name in the toolbar - #118

Merged
koppor merged 5 commits into
mainfrom
show-library-name
Oct 26, 2026
Merged

koppor merged 5 commits into
mainfrom
show-library-name

Conversation

@koppor

@koppor koppor commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

With several libraries open in JabRef it is unclear which library the current map belongs to. After opening a map, its library ID is now shown in the top right corner of the toolbar; it stays empty until a map was opened and fits at half screen width.

Refs #42

Test: start JabRef with the HTTP server enabled and at least one library open, run npm run dev, click "Open", pick a library, click "Open" in the dialog. The library's ID appears at the top right.

Tested with a stub HTTP server and the Electron build:

Full width Half width
full half

🤖 Generated with Claude Code

With several libraries open in JabRef it was unclear which library the
map belongs to. The library ID is now shown in the top right corner
after a map was opened.

Fixes #42

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@koppor
koppor marked this pull request as ready for review October 26, 2026 00:12
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Show the opened map’s library ID in the toolbar

✨ Enhancement 📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Show the opened map’s library ID so users can distinguish maps across open JabRef libraries.
• Keep the label empty until a map loads successfully, and truncate it within the toolbar.
• Document the addition in the changelog.
Diagram

graph TD
  Open["Map selection"] --> Client["HTTP client"] --> Result{"Load successful?"} -->|Yes| Show["Show library ID"]
  Result -->|No| Clear["Clear label"]
Loading
High-Level Assessment

Using the HTTP client’s existing currentLibrary value avoids introducing duplicate state. Updating the label at the end of the established map-open flow is proportionate to this UI change.

Files changed (3) +6 / -1

Enhancement (2) +5 / -1
index.htmlAdd a right-aligned toolbar label +4/-1

Add a right-aligned toolbar label

• Replaces the empty right-hand toolbar space with a label for the opened map’s library. The label uses text truncation within the existing one-third-width area.

index.html

main.jsPopulate the library label after map loading +1/-0

Populate the library label after map loading

• Sets the label to the HTTP client’s current library ID after a successful map load and clears it when loading fails.

src/main.js

Documentation (1) +1 / -0
CHANGELOG.mdDocument the toolbar library indicator +1/-0

Document the toolbar library indicator

• Adds an Unreleased entry describing the library name shown for an opened mind map and links issue #42.

CHANGELOG.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (1) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Users see an ID instead of library name 📎 Requirement gap ≡ Correctness
Description
currentLibraryLabel displays httpClient.currentLibrary, which is the selected library identifier
rather than a human-readable library name. When a map is opened, the toolbar therefore identifies
the map only by its server ID, leaving users unable to see the active library name requested by the
feature.
Code

src/main.js[383]

+    currentLibraryLabel.textContent = isMapOpened ? httpClient.currentLibrary : '';
Evidence
The checklist requires the active library name to be displayed. The changed line renders
httpClient.currentLibrary, while loadMap stores the selected library argument as
currentLibrary, showing that the toolbar receives the library identifier rather than a library
name.

Display the active library name
src/main.js[383-383]
http/HTTPClient.js[104-122]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The toolbar assigns the selected library identifier to the visible library label, but the feature requires displaying the active library's name.
## Fix Focus Areas
- src/main.js[383-383]
- http/HTTPClient.js[104-122]
## Recommended Fix
Obtain the human-readable library name from the available server response or library-selection data while retaining the library identifier for server requests, then assign that name to `currentLibraryLabel` after a successful map load.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Toolbar comment narrates an obvious layout ✓ Resolved
Description
The new HTML comment Library the opened map belongs to merely labels the adjacent toolbar region
instead of explaining a non-obvious implementation reason. Future maintainers encounter a redundant
comment whenever they edit this markup, while it adds no information beyond the visible label and
element structure.
Code

index.html[206]

+      <!--Library the opened map belongs to-->
Evidence
The compliance checklist requires comments to explain non-obvious rationale rather than narrate
obvious operations. The changed comment only states that the following region represents the library
of the opened map, which is already conveyed by the element's title and placement.

AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments: AGENTS.md: Write Purposeful Code Comments
index.html[206-209]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added HTML comment only narrates the purpose of the following toolbar element and does not document a non-obvious reason or constraint.
## Fix Focus Areas
- index.html[206-206]
## Recommended Fix
Remove the redundant comment; retain the semantic element and its accessible title to describe the library label.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/main.js Resolved
Comment thread index.html Resolved
@koppor
koppor merged commit 0bd0064 into main Oct 26, 2026
2 checks passed
@koppor
koppor deleted the show-library-name branch October 26, 2026 00:36
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.

1 participant