mengw15 commented on code in PR #9526:
URL: https://github.com/apache/texera/pull/9526#discussion_r4689904464
##########
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-filetree/user-dataset-version-filetree.component.ts:
##########
@@ -104,6 +104,29 @@ export class UserDatasetVersionFiletreeComponent
implements AfterViewInit, OnDes
@Input()
public isExpandAllAfterViewInit = false;
+ // Whether a file in this tree is an answer the host can take. A host that
browses the files of a
+ // version without holding one (the dataset picker in version mode, the
model picker) leaves
+ // nothing for a click to mean, and a highlighted row there would promise a
pick that is never
+ // made. Defaults to true, which is what every host that never binds it gets.
+ @Input()
+ public isFileSelectable = true;
+
+ // One handler for a click and for Enter/Space on the focused node: the
library maps the keys to
+ // TOGGLE_ACTIVE by default, which would strip the highlight off the picked
file, or mark a file
+ // the host never heard of.
+ private readonly activateOrExpand = (tree: any, node: any, $event: any):
void => {
+ if (node.hasChildren) {
Review Comment:
`node` can be null on the key path: hovering a row or clicking a folder
focuses the tree without focusing a node, so Enter/Space then throws `Cannot
read properties of null (reading 'hasChildren')`. The library default guards
with `node &&`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]