Skip to content

Conversation

@SanjulaGanepola
Copy link
Member

Changes

  • Add red error decoration for invalid libraries in the library list. This is just to make it more visible to the user (related to No specific warning when library list becomes invalid #2931).
    image
  • Add library icon to libraries in the library list
  • Automatically refresh the library list if a library in the library list is deleted from the Object Browser

How to test this PR

  1. Create a new library
  2. Add it to the library list
  3. Delete the library
  4. Observe that the library list was refreshed and the deleted library has a red error decoration

Checklist

  • have tested my change

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

👋 A new build is available for this PR based on ff28e6f.

Copy link
Collaborator

@chrjorgensen chrjorgensen left a comment

Choose a reason for hiding this comment

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

@SanjulaGanepola Great PR, learned some new stuff about decorators. 😃

Almost there, see other comment.

@SanjulaGanepola
Copy link
Member Author

@chrjorgensen Ready for review again!

Copy link
Collaborator

@chrjorgensen chrjorgensen left a comment

Choose a reason for hiding this comment

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

One issue found - see comment.

And we should not ask for adding the new library to the library list, if it's already there... right?

if (isSuccess) {
const config = connection.getConfig();
const libraryList = [config.currentLibrary, ...config.libraryList].map(library => library.toUpperCase());
if (libraryList.includes(newLibrary)) {
Copy link
Collaborator

@chrjorgensen chrjorgensen Oct 27, 2025

Choose a reason for hiding this comment

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

This does not work if the library created is not entered in uppercase...

Suggested change
if (libraryList.includes(newLibrary)) {
const libraryList = [config.currentLibrary, ...config.libraryList].map(library => connection.upperCaseName(library));
if (libraryList.includes(connection.upperCaseName(newLibrary))) {

Copy link
Member

Choose a reason for hiding this comment

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

Careful not to use to uppercase on an object name! Use the connection upperCase method to avoid breaking variant characters like 'à' that must no be uppercased.

Copy link
Collaborator

@chrjorgensen chrjorgensen Oct 27, 2025

Choose a reason for hiding this comment

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

@sebjulliand Good spot! Better now? 😃

Copy link
Member

Choose a reason for hiding this comment

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

Perfect! CCSID 297 users thank you! 😁

@chrjorgensen chrjorgensen added this to the 3.0.0 milestone Nov 1, 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.

No specific warning when library list becomes invalid

4 participants