-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore: open / close notebook widgets #17375
Changes from 2 commits
923c095
fbaa8d8
b306117
5411813
d5b7939
c7dade6
b7faf60
a836b78
6c4b3e1
bba72cb
675168a
af079ee
7e190bb
d327e6e
9d715a9
d2c7348
63b3c0c
fd883c7
f2fcbd3
1ff763d
33d201d
632b16e
da3cc83
4067347
fefb59e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ export const notebookLogic = kea<notebookLogicType>([ | |
exportJSON: true, | ||
showConflictWarning: true, | ||
onUpdateEditor: true, | ||
setIsShowingSidebar: (showing: boolean) => ({ showing }), | ||
registerNodeLogic: (nodeLogic: BuiltLogic<notebookNodeLogicType>) => ({ nodeLogic }), | ||
unregisterNodeLogic: (nodeLogic: BuiltLogic<notebookNodeLogicType>) => ({ nodeLogic }), | ||
setEditable: (editable: boolean) => ({ editable }), | ||
|
@@ -162,6 +163,13 @@ export const notebookLogic = kea<notebookLogicType>([ | |
setEditable: (_, { editable }) => editable, | ||
}, | ||
], | ||
isShowingSidebar: [ | ||
false, | ||
{ | ||
setSelectedNodeId: () => false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be here anymore. If we are changing to a user initiated opening then I think we should leave it open until either the setting is closed or the source node is deleted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. I made a change to leave the sidebar open except in the case when you click a non-custom node (e.g. paragraph) |
||
setIsShowingSidebar: (_, { showing }) => showing, | ||
}, | ||
], | ||
}), | ||
loaders(({ values, props, actions }) => ({ | ||
notebook: [ | ||
|
@@ -327,10 +335,6 @@ export const notebookLogic = kea<notebookLogicType>([ | |
} | ||
}, | ||
], | ||
isShowingSidebar: [ | ||
(s) => [s.selectedNodeLogic], | ||
(selectedNodeLogic) => selectedNodeLogic?.values.isShowingWidgets, | ||
], | ||
}), | ||
sharedListeners(({ values, actions }) => ({ | ||
onNotebookChange: () => { | ||
|
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 feel like this should toggle, rather than just showing. And it would be great if it could have an "active" state if open.