-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-empty-priorities.js
More file actions
60 lines (47 loc) · 2.05 KB
/
fix-empty-priorities.js
File metadata and controls
60 lines (47 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import sqlite3 from "sqlite3";
const db = new sqlite3.Database("./tasks.db", (err) => {
if (err) {
console.error("Database connection failed:", err);
process.exit(1);
}
console.log("Database connected");
});
console.log("\n🔍 Checking your imported tasks...\n");
db.all("SELECT id, name, importance, urgency, done FROM tasks LIMIT 10", (err, rows) => {
if (err) {
console.error("Error:", err);
process.exit(1);
}
console.log("Sample of your tasks:");
console.table(rows);
console.log("\n📊 Analysis:");
db.get("SELECT COUNT(*) as total, AVG(importance) as avg_imp, AVG(urgency) as avg_urg FROM tasks", (err, stats) => {
if (err) {
console.error("Error:", err);
process.exit(1);
}
console.log(`Total tasks: ${stats.total}`);
console.log(`Average importance: ${stats.avg_imp}`);
console.log(`Average urgency: ${stats.avg_urg}`);
if (stats.avg_imp === 5 && stats.avg_urg === 5) {
console.log("\n⚠️ WARNING: All tasks have default values (5, 5)");
console.log("This means your Google Sheets 'Important' and 'Urgency' columns are EMPTY!\n");
console.log("💡 SOLUTIONS:\n");
console.log("1️⃣ Fill in the 'Important' and 'Urgency' columns in your Google Sheet");
console.log(" - Open your Google Sheet");
console.log(" - Add values 0-10 in the 'Important' column");
console.log(" - Add values 0-10 in the 'Urgency' column");
console.log(" - Export as CSV again");
console.log(" - Re-import\n");
console.log("2️⃣ Edit tasks manually in the app");
console.log(" - Click the pencil icon on each task");
console.log(" - Adjust importance and urgency sliders\n");
console.log("3️⃣ Auto-assign random values (for testing)");
console.log(" - Run: npm run randomize-priorities\n");
} else {
console.log("\n✅ Your tasks have varied importance/urgency values!");
console.log("They should appear in different quadrants on the chart.\n");
}
db.close();
});
});