Skip to content

Commit 98b9171

Browse files
authored
Merge pull request #678 from callumalpass:issue459
Improve mini calendar interactions and settings organization
2 parents f355e07 + 2d17f6b commit 98b9171

File tree

7 files changed

+509
-105
lines changed

7 files changed

+509
-105
lines changed

docs/settings/appearance.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ These settings control the visual appearance of the plugin, including the calend
4040
- **Show recurring tasks**: Display recurring task instances by default.
4141
- **Show ICS events**: Display events from ICS subscriptions by default.
4242

43-
## Timeblocking
44-
45-
- **Enable timeblocking**: Enable timeblock functionality for lightweight scheduling in daily notes.
46-
- **Show timeblocks**: Display timeblocks from daily notes by default.
4743

4844
## Time Settings
4945

docs/settings/calendar-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can control which types of events are shown by default in the calendar views
2020

2121
## Timeblocking Features
2222

23-
You can enable or disable the **Timeblocking** feature, which allows you to create and manage timeblocks in the calendar views.
23+
You can enable or disable the **Timeblocking** feature in the Features tab, which allows you to create and manage timeblocks in the calendar views. Usage: hold Shift + drag in the advanced calendar view to create timeblocks.
2424

2525
## External Calendar Integration
2626

docs/settings/features.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,13 @@ These settings allow you to enable, disable, and configure the various features
4848

4949
## Recurring Tasks
5050

51-
- **Maintain due date offset in recurring tasks**: When completing recurring tasks, maintain the offset between due and scheduled dates.
51+
- **Maintain due date offset in recurring tasks**: When completing recurring tasks, maintain the offset between due and scheduled dates.
52+
53+
## Timeblocking
54+
55+
- **Enable timeblocking**: Enable timeblock functionality for lightweight scheduling in daily notes.
56+
- **Show timeblocks**: Display timeblocks from daily notes by default.
57+
58+
### Usage
59+
60+
In the advanced calendar view, hold Shift + drag to create timeblocks. Drag to move existing timeblocks. Resize edges to adjust duration.

src/settings/tabs/appearanceTab.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -369,33 +369,6 @@ export function renderAppearanceTab(container: HTMLElement, plugin: TaskNotesPlu
369369
}
370370
});
371371

372-
// Timeblocking section
373-
createSectionHeader(container, 'Timeblocking');
374-
createHelpText(container, 'Configure timeblock functionality for lightweight scheduling in daily notes.');
375-
376-
createToggleSetting(container, {
377-
name: 'Enable timeblocking',
378-
desc: 'Enable timeblock functionality for lightweight scheduling in daily notes',
379-
getValue: () => plugin.settings.calendarViewSettings.enableTimeblocking,
380-
setValue: async (value: boolean) => {
381-
plugin.settings.calendarViewSettings.enableTimeblocking = value;
382-
save();
383-
// Re-render to show/hide timeblocks visibility setting
384-
renderAppearanceTab(container, plugin, save);
385-
}
386-
});
387-
388-
if (plugin.settings.calendarViewSettings.enableTimeblocking) {
389-
createToggleSetting(container, {
390-
name: 'Show timeblocks',
391-
desc: 'Display timeblocks from daily notes by default',
392-
getValue: () => plugin.settings.calendarViewSettings.defaultShowTimeblocks,
393-
setValue: async (value: boolean) => {
394-
plugin.settings.calendarViewSettings.defaultShowTimeblocks = value;
395-
save();
396-
}
397-
});
398-
}
399372

400373
// Time Settings
401374
createSectionHeader(container, 'Time Settings');

src/settings/tabs/featuresTab.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,34 @@ export function renderFeaturesTab(container: HTMLElement, plugin: TaskNotesPlugi
367367
save();
368368
}
369369
});
370+
371+
// Timeblocking Section
372+
createSectionHeader(container, 'Timeblocking');
373+
createHelpText(container, 'Configure timeblock functionality for lightweight scheduling in daily notes.');
374+
375+
createToggleSetting(container, {
376+
name: 'Enable timeblocking',
377+
desc: 'Enable timeblock functionality for lightweight scheduling in daily notes',
378+
getValue: () => plugin.settings.calendarViewSettings.enableTimeblocking,
379+
setValue: async (value: boolean) => {
380+
plugin.settings.calendarViewSettings.enableTimeblocking = value;
381+
save();
382+
// Re-render to show/hide timeblocks visibility setting
383+
renderFeaturesTab(container, plugin, save);
384+
}
385+
});
386+
387+
if (plugin.settings.calendarViewSettings.enableTimeblocking) {
388+
createToggleSetting(container, {
389+
name: 'Show timeblocks',
390+
desc: 'Display timeblocks from daily notes by default',
391+
getValue: () => plugin.settings.calendarViewSettings.defaultShowTimeblocks,
392+
setValue: async (value: boolean) => {
393+
plugin.settings.calendarViewSettings.defaultShowTimeblocks = value;
394+
save();
395+
}
396+
});
397+
398+
createHelpText(container, 'Usage: In the advanced calendar view, hold Shift + drag to create timeblocks. Drag to move existing timeblocks. Resize edges to adjust duration.');
399+
}
370400
}

0 commit comments

Comments
 (0)