diff --git a/.Jules/palette.md b/.Jules/palette.md
new file mode 100644
index 0000000..01da625
--- /dev/null
+++ b/.Jules/palette.md
@@ -0,0 +1,9 @@
+# Palette's Journal
+
+## 2024-05-22 - Missing Delete Confirmation
+**Learning:** Destructive actions like "Delete" should always have a confirmation step to prevent accidental data loss. This is a critical safety feature.
+**Action:** Add `onsubmit="return confirm('...')" ` to delete forms.
+
+## 2024-05-22 - Form Accessibility
+**Learning:** Relying on placeholders or default option text for form labels is bad for accessibility. Screen readers may not read them correctly, and placeholders disappear when typing.
+**Action:** Use `` elements or `aria-label` attributes for all form inputs.
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 54b667c..8f9d09d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -2,7 +2,7 @@ name: Task Prioritizer DockerHub Push
on:
push:
- branches: [main]
+ branches: [main,develop]
jobs:
build-and-publish:
diff --git a/README.md b/README.md
index a94180d..7204979 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,11 @@ Task priority uses a weighted formula that factors in criticality, effort, due d
- **Mandays weight**: 15
- **Urgency max**: 80
- **Overdue boost**: 100
+- **Due date boosts**:
+ - 1 month left: +5
+ - 1 week left: +10
+ - 3 days left: +20
+ - 1 day left: +30
Urgency uses a reciprocal formula where tasks become more urgent as the due date approaches, and overdue tasks receive a fixed boost:
@@ -32,7 +37,17 @@ Urgency uses a reciprocal formula where tasks become more urgent as the due date
if days_left < 0:
urgency = OVERDUE_BOOST
else:
- urgency = URGENCY_MAX / (1 + days_left)
+ time_boost = 0
+ if days_left <= 1:
+ time_boost = BOOST_1_DAY
+ elif days_left <= 3:
+ time_boost = BOOST_3_DAYS
+ elif days_left <= 7:
+ time_boost = BOOST_1_WEEK
+ elif days_left <= 30:
+ time_boost = BOOST_1_MONTH
+
+ urgency = URGENCY_MAX / (1 + days_left) + time_boost
score = (criticality * CRITICALITY_WEIGHT)
+ (EFFORT_WEIGHT / effort)
diff --git a/src/index.php b/src/index.php
index 5af07a2..e1d10ee 100644
--- a/src/index.php
+++ b/src/index.php
@@ -109,14 +109,29 @@ function calculateTaskScore($task) {
$CRITICALITY_WEIGHT = 50;
$EFFORT_WEIGHT = 20;
$MANDAYS_WEIGHT = 15;
- $URGENCY_MAX = 80; // Increased from 40
+ $URGENCY_MAX = 80; // Base urgency for due dates
$OVERDUE_BOOST = 100;
- // Urgency calculation (reciprocal for non-overdue, fixed boost for overdue)
+ // Additional boosts when approaching the due date
+ $BOOST_1_MONTH = 5; // <= 30 days
+ $BOOST_1_WEEK = 10; // <= 7 days
+ $BOOST_3_DAYS = 20; // <= 3 days
+ $BOOST_1_DAY = 30; // <= 1 day
+
+ // Urgency calculation with stepped boosts as the due date approaches
if ($daysLeft < 0) {
$urgencyScore = $OVERDUE_BOOST;
} else {
- $urgencyScore = $URGENCY_MAX / (1 + $daysLeft); // DaysLeft=0 gives 80, 1 gives 40, etc.
+ $urgencyScore = $URGENCY_MAX / (1 + $daysLeft);
+ if ($daysLeft <= 1) {
+ $urgencyScore += $BOOST_1_DAY;
+ } elseif ($daysLeft <= 3) {
+ $urgencyScore += $BOOST_3_DAYS;
+ } elseif ($daysLeft <= 7) {
+ $urgencyScore += $BOOST_1_WEEK;
+ } elseif ($daysLeft <= 30) {
+ $urgencyScore += $BOOST_1_MONTH;
+ }
}
$score = 0;
@@ -219,7 +234,7 @@ function calculateTaskScore($task) {
Time Left: = $daysLeftText ?>
Score: = calculateTaskScore($task) ?>
-