Config tree wip#1411
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@LlGC-mag, Just a quick note, while testing with a custom config, I was a bit confused by the 'Clear saved viewer state before applying' option. I expected it to remove what I had just pasted, similar to how 'Clear annotation' works. But it seems to keep the pasted config regardless. I know this is still a WIP, and my feedback might be a bit out of scope for this PR, but I just thought I’d mention it in case it helps with refining the config workflow. |
|
@LanieOkorodudu, the "Clear saved viewer state" erases the browser's storage to reset the viewer state to default (e.g. forgetting any panel open/closed states that were stored as the result of user action). This is important because if you change default panel settings but the viewer remembers user activities, it appears as if the configuration had no effect, because the browser storage overrides the configurations. Maybe we need a better label for this checkbox to make its behavior more clear. Do you have any suggestions? Maybe something like "Reset browser storage to default state when applying configuration"? |
|
@LanieOkorodudu Maybe the wording needs changing? The function is to remove any user settings stored by the browser which override the config which is pasted in or loaded by default. That work was in #1407 but it is required for the accordion menu underneath the main options. |
|
I took a closer look at this, and it's off to an excellent start! A few comments:
|
|
@demiankatz I've just pushed some changes and I hadn't seen your message until now. Most of the things you mention are things I've added:
I imagine that I'll get this branch in a useable state, get it tested, then create a new branch and tidy things up before making a new PR |
|
Thanks, @LlGC-mag -- all sounds good! I don't think there's a need to create a separate PR, though; I see no disadvantage to just getting this one in shape and then squash-and-merging it when it's ready. :-) |
@demiankatz, I agree with what you suggested here. That makes sense to me. |
…o onclick. Prevents original values being duplicated in the custom config
|
@LlGC-mag, @demiankatz, I'm a bit curious about this config option, "saveUserSettings". Does it refer to the settings tab? I tried changing the locale to something else, but when I set this config to true, it doesn't save my selected locale and instead defaults back to English. Also; |
|
@LanieOkorodudu, I am also confused by
|
I appreciate you taking the time to provide a detailed explanation. |
|
I've tested most of the configuration options, and I wanted to highlight a few that left me a bit confused during testing, as it wasn’t always clear what behaviour to expect when applying them:
It would be helpful to have some clarification or examples on what these configurations are intended to do, especially when defined. Most of the commonly used options, particularly those related to the footerPanel, worked as expected, which is great. This is a broad and complex area, and we can't expect everything to be perfect right away. What I really appreciate about this PR is that it enables manual adjustment and testing of config options, which will be valuable going forward. From my side, I'm happy for this PR to be merged. That said, others are more than welcome to add their input in case I've missed anything or didn’t cover enough in testing. Thanks again @LlGC-mag and @demiankatz for the work you’ve both put into this! |
|
@LanieOkorodudu, there is a checklist of settings that need better documentation on #1419. Several of the settings you mentioned were already on there, and I have added the others you mentioned to the list so we remember to investigate them further. |
|
After another look through the code there are some improvements I can see but nothing urgent enough to not merge it at this point if you're happy with the code and functionality? |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @LlGC-mag -- I think this is pretty close to being ready to merge. See below for a few comments and suggestions. There are some code style issues (mostly related to indentation) that we should definitely fix before merging, but which shouldn't be much work to address (especially the ones where you can just click to accept my suggestions automatically). I also had some broader suggestions about increased use of CSS and refactoring to smaller functions; you're welcome to use or ignore these ideas as you see fit -- I think they would help improve readability, but they shouldn't stand in the way of merging if you think it would be too much time/effort to implement them, or if you disagree with the approach.
|
|
||
| toggleButton.addEventListener("click", () => { | ||
| const isHidden = contentContainer.style.display === "none"; | ||
| contentContainer.style.display = isHidden ? "block" : "none"; |
There was a problem hiding this comment.
More logic that feels like it might be more clearly implemented with a class and some CSS definitions.
There was a problem hiding this comment.
Reworked this in one of the latest commits so that it toggles between classes
There was a problem hiding this comment.
It's still here -- has that change not been pushed up yet?
There was a problem hiding this comment.
It was pushed so the changes should be visible : a3d1ea7
There was a problem hiding this comment.
Ahh, I was looking for the direct .style.display assignment to be replaced with a class change, but I suppose that's not strictly necessary (unless we could use a single "open" / "closed" class to control both the icon and the visibility of the contents... but if that's too much work, no need to hack further).
| } | ||
| } else { | ||
| const valueElement = document.createElement("div"); | ||
| if (typeof value === "boolean") { |
There was a problem hiding this comment.
I don't insist on it, but it might improve readability to do some refactoring here -- e.g. create a getTrueFalseSelect function that you call for the inside of this if statement, etc., just so there's not so much code between the if/else clauses.
There was a problem hiding this comment.
(This might also help reduce the chances of further indentation problems by keeping code blocks shorter and more self-contained).
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
…ntListener, rework caret dropdown actions
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @LlGC-mag! I think this is in good enough shape to merge. Just noticed a couple of blank lines at the end of code blocks that we might as well tighten up. We also certainly could continue discussing refactoring/simplification, but if you feel we've reached a good stopping point, I don't see the need to drag things out forever and will be happy to approve and merge (after a final round of testing, of course).
|
|
||
| toggleButton.addEventListener("click", () => { | ||
| const isHidden = contentContainer.style.display === "none"; | ||
| contentContainer.style.display = isHidden ? "block" : "none"; |
There was a problem hiding this comment.
Ahh, I was looking for the direct .style.display assignment to be replaced with a class change, but I suppose that's not strictly necessary (unless we could use a single "open" / "closed" class to control both the icon and the visibility of the contents... but if that's too much work, no need to hack further).
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
|
Thanks @demiankatz - those final bits of whitespace should be gone now and hopefully the testers won't find anything major! |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @LlGC-mag, I'm happy to approve this for now. It's still in draft mode, so if you're done, you should take it out of draft so it can be merged.
If you want to do more work related to my earlier suggestions, there's certainly further improvement that could be made, but that can also be addressed later. It's working and reasonable as-is!
|
@demiankatz Thanks Demian - moved to ready for review now |
|
Thanks, @LlGC-mag, I have merged this! |
Adds function to process current config and merge any custom config, then display the results at the bottom of the page in a very poorly styled accordion.
Drill down through the tree to see the config options, and display the current value (if any). If there is no value, the button will appear inactive.
Requires work from #1407
NB. very much a work in progress and there are likely to be bugs - please let me know if you come across any