Action

Type

Resolved On

Correct Levels Fixing 2026-01-14

Description

Items in the project status view were being displayed in incorrect columns. For example, “Watching.im” configured as level 2 (Coding) in the database was appearing under the Learning column instead of the Coding column.

The issue occurred because:

  1. The backlog function returned items ordered by level but didn’t include level information
  2. Items were displayed sequentially across columns (Learning, Prototyping, Coding, Testing) based on their array position rather than their actual level value
  3. Styles were applied using the loop index instead of the item’s level property

Solution

src/lib/monthly.ts:

  • Added works[i].level = result.data[i].level to include level information in returned data
  • Changed style assignment to use result.data[i].level as the index instead of loop variable i
  • Ensures styles are correctly mapped to the item’s actual level (0-3)

src/components/planner/benben/Project.astro:

  • Renamed incoming data prop to rawData to distinguish from organized data
  • Created organizedData array initialized with 4 empty slots (one per level)
  • Added loop to place each item from rawData into correct position based on its level property
  • Fixed TypeScript type annotation in average function from data:[any] to data:any[]

Now items are correctly placed in columns according to their database level:

  • Level 0 → Learning column
  • Level 1 → Prototyping column
  • Level 2 → Coding column
  • Level 3 → Testing column

Additional Fix: Detailed Kanban View Story Assignment

A related issue was found in the detailed kanban view (/benben/projects/benben/[category]) where story names were appearing in incorrect categories even though tasks were correctly filtered.

The Problem: In the focus() function within src/lib/monthly.ts, backlog stories were being returned in an array ordered by level, but then assigned to categories by array position rather than by their actual level value. This caused a mismatch between:

  • The story name displayed in each category (based on array position)
  • The tasks shown under that story (correctly filtered by level)

For example, if the database had:

  • “watching.im” with level=2
  • “learning-task” with level=0

The focus() function would return ["learning-task", "watching.im"] (ordered by level), and “learning-task” would incorrectly appear as the story name in the Learning tab (stories[0]) instead of in its correct category.

The Solution: Modified the focus() function in src/lib/monthly.ts:218-245 to:

  1. Initialize a stories array with exactly 4 slots: ["", "", "", ""]
  2. Place each story at its correct level index: stories[level] = result.data[i].story
  3. Ensures story names match their actual level (0-3) instead of array position
// Before (buggy):
let stories: string[] = [];
for (let i = 0; i < result.data.length; i++) {
  stories.push(result.data[i].story);
}

// After (fixed):
let stories: string[] = ["", "", "", ""];
for (let i = 0; i < result.data.length; i++) {
  const level = result.data[i].level;
  if (level >= 0 && level <= 3) {
    stories[level] = result.data[i].story;
  }
}

This ensures that in the detailed kanban view, story names are correctly displayed in their corresponding category tabs.