Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultOpenSidebar option seems not to work in MM 3.1.4 #226

Closed
wu-lee opened this issue Dec 15, 2023 · 5 comments
Closed

defaultOpenSidebar option seems not to work in MM 3.1.4 #226

wu-lee opened this issue Dec 15, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@wu-lee
Copy link
Contributor

wu-lee commented Dec 15, 2023

Describe the bug
If the defaultOpenSidebar configuration option is set in a mykomap page, the sidebar doesn't open automatically on opening the map. Appears to be the case whether or not this compiled into the config or is set in the URL parameters.

To Reproduce
This is manifesting in the new ICA map at https://dev.maps.coop/ica/.

See https://github.com/DigitalCommons/ica-project/issues/27#issuecomment-1855529906

Currently you can just visit that above URL, and note that the sidebar is not open.

To attempt to reproduce it in other maps, append ?defaultOpenSidebar=true to the map URL

Expected behavior
The sidebar should be opened automatically when the map is opened.

Additional context

@wu-lee
Copy link
Contributor Author

wu-lee commented Dec 15, 2023

It's not clear why this is happening. There are no errors I can detect.

It appears to be the result of a promise resolution not occurring when the webpage has loaded. The code which opens the sidebar is just not run as a resolution of the promise. Inserting trace logs, the resolution appears not to be failing either.

@wu-lee
Copy link
Contributor Author

wu-lee commented Jan 10, 2024

Note that as mentioned in the ObO issue above, this appears not to be a problem there...

@wu-lee
Copy link
Contributor Author

wu-lee commented Feb 23, 2024

I've found that the sidebar load can fail when the vocabs don't load in time, and an exception is thrown, which aborts the routine which does the opening.

This was masked by a rejected promise with no handler, so the error wasn't reported anywhere, and the fact that the vocabs are there later when the sidebar is opened manually, so everything then works. I've added a handler which reports errors like this on the console.

I've also altered the code slightly to avoid trigging this error - when vocabs are not available the sidebar is populated in a best-effort manner, instead of throwing an exception. Which should be temporary, as mentioned.

This allows the sidebar auto-opening to complete successfully.

Fix is in Mykomap v3.1.5

@wu-lee
Copy link
Contributor Author

wu-lee commented Feb 23, 2024

Small consequence of the above: on initial page load, sidebar opens, only "All Entries" shows for a moment, then the entries appear.

@ColmDC
Copy link
Contributor

ColmDC commented Feb 23, 2024

Confirm it works in https://dev.maps.coop/ica/ on Firefox.

Small consequence of the above: on initial page load, sidebar opens, only "All Entries" shows for a moment, then the entries appear.

Not a problem.

@ColmDC ColmDC closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants