Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 3490238

Browse files
committed
minor bug fixes:
- rerender of tasks - DnD performance - Select grouping of folders fix
1 parent 94929dd commit 3490238

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/components/cellTypes/TaskCell.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { SListItem } from "obsidian-dataview/lib/data-model/serialized/markdown"
44
import { DataviewService } from "services/DataviewService";
55
import React, { useEffect, useRef } from "react";
66
import { TableColumn } from "cdm/FolderModel";
7+
import { BaseComponent, Component, MarkdownRenderChild } from "obsidian";
78

89
const TaskCell = (taskProps: CellComponentProps) => {
910
const { defaultCell } = taskProps;
10-
const { cell, column, table } = defaultCell;
11+
const { cell, column, table, row } = defaultCell;
1112
const { view } = table.options.meta;
1213
let taskValue = cell.getValue();
1314
useEffect(() => {
@@ -17,16 +18,17 @@ const TaskCell = (taskProps: CellComponentProps) => {
1718
if ((column.columnDef as TableColumn).config.task_hide_completed) {
1819
taskValue = (taskValue as any).where((t: any) => !t.completed);
1920
}
20-
21+
const taskComponent = new MarkdownRenderChild(taskRef.current);
2122
DataviewService.getDataviewAPI().taskList(
2223
taskValue as Grouping<SListItem>,
2324
false,
2425
taskRef.current,
25-
view,
26-
view.file.path
26+
taskComponent,
27+
row.original.__note__.getFile().path
2728
);
29+
view.addChild(taskComponent);
2830
}
29-
});
31+
}, []);
3032
const taskRef = useRef<HTMLDivElement>();
3133

3234
return <div ref={taskRef}></div>;

src/helpers/VaultManagement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,14 @@ export async function moveFile(folderPath: string, info: {
377377
// Handle error
378378
throw error;
379379
}
380-
const filePath = `${folderPath} / ${info.file.name}`;
380+
const filePath = `${folderPath}/${info.file.name}`;
381381
await app.fileManager.renameFile(info.file, filePath);
382382
}
383383

384384
export async function createFolder(folderPath: string): Promise<void> {
385385
await app.vault.adapter.exists(folderPath).then(async exists => {
386386
if (!exists) {
387-
await app.vault.createFolder(`${folderPath} / `);
387+
await app.vault.createFolder(`${folderPath}/`);
388388
}
389389
});
390390
}

src/stateManagement/data/handlers/UpdateCellHandlerAction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default class UpdateCellHandlerAction extends AbstractTableAction<DataSta
3030

3131
// Update the row on disk
3232
if (isMovingFile && ddbbConfig.group_folder_column === column.id) {
33+
3334
const moveInfo = {
3435
file: rowTFile,
3536
id: column.id,

0 commit comments

Comments
 (0)