first attempt with deleting rows. deep diff algorithm needs more time in the cooker
This commit is contained in:
parent
041de66c64
commit
6d1e011621
2 changed files with 33 additions and 2 deletions
|
@ -146,6 +146,10 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
})();
|
||||
});
|
||||
|
||||
createEffect(() => {
|
||||
console.log(mutations());
|
||||
});
|
||||
|
||||
const commands = {
|
||||
close: createCommand('close folder', async () => {
|
||||
filesContext.remove('__root__');
|
||||
|
@ -183,7 +187,13 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
api()?.clear();
|
||||
}),
|
||||
delete: createCommand('delete selected items', () => {
|
||||
console.log(api()?.selection())
|
||||
const { selection, remove } = api() ?? {};
|
||||
|
||||
if (!selection || !remove) {
|
||||
return;
|
||||
}
|
||||
|
||||
remove(Object.keys(selection()));
|
||||
}, { key: 'delete', modifier: Modifier.None }),
|
||||
} as const;
|
||||
|
||||
|
@ -242,6 +252,8 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
}}>{file().name}</Context.Handle>;
|
||||
},
|
||||
] as const}</Tree>
|
||||
|
||||
<span>Total mutation: {mutations().length}</span>
|
||||
</Sidebar>
|
||||
|
||||
<Tabs active={setActive} onClose={commands.closeTab}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue