Add placeholder daily note selection modal

This commit is contained in:
2026-03-19 10:54:44 -07:00
parent 0a8f333698
commit 2291bdfe3b
3 changed files with 34 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
import { App, Modal, Setting } from 'obsidian';
export class DailyNoteSelectModal extends Modal {
constructor(app: App, onSubmit: (result: string) => void) {
super(app);
this.setTitle('Select a daily note');
let name = '';
new Setting(this.contentEl)
.setName('Date')
.addMomentFormat((component) => {
});
new Setting(this.contentEl)
.addButton((btn) =>
btn
.setButtonText('Submit')
.setCta()
.onClick(() => {
this.close();
onSubmit(name);
}));
}
}

View File

@@ -4,6 +4,7 @@ import type { TodoItem } from '../core/types';
export interface TodoItemCallbacks {
onToggle: (todo: TodoItem) => void;
onMoveClick: (todo: TodoItem) => void;
onMoveDailyNoteClick: (todo: TodoItem) => void;
onClick: (todo: TodoItem) => void;
}

View File

@@ -1,8 +1,8 @@
import { ItemView, Keymap, Platform, TFile, WorkspaceLeaf } from 'obsidian';
import { ItemView, Platform, TFile, WorkspaceLeaf } from 'obsidian';
import type { TodoItem, TodoGroup } from '../core/types';
import { parseTodosGroupedByHeading } from '../core/todo-parser';
import { toggleTodo, collectTodoBlockLines, removeTodoBlock } from '../core/todo-transformer';
import { createTodoItemEl, collectChildLineNumbers } from './todo-item-component';
import { toggleTodo } from '../core/todo-transformer';
import { createTodoItemEl } from './todo-item-component';
export const TODO_VIEW_TYPE = 'todo-tracker-view';
@@ -144,6 +144,7 @@ export class TodoSidebarView extends ItemView {
const itemEl = createTodoItemEl(container, todo, {
onToggle: (t) => this.handleToggle(file, t),
onMoveClick: (t) => this.handleMoveClick(t, file),
onMoveDailyNoteClick: (t) => this.handleMoveDailyNoteClick(t, file),
onClick: (t) => this.openTodoInEditor(file, t),
});
@@ -349,4 +350,8 @@ export class TodoSidebarView extends ItemView {
new NoteSelectModal(this.app, todo, file).open();
});
}
private handleMoveDailyNoteClick(t: TodoItem, file: TFile): void {
}
}