commit ce84dd40802dc260aed9e6e75d5f379bdf6a6089
parent bf39ea2f4ca4dfb4001477925795359b6b44b916
Author: Hunter
Date: Tue, 30 Jul 2024 09:52:50 -0400
in breadcrumbs: filled dot as avatar
Diffstat:
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/todo.html b/todo.html
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Advanced Task Tracker</title>
+ <title>todo</title>
<style>
body {
font-family: Arial, sans-serif;
@@ -78,15 +78,20 @@
}
function generateBreadcrumbs(rootTask, currentPath, selectedTaskId) {
- let breadcrumbs = '● '; // Always start with the root
+ let breadcrumbs = '';
let currentTask = rootTask;
+ let currentDepth = 0;
- // Add filled circles for the current path
- for (let i = 1; i < currentPath.length; i++) {
- breadcrumbs += '● ';
- currentTask = currentTask.subtasks.find(t => t.id === currentPath[i].id);
+ // Add empty circles for levels before the current one
+ for (let i = 0; i < currentPath.length - 1; i++) {
+ breadcrumbs += '○ ';
+ currentTask = currentTask.subtasks.find(t => t.id === currentPath[i + 1].id);
}
+ // Add filled circle for the current level
+ breadcrumbs += '● ';
+ currentDepth = currentPath.length - 1;
+
// If the selected task is not the current view's parent task, add empty circles for potential deeper levels
if (selectedTaskId !== currentTask.id) {
let selectedTask = currentTask.subtasks.find(t => t.id === selectedTaskId);
@@ -97,10 +102,10 @@
return Math.max(...task.subtasks.map(st => calculateMaxDepth(st, depth + 1)));
}
- let maxDepth = calculateMaxDepth(selectedTask, currentPath.length);
+ let maxDepth = calculateMaxDepth(selectedTask, currentDepth + 1);
// Add empty circles for potential deeper levels
- for (let i = currentPath.length; i < maxDepth; i++) {
+ for (let i = currentDepth + 1; i < maxDepth; i++) {
breadcrumbs += '○ ';
}
}