Initial
This commit is contained in:
136
requirements.md
Normal file
136
requirements.md
Normal file
@ -0,0 +1,136 @@
|
||||
# Yet Another Obsidian Task Plugin (YAOTP) — Requirements
|
||||
|
||||
## Overview
|
||||
|
||||
An Obsidian plugin that provides a more traditional task management GUI for designated markdown files within a vault. Task files are rendered in a custom view rather than the default markdown editor, and all changes are persisted back to the underlying markdown. The plugin supports both desktop and mobile Obsidian.
|
||||
|
||||
---
|
||||
|
||||
## 1. Task Files
|
||||
|
||||
### 1.1 Detection
|
||||
|
||||
- A **task file** is any markdown file whose vault path matches a user-configured regex pattern.
|
||||
- Default pattern: all `.md` files inside the top-level `Tasks/` folder (e.g., `^Tasks\/.*\.md$`).
|
||||
- When a task file is opened in Obsidian, the plugin automatically renders it in the custom task view instead of the default markdown editor.
|
||||
|
||||
### 1.2 Structure
|
||||
|
||||
- Task files consist entirely of markdown checklist items (`- [ ] …` / `- [x] …`).
|
||||
- Any non-checklist lines immediately following a checklist item are treated as **notes** for that item.
|
||||
- The ordering of checklist items in the file reflects the display order in the UI.
|
||||
- Completed items remain in the file until the user marks them as done, at which point they are moved to the current Daily Note (see §5).
|
||||
|
||||
### 1.3 Inbox File
|
||||
|
||||
- One task file is designated as the **Inbox** — the default destination for new tasks.
|
||||
- The Inbox file path is configured in plugin settings.
|
||||
- Default: `Tasks/Inbox.md`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Task View UI
|
||||
|
||||
### 2.1 Layout
|
||||
|
||||
- The custom view replaces the standard markdown editor for task files.
|
||||
- Each checklist item is displayed as a task row containing:
|
||||
- A clickable **checkbox** on the left.
|
||||
- The **task text**, which wraps to multiple lines as needed.
|
||||
- Notes are **not** shown inline; they are accessible via the task editor (§3).
|
||||
- The view does not render raw markdown syntax.
|
||||
|
||||
### 2.2 Reordering
|
||||
|
||||
- Task rows can be reordered by dragging and dropping within the view.
|
||||
- On mobile, reordering is triggered by a long-press on the drag handle, followed by dragging.
|
||||
- Reordering the UI immediately reorders the corresponding checklist items in the markdown file.
|
||||
- Notes travel with their parent task during reordering.
|
||||
|
||||
### 2.3 File Switcher
|
||||
|
||||
- A header bar or sidebar control lets the user quickly switch between:
|
||||
- The Inbox file.
|
||||
- Any other task file in the vault (matched by the configured regex).
|
||||
- The switcher also provides a **"New task file"** action that:
|
||||
- Prompts for a file name.
|
||||
- Creates the file in the configured tasks folder (or a location derived from the regex).
|
||||
- Opens the new file in the task view.
|
||||
|
||||
### 2.3 Adding a Task
|
||||
|
||||
- The first row of every task list is a persistent **add-task row** that looks identical to a regular task row.
|
||||
- The add-task row contains:
|
||||
- A **drag handle** (visually present but disabled — not interactive).
|
||||
- A **checkbox** (visually present but disabled — not interactive).
|
||||
- A single-line **text input** with placeholder text `Enter new task…`.
|
||||
- Typing into the input and pressing **Enter** creates a new task with that text, no notes, and inserts it at the top of the task list (immediately below the add-task row).
|
||||
- The new task is immediately persisted to the markdown file.
|
||||
- The add-task row is always visible, even when the list is empty.
|
||||
|
||||
### 2.4 Completing a Task
|
||||
|
||||
- Clicking a task's checkbox marks it as complete.
|
||||
- The task (and its notes) is removed from the current task file.
|
||||
- The task is appended to the **`#### Tasks`** section at the bottom of the current Daily Note (see §5).
|
||||
- If the `#### Tasks` section does not exist in the Daily Note, it is created.
|
||||
|
||||
---
|
||||
|
||||
## 3. Task Editor
|
||||
|
||||
- Clicking the **text** of a task opens an editor modal or inline panel.
|
||||
- The editor provides:
|
||||
- A single **multiline text area** containing the task text on the first line, followed by the notes. The first line is the task title; any subsequent lines are notes. The user edits both in one continuous field.
|
||||
- A **file selector** (dropdown or fuzzy-search picker) to move the task to a different task file. Selecting a different file removes the task from the current file and appends it to the bottom of the selected file.
|
||||
- Changes are saved back to the markdown file on confirm/close.
|
||||
|
||||
---
|
||||
|
||||
## 4. Markdown Persistence
|
||||
|
||||
- The markdown file is the source of truth.
|
||||
- All UI actions (reorder, complete, edit) must produce a corresponding update to the file via the Obsidian Vault API.
|
||||
- If a task file is modified externally (e.g., edited in another pane or by a sync tool), the task view refreshes to reflect the new state.
|
||||
- Checklist format written back to disk:
|
||||
```
|
||||
- [ ] Task title
|
||||
|
||||
notes line 1
|
||||
notes line 2
|
||||
|
||||
- [ ] Next task
|
||||
```
|
||||
Notes are separated from the checklist item above by one blank line and followed by one blank line before the next checklist item. Completed items use `- [x] …`.
|
||||
|
||||
---
|
||||
|
||||
## 5. Daily Note Integration
|
||||
|
||||
- The plugin relies on Obsidian's Daily Notes core plugin (or compatible community plugin) to locate the current daily note.
|
||||
- When a task is completed, the plugin:
|
||||
1. Finds or creates today's daily note.
|
||||
2. Looks for a `#### Tasks` heading at the bottom of the file.
|
||||
3. Appends the completed task and its notes under that heading, using the same format as the task file (task line, blank line, notes, blank line).
|
||||
4. If the task has no notes, only the task line is appended.
|
||||
- If the Daily Notes plugin is not enabled, the plugin displays a warning and does not move the task.
|
||||
|
||||
---
|
||||
|
||||
## 6. Plugin Settings
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---|---|---|
|
||||
| **Inbox file path** | Vault-relative path to the Inbox task file | `Tasks/Inbox.md` |
|
||||
| **Task file regex** | Regex matched against vault-relative file paths to identify task files | `^Tasks\/.*\.md$` |
|
||||
| **Daily note date format** | Date format string used to locate the daily note (should match Daily Notes plugin setting) | `YYYY-MM-DD` |
|
||||
| **Daily note folder** | Folder where daily notes are stored (should match Daily Notes plugin setting) | *(empty — vault root)* |
|
||||
|
||||
---
|
||||
|
||||
## 7. Out of Scope (v1)
|
||||
|
||||
- Due dates, priorities, or labels on tasks.
|
||||
- Subtasks / nested checklists.
|
||||
- Task search or filtering.
|
||||
- Sync with external task services (Todoist, Things, etc.).
|
||||
Reference in New Issue
Block a user