Skip to content

Commit 34f46d5

Browse files
committed
Merge branch 'main' into release-v1.8.0
2 parents 96a95df + ecc30f2 commit 34f46d5

22 files changed

+1325
-457
lines changed

data.json

Lines changed: 97 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@
6262
"from": 0,
6363
"to": 0,
6464
"dateType": "scheduledDate"
65+
},
66+
"filters": {
67+
"rootCondition": "any",
68+
"filterGroups": [
69+
{
70+
"id": "id-1759769822732-we6pfeqpi",
71+
"groupCondition": "all",
72+
"filters": [
73+
{
74+
"id": "id-1759769822734-2yqs1dyh5",
75+
"property": "content",
76+
"condition": "contains",
77+
"value": "this"
78+
}
79+
]
80+
}
81+
]
6582
}
6683
},
6784
{
@@ -75,6 +92,22 @@
7592
"dateType": "scheduledDate",
7693
"from": -300,
7794
"to": -1
95+
},
96+
"sortCriteria": [
97+
{
98+
"criteria": "scheduledDate",
99+
"order": "asc",
100+
"priority": 1
101+
},
102+
{
103+
"criteria": "time",
104+
"order": "asc",
105+
"priority": 2
106+
}
107+
],
108+
"filters": {
109+
"rootCondition": "any",
110+
"filterGroups": []
78111
}
79112
},
80113
{
@@ -164,7 +197,35 @@
164197
"collapsed": false,
165198
"name": "Backlogs",
166199
"index": 1,
167-
"id": 226119
200+
"id": 226119,
201+
"sortCriterias": [
202+
{
203+
"criteria": "status",
204+
"order": "asc",
205+
"priority": 1
206+
},
207+
{
208+
"criteria": "scheduledDate",
209+
"order": "asc",
210+
"priority": 2
211+
},
212+
{
213+
"criteria": "priority",
214+
"order": "desc",
215+
"priority": 3
216+
}
217+
],
218+
"filters": {
219+
"rootCondition": "any",
220+
"filterGroups": []
221+
},
222+
"sortCriteria": [
223+
{
224+
"criteria": "id",
225+
"order": "asc",
226+
"priority": 1
227+
}
228+
]
168229
},
169230
{
170231
"colType": "namedTag",
@@ -173,7 +234,11 @@
173234
"name": "Can be implemented",
174235
"index": 2,
175236
"coltag": "#pending",
176-
"id": 47626
237+
"id": 47626,
238+
"filters": {
239+
"rootCondition": "any",
240+
"filterGroups": []
241+
}
177242
},
178243
{
179244
"colType": "namedTag",
@@ -235,24 +300,36 @@
235300
"hideEmptyColumns": false,
236301
"boardFilter": {
237302
"rootCondition": "any",
238-
"filterGroups": [
239-
{
240-
"id": "id-1760029960520-z2a1g0ka4",
241-
"groupCondition": "all",
242-
"filters": [
243-
{
244-
"id": "id-1760029960521-t33fwt542",
245-
"property": "filePath",
246-
"condition": "startsWith",
247-
"value": "Destinatio"
248-
}
249-
]
250-
}
251-
]
303+
"filterGroups": []
252304
},
253305
"filterConfig": {
254306
"enableSavedFilters": true,
255-
"savedConfigs": []
307+
"savedConfigs": [
308+
{
309+
"id": "filter-config-1760103432145-fevybeh8j",
310+
"name": "Destinatio",
311+
"description": "Filtering all tasks from \"Destinatio\" folder",
312+
"filterState": {
313+
"rootCondition": "any",
314+
"filterGroups": [
315+
{
316+
"id": "id-1760029960520-z2a1g0ka4",
317+
"groupCondition": "all",
318+
"filters": [
319+
{
320+
"id": "id-1760029960521-t33fwt542",
321+
"property": "filePath",
322+
"condition": "startsWith",
323+
"value": "Destinatio"
324+
}
325+
]
326+
}
327+
]
328+
},
329+
"createdAt": "2025-10-10T13:37:12.145Z",
330+
"updatedAt": "2025-10-10T13:37:12.145Z"
331+
}
332+
]
256333
}
257334
}
258335
],
@@ -266,7 +343,7 @@
266343
]
267344
},
268345
"folders": {
269-
"polarity": 1,
346+
"polarity": 3,
270347
"values": [
271348
"Task Board/1.7.0"
272349
]
@@ -707,13 +784,13 @@
707784
"taskPropertyFormat": "2",
708785
"taskNoteDefaultLocation": "TaskNotes",
709786
"autoAddUniqueID": true,
710-
"uniqueIdCounter": 235,
787+
"uniqueIdCounter": 238,
711788
"experimentalFeatures": true,
712789
"searchQuery": "",
713790
"lastViewedType": "map",
714791
"lastViewHistory": {
715792
"viewedType": "kanban",
716-
"boardIndex": 2,
793+
"boardIndex": 1,
717794
"taskId": ""
718795
},
719796
"taskNoteIdentifierTag": "taskNote",

main.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ import {
4747
getTaskPropertyRegexPatterns,
4848
taskPropertyHidingExtension,
4949
} from "src/editor-extensions/task-operations/property-hiding";
50-
import {
51-
allowedFileExtensionsRegEx,
52-
notAllowedFileExtensionsRegEx,
53-
} from "src/regularExpressions/MiscelleneousRegExpr";
5450
import { fetchTasksPluginCustomStatuses } from "src/services/tasks-plugin/helpers";
5551

5652
export default class TaskBoard extends Plugin {

src/components/AddOrEditTaskRC.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -239,35 +239,43 @@ export const AddOrEditTaskRC: React.FC<{
239239
}
240240

241241
// Automatically update end time if only start time is provided
242-
useEffect(() => {
242+
const handleCompleteTimeChange = (updatedStartTime: string, updatedEndTime: string) => {
243243
let newTime = '';
244-
if (startTime && !endTime) {
245-
const [hours, minutes] = startTime.split(':');
244+
if (updatedStartTime && !updatedEndTime) {
245+
const [hours, minutes] = updatedStartTime.split(':');
246246
const newEndTime = `${String(Number(hours) + 1).padStart(2, '0')}:${minutes}`;
247247
setEndTime(newEndTime);
248-
newTime = `${startTime} - ${newEndTime}`;
248+
newTime = `${updatedStartTime} - ${newEndTime}`;
249249
setNewTime(newTime);
250-
} else if (startTime && endTime) {
251-
newTime = `${startTime} - ${endTime}`;
250+
} else if (updatedStartTime && updatedEndTime) {
251+
newTime = `${updatedStartTime} - ${updatedEndTime}`;
252252
setNewTime(newTime);
253253
}
254254

255255
if (!isTaskNote) {
256256
const newTitle = sanitizeTime(plugin.settings.data.globalSettings, title, newTime, cursorLocationRef.current ?? undefined);
257257
setTitle(newTitle);
258258
}
259-
}, [startTime, endTime]);
259+
setIsEditorContentChanged(true);
260+
}
260261

261-
const handleStartTimeChange = (startTime: string) => {
262-
setStartTime(startTime);
262+
263+
const handleStartTimeChange = (updatedStartTime: string) => {
264+
setStartTime(updatedStartTime);
263265
setIsEdited(true);
264-
setIsEditorContentChanged(true);
266+
267+
handleCompleteTimeChange(updatedStartTime, "");
268+
269+
// setIsEditorContentChanged(true);
265270
}
266271

267-
const handleEndTimeChange = (endTime: string) => {
268-
setEndTime(endTime);
272+
const handleEndTimeChange = (updatedEndTime: string) => {
273+
setEndTime(updatedEndTime);
269274
setIsEdited(true);
270-
setIsEditorContentChanged(true);
275+
276+
handleCompleteTimeChange(startTime, updatedEndTime);
277+
278+
// setIsEditorContentChanged(true);
271279
}
272280

273281
// // Function to toggle subtask completion

src/components/BoardFilters/ViewTaskFilter.ts

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export class TaskFilterComponent extends Component {
6464
app: App,
6565
private leafId?: string | undefined,
6666
plugin?: TaskBoard,
67-
activeBoardIndex?: number
67+
activeBoardIndex?: number,
68+
private initialFilterState?: RootFilterState
6869
) {
6970
super();
7071
this.hostEl = hostEl;
@@ -74,32 +75,38 @@ export class TaskFilterComponent extends Component {
7475
}
7576

7677
onload() {
77-
const savedState = this.leafId
78-
? this.app.loadLocalStorage(
79-
`task-board-view-filter-${this.leafId}`
80-
)
81-
: this.app.loadLocalStorage("task-board-view-filter");
82-
83-
console.log("savedState", savedState, this.leafId);
84-
if (
85-
savedState &&
86-
typeof (savedState as any).rootCondition === "string" &&
87-
Array.isArray((savedState as any).filterGroups)
88-
) {
89-
// Basic validation passed
90-
this.rootFilterState = savedState as RootFilterState;
78+
// If initial filter state is provided (for column filters), use it
79+
if (this.initialFilterState) {
80+
this.rootFilterState = this.initialFilterState;
9181
} else {
92-
if (savedState) {
93-
// If it exists but failed validation
94-
console.warn(
95-
"Task Filter: Invalid data in local storage. Resetting to default state."
96-
);
82+
// Otherwise, load from localStorage (for board filters)
83+
const savedState = this.leafId
84+
? this.app.loadLocalStorage(
85+
`task-board-view-filter-${this.leafId}`
86+
)
87+
: this.app.loadLocalStorage("task-board-view-filter");
88+
89+
console.log("savedState", savedState, this.leafId);
90+
if (
91+
savedState &&
92+
typeof (savedState as any).rootCondition === "string" &&
93+
Array.isArray((savedState as any).filterGroups)
94+
) {
95+
// Basic validation passed
96+
this.rootFilterState = savedState as RootFilterState;
97+
} else {
98+
if (savedState) {
99+
// If it exists but failed validation
100+
console.warn(
101+
"Task Filter: Invalid data in local storage. Resetting to default state."
102+
);
103+
}
104+
// Initialize with default state
105+
this.rootFilterState = {
106+
rootCondition: "any",
107+
filterGroups: [],
108+
};
97109
}
98-
// Initialize with default state
99-
this.rootFilterState = {
100-
rootCondition: "any",
101-
filterGroups: [],
102-
};
103110
}
104111

105112
// Render first to initialize DOM elements
@@ -729,15 +736,17 @@ export class TaskFilterComponent extends Component {
729736
if (propertySelect.selectEl.options.length === 0) {
730737
propertySelect.addOptions({
731738
content: t("content"),
739+
id: t("id"),
732740
status: t("status"),
733741
priority: t("priority"),
734-
dueDate: t("due-date"),
742+
tags: t("tags"),
743+
createdDate: t("created-date"),
735744
startDate: t("start-date"),
736745
scheduledDate: t("scheduled-date"),
737-
tags: t("tags"),
746+
dueDate: t("due-date"),
747+
completed: t("completed-date"),
738748
filePath: t("file-path"),
739749
// project: t("project"),
740-
completed: t("completed"),
741750
});
742751
}
743752
propertySelect.setValue(property);
@@ -802,6 +811,8 @@ export class TaskFilterComponent extends Component {
802811
},
803812
];
804813
break;
814+
case "id":
815+
case "createdDate":
805816
case "dueDate":
806817
case "startDate":
807818
case "scheduledDate":

src/components/BoardFilters/ViewTaskFilterModal.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class ViewTaskFilterModal extends Modal {
3333
onClose() {
3434
const { contentEl } = this;
3535

36-
// 获取过滤状态并触发回调
3736
let filterState: RootFilterState | undefined = undefined;
3837
if (this.taskFilterComponent) {
3938
try {
@@ -49,7 +48,6 @@ export class ViewTaskFilterModal extends Modal {
4948

5049
contentEl.empty();
5150

52-
// 调用自定义关闭回调
5351
if (this.filterCloseCallback) {
5452
try {
5553
this.filterCloseCallback(filterState);

0 commit comments

Comments
 (0)