Skip to content

Commit 814a726

Browse files
authored
Merge pull request #6 from ravivyas84/task-id-feature
Task id feature
2 parents 1f46753 + 04bfdb5 commit 814a726

8 files changed

Lines changed: 899 additions & 41 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6-
/daily-notes
6+
/daily-notes
7+
01-journal/

README.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ A VS Code extension for managing daily notes with built-in task tracking. It pro
77
## Features
88

99
- **Daily Notes Panel** — Lists all `.md` files matching `yyyymmdd` or `yyyy-mm-dd` format, sorted newest-first. Today's note gets a star icon.
10-
- **Open Tasks Panel** — Aggregates all uncompleted tasks from every daily note, grouped by `+Project`, sorted by priority. Click a task to jump to its source note.
10+
- **Calendar Panel (Grid)** — Month grid calendar with:
11+
- Today highlighting
12+
- Underline marker when a note exists for a date
13+
- Quick actions (New, Today, prev/next month)
14+
- Click a day to open/create that daily note
15+
- **To Do Panel** — Aggregates all uncompleted tasks from every daily note, grouped by `+Project`, sorted by priority. Click a task to jump to its source note.
1116
- **Task Rollover** — When creating today's note, uncompleted tasks from the most recent previous note are automatically carried forward.
1217
- **Generate todo.md** — Scans all daily notes and writes a `todo.md` with every task grouped by project, including dates and priority.
1318
- **Generate Sample Todo Data** — Creates (or appends to) `2000-01-01.md` with demo tasks and sample note text for quick walkthroughs.
1419
- **Insert Title from Filename** — Converts the current filename into a heading at the cursor position (e.g., `my-meeting-notes` becomes `# My Meeting Notes`).
1520
- **Optional Autosave + Todo Processing** — When enabled, autosaves dirty files every 10 seconds and on editor switch, then refreshes todo processing for changed daily-note files.
21+
- Autosave pauses while typing and resumes 5 seconds after the last change.
1622

1723
## Task Syntax
1824

@@ -21,10 +27,10 @@ Write tasks in your daily notes using markdown checkboxes with optional [todo.tx
2127
```markdown
2228
## Tasks
2329

24-
- [ ] (A) Fix critical login bug +Backend @work
25-
- [ ] (B) Review design mockups +UI @work
26-
- [x] (C) Update dependencies +Backend
27-
- [ ] Buy groceries
30+
- [ ] (A) Fix critical login bug +Backend @work id:abc cd:2026-02-12 due:2026-02-20
31+
- [ ] (B) Review design mockups +UI @work id:def cd:2026-02-12
32+
- [x] (C) Update dependencies +Backend id:ghi cd:2026-02-12 dd:2026-02-14
33+
- [ ] Buy groceries id:jkl cd:2026-02-12
2834
```
2935

3036
| Element | Syntax | Example |
@@ -33,15 +39,33 @@ Write tasks in your daily notes using markdown checkboxes with optional [todo.tx
3339
| Project | `+ProjectName` | `+Backend`, `+UI` |
3440
| Context | `@context` | `@work`, `@phone` |
3541
| Completed | `[x]` or `[X]` | `- [x] Done task` |
42+
| ID | `id:<id>` | `id:abc` |
43+
| Create date | `cd:<date>` | `cd:2026-02-12` |
44+
| Due date | `due:<date>` | `due:2026-02-20` |
45+
| Done date | `dd:<date>` | `dd:2026-02-14` |
3646

3747
Tasks can have multiple project and context tags.
3848

49+
### Metadata Auto-Management
50+
51+
- The extension auto-adds `id:` and `cd:` to tasks when you save a daily note.
52+
- `cd:` defaults to the date in the note filename.
53+
- When a task is completed (`[x]`), the extension adds `dd:` using today’s date; if you un-complete it, `dd:` is removed.
54+
- `due:` is user-managed (the extension does not add or change it).
55+
- `id:`, `cd:`, `due:`, `dd:` are normalized to postfix tokens at the end of the task line on save (if you type them earlier in the line, they are moved to the end).
56+
- Date token format matches your configured `dailyNotes.dateFormat`.
57+
3958
## Commands
4059

4160
| Command | Description |
4261
|---------|-------------|
4362
| `dailyNotes: Refresh Daily Notes` | Refresh both the daily notes and open tasks panels |
63+
| `dailyNotes: Focus Daily Notes Panel` | Focus the Daily Notes view |
64+
| `dailyNotes: Focus Calendar Panel` | Focus the Calendar view |
65+
| `dailyNotes: Focus To Do Panel` | Focus the To Do view |
4466
| `dailyNotes: Open Daily Note` | Open today's note (creates it if it doesn't exist, with task rollover) |
67+
| `dailyNotes: Open Daily Note For Date` | Create/open a daily note for a specific date (format matches your settings) |
68+
| `dailyNotes: Calendar - Go To Today` | Jump the calendar to today and open/create today's note |
4569
| `dailyNotes: Insert Title from Filename` | Insert the filename as a `# Heading` at the cursor |
4670
| `dailyNotes: Generate todo.md from All Notes` | Scan all notes and write a grouped `todo.md` |
4771
| `dailyNotes: Generate Sample Todo Data` | Create/append `2000-01-01.md` with sample tasks for demos, then refresh todo processing |
@@ -74,9 +98,10 @@ Tasks can have multiple project and context tags.
7498
1. Set `dailyNotes.folder` in VS Code settings.
7599
2. Open the **Daily Notes** panel.
76100
3. On first open, choose **Run Demo Now** (or run `dailyNotes: Generate Sample Todo Data` manually).
77-
4. Open `2000-01-01.md` and review/edit sample tasks.
101+
4. Open `2000-01-01.md` and save once to let the extension add `id:`/`cd:`/`dd:` tokens and normalize any `due:` tokens to the end.
78102
5. Run `dailyNotes: Generate todo.md from All Notes` to produce a grouped `todo.md`.
79103
6. (Optional) Enable `dailyNotes.autoSaveEnabled` to autosave every 10 seconds and on editor switch with automatic todo refresh processing.
104+
7. Use the Calendar view to click dates, create notes for specific days, and jump to today.
80105

81106
## Development
82107

@@ -132,7 +157,7 @@ This requires [vsce](https://github.com/microsoft/vscode-vsce) (`npm install -g
132157
To install the packaged extension:
133158

134159
```bash
135-
code --install-extension dailynotes-panel-0.0.4.vsix
160+
code --install-extension dailynotes-panel-0.1.2.vsix
136161
```
137162

138163
## Project Structure
@@ -157,17 +182,22 @@ You can raise an issue on the [GitHub repo](https://github.com/ravivyas84/dailyn
157182

158183
## Release Notes
159184

160-
### 0.0.6 (Current)
185+
### 0.1.2 (Current)
186+
187+
**Note:** `0.0.5` was skipped.
161188

162-
**Note:** `0.0.5` was skipped. The current release is `0.0.6`.
189+
- Calendar month grid (webview) with today highlighting, month navigation, and “note exists” underline marker.
190+
- Create/open notes for a specific date from the calendar or via command.
191+
- Task metadata tokens: `id:`, `cd:`, `due:`, `dd:` with auto-management on save.
192+
- `todo.md` now includes wiki links for note references (`[[YYYY-MM-DD]]`) and a generated-file header comment.
193+
- Focus commands for Daily Notes / Calendar / To Do panels.
194+
- Autosave now pauses while typing and resumes 5 seconds after inactivity.
163195

164-
- Added `dailyNotes: Generate Sample Todo Data` command to create/append `2000-01-01.md` with demo tasks.
165-
- Added first-open Daily Notes panel prompt to run demo setup quickly.
166-
- Added empty-state action in the Daily Notes panel to generate demo data when no notes exist.
167-
- Added `dailyNotes.autoSaveEnabled` setting to autosave dirty files every 10 seconds and on editor switch.
168-
- After autosave, daily-note task changes are reprocessed and todo output is refreshed.
169-
- Updated documentation for new commands, settings, and demo quick start.
196+
### 0.1.1
170197

198+
- Improved demo onboarding and sample task generation.
199+
- Added autosave todo-refresh wiring and better empty states.
200+
r
171201
### 0.0.5 (Skipped)
172202

173203
**Note:** Version `0.0.5` was intentionally skipped.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "dailynotes panel",
44
"icon": "resources/dailyNotes.png",
55
"description": "An extension to help you with your daily notes. It has a panel which lists your daily notes in order",
6-
"version": "0.0.6",
6+
"version": "0.1.2",
77
"engines": {
88
"vscode": "^1.95.0"
99
},
@@ -15,7 +15,7 @@
1515
"activitybar": [
1616
{
1717
"id": "dailyNotesContainer",
18-
"title": "Daily Notes",
18+
"title": "To Do Daily Notes",
1919
"icon": "resources/dailyNotes.svg"
2020
}
2121
]
@@ -26,9 +26,14 @@
2626
"id": "dailyNotes",
2727
"name": "Daily Notes"
2828
},
29+
{
30+
"id": "calendarView",
31+
"name": "Calendar",
32+
"type": "webview"
33+
},
2934
{
3035
"id": "todoView",
31-
"name": "Open Tasks"
36+
"name": "To Do"
3237
}
3338
]
3439
},
@@ -37,10 +42,30 @@
3742
"command": "dailyNotes.refresh",
3843
"title": "dailyNotes: Refresh Daily Notes"
3944
},
45+
{
46+
"command": "dailyNotes.focusDailyNotes",
47+
"title": "dailyNotes: Focus Daily Notes Panel"
48+
},
49+
{
50+
"command": "dailyNotes.focusCalendar",
51+
"title": "dailyNotes: Focus Calendar Panel"
52+
},
53+
{
54+
"command": "dailyNotes.focusTodo",
55+
"title": "dailyNotes: Focus To Do Panel"
56+
},
57+
{
58+
"command": "dailyNotes.calendarToday",
59+
"title": "dailyNotes: Calendar - Go To Today"
60+
},
4061
{
4162
"command": "dailyNotes.openNote",
4263
"title": "dailyNotes: Open Daily Note"
4364
},
65+
{
66+
"command": "dailyNotes.openNoteForDate",
67+
"title": "dailyNotes: Open Daily Note For Date"
68+
},
4469
{
4570
"command": "dailyNotes.addTitle",
4671
"title": "dailyNotes: Insert Title from Filename"
@@ -82,9 +107,15 @@
82107
"activationEvents": [
83108
"onStartupFinished",
84109
"onView:dailyNotes",
110+
"onView:calendarView",
85111
"onView:todoView",
86112
"onCommand:dailyNotes.refresh",
113+
"onCommand:dailyNotes.focusDailyNotes",
114+
"onCommand:dailyNotes.focusCalendar",
115+
"onCommand:dailyNotes.focusTodo",
116+
"onCommand:dailyNotes.calendarToday",
87117
"onCommand:dailyNotes.openNote",
118+
"onCommand:dailyNotes.openNoteForDate",
88119
"onCommand:dailyNotes.addTitle",
89120
"onCommand:dailyNotes.generateTodo",
90121
"onCommand:dailyNotes.generateSampleTodo"

src/__tests__/taskParser.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ describe('formatTaskLine', () => {
233233
});
234234

235235
it('includes date when requested', () => {
236-
expect(formatTaskLine(base, true)).toBe('- [ ] Do something — 2025-02-09');
236+
expect(formatTaskLine(base, true)).toBe('- [ ] Do something — [[2025-02-09]]');
237237
});
238238

239239
it('includes both priority and date', () => {
240-
expect(formatTaskLine({ ...base, priority: 'B' }, true)).toBe('- [ ] (B) Do something — 2025-02-09');
240+
expect(formatTaskLine({ ...base, priority: 'B' }, true)).toBe('- [ ] (B) Do something — [[2025-02-09]]');
241241
});
242242
});
243243

@@ -258,9 +258,9 @@ describe('formatTodoMd', () => {
258258
expect(md).toContain('## +Backend');
259259
expect(md).toContain('## +UI');
260260
expect(md).toContain('## Ungrouped');
261-
expect(md).toContain('- [ ] (A) Fix bug +Backend @work — 2025-02-09');
262-
expect(md).toContain('- [x] (B) Design review +UI — 2025-02-08');
263-
expect(md).toContain('- [ ] Buy milk — 2025-02-07');
261+
expect(md).toContain('- [ ] (A) Fix bug +Backend @work — [[2025-02-09]]');
262+
expect(md).toContain('- [x] (B) Design review +UI — [[2025-02-08]]');
263+
expect(md).toContain('- [ ] Buy milk — [[2025-02-07]]');
264264
});
265265

266266
it('puts Ungrouped last', () => {

0 commit comments

Comments
 (0)