Action

Type

Resolved On

Resolved On in Action Markdown Refacotring - - -

Resolved On in Action Markdown

Overview

The action markdown files currently use resolved as the frontmatter field name to store the date when an action was resolved. This naming is confusing and causes errors because:

  1. resolved sounds like a boolean - It implies a true/false status rather than a date
  2. Conflicts with database field - The Supabase database has a resolved field that is actually a boolean, creating naming confusion
  3. Semantic mismatch - The field stores a date string (e.g., “2026-02-07”), not a resolution status

Current State

Frontmatter Schema (config.ts)

const actionsCollection = defineCollection({
  type: "content",
  schema: z.object({
    action: z.string(),
    type: z.string(),
    project: z.string(),
    resolved: z.string().optional(),  // ❌ Confusing name
  }),
});

Example Action File

---
action: "Fix console.log variable bug"
type: "fixing"
project: "bearlabs"
resolved: "2026-02-07"  # ❌ Looks like a boolean but is a date
---

Usage in Code

<!-- Checks if resolved date exists (confusing) -->
{entry.data.resolved ? entry.data.resolved : "- - -"}

<!-- Styling based on resolved date presence -->
className={`${entry.data.resolved ? "text-green-200" : "text-amber-100"}`}

Proposed Solution

Rename resolved to resolved_on throughout the codebase for clarity:

1. Update Content Schema

const actionsCollection = defineCollection({
  type: "content",
  schema: z.object({
    action: z.string(),
    type: z.string(),
    project: z.string(),
    resolved_on: z.string().optional(),  // ✅ Clear: this is a date
  }),
});

2. Update All Action Markdown Files

Change frontmatter from:

resolved: "2026-02-07"

To:

resolved_on: "2026-02-07"

3. Update All Code References

Files that need updating:

  • src/content/config.ts - Schema definition
  • src/components/planner/benben/Action.astro - Usage in component
  • src/pages/benben/actions/index.astro - Usage in page
  • src/pages/benben/actions/[item].astro - Usage in dynamic route
  • src/pages/2025/*/benben/actions/*.astro - All versioned action pages
  • src/pages/2026/*/benben/actions/*.astro - All versioned action pages
  • src/pages/2025/*/hygge/portfolio/bearlabs/*.astro - Portfolio pages

Benefits

  • Clear semantics - resolved_on clearly indicates a date field
  • No confusion with database - Database resolved (boolean) vs frontmatter resolved_on (date)
  • Self-documenting - Field name describes its purpose
  • Consistent naming - Follows the pattern of other date fields (e.g., created_on, updated_on)

Implementation Checklist

  • Update src/content/config.ts schema
  • Update all action markdown files in src/content/actions/2025/
  • Update all action markdown files in src/content/actions/2026/
  • Update src/components/planner/benben/Action.astro
  • Update src/pages/benben/actions/index.astro
  • Update src/pages/benben/actions/[item].astro
  • Update all versioned action pages under src/pages/2025/
  • Update all versioned action pages under src/pages/2026/
  • Update portfolio pages under src/pages/2025/12/hygge/portfolio/bearlabs/
  • Test to ensure all action displays work correctly
  • src/content/config.ts
  • src/content/actions/**/*.md
  • src/components/planner/benben/Action.astro
  • src/pages/benben/actions/index.astro
  • src/pages/benben/actions/[item].astro
  • src/pages/2025/**/benben/actions/*.astro
  • src/pages/2026/**/benben/actions/*.astro
  • src/pages/2025/**/hygge/portfolio/bearlabs/*.astro