-
Notifications
You must be signed in to change notification settings - Fork 255
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
Additional TOC implementations #2944
Conversation
That includes ranges with visible canvases in their members / canvases / items as well as their parent ranges.
onClick and onKeyDown should be replaced once material-ui TreeItem has node selection support: mui/material-ui#16795
A range might appear more than once in the structure tree, so it's id is not unique to the tree.
Default variant has changed to 'tableOfContents', test for index list will fail with default.
Codecov Report
@@ Coverage Diff @@
## toc #2944 +/- ##
=========================================
+ Coverage 92.58% 93.28% +0.7%
=========================================
Files 158 159 +1
Lines 2347 2414 +67
=========================================
+ Hits 2173 2252 +79
+ Misses 174 162 -12
Continue to review full report at Codecov.
|
@@ -57,3 +57,18 @@ export function removeCompanionWindow(windowId, id) { | |||
windowId, | |||
}; | |||
} | |||
|
|||
/** */ | |||
export function toggleNode(windowId, id, nodeId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope to get it done by tomorrow.
@@ -25,6 +25,14 @@ export function companionWindowsReducer(state = {}, action) { | |||
return removeIn(state, [action.id]); | |||
case ActionTypes.IMPORT_MIRADOR_STATE: | |||
return action.state.companionWindows; | |||
case ActionTypes.TOGGLE_TOC_NODE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vastly simplified the reducer and added a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have noticed, but you did already fix this last year in #2921. The fix is just not in the branch. |
Ah maybe I did. Thanks for pointing that :) |
Changes / Additions:
onNodeSelect
once [Treeview] Add node selection support mui/material-ui#18357 is merged.To be done:
Range
items of typeSpecificResource
(instead ofCanvas
with or without fragment) do work; support those if that's not the caseI temporarily stored the Range ids of open nodes instead of the node ids themselves but encountered manifests where a Range would appear on different branches of the tree, so I dismissed that idea. Any thoughts on that?