Skip to content

fix: complete IssueStatus/IssueType types and improve formatTimeAgo#48

Open
kevglynn wants to merge 1 commit into
raychaser:mainfrom
kevglynn:fix/types-and-time-formatting
Open

fix: complete IssueStatus/IssueType types and improve formatTimeAgo#48
kevglynn wants to merge 1 commit into
raychaser:mainfrom
kevglynn:fix/types-and-time-formatting

Conversation

@kevglynn

Copy link
Copy Markdown

Summary

Two small quality fixes:

  1. Complete type definitionsIssueStatus was missing deferred, pinned, and hooked (three built-in beads statuses). IssueType was missing question and docs. The code works at runtime via fallback logic, but incomplete types can mask bugs in exhaustive checks.

  2. Improve formatTimeAgo granularity — Previously, anything older than 1 day showed raw day counts (30d ago). Now shows weeks (2w ago), months (1mo ago), and years (1y ago) for better readability.

Changes

File Change
src/core/types.ts Add deferred, pinned, hooked to IssueStatus; add question, docs to IssueType
src/core/utils.ts Add weeks (14d–34d), months (35d–364d), years (365d+) to formatTimeAgo

Time formatting examples

Age Before After
14 days 14d ago 2w ago
30 days 30d ago 1mo ago
90 days 90d ago 3mo ago
400 days 400d ago 1y ago

Test Plan

  • TypeScript compiles clean (tsc --noEmit)
  • Biome lint passes

Closes #47

Made with Cursor

IssueStatus was missing deferred, pinned, and hooked — three built-in
beads statuses. IssueType was missing question and docs. The code
worked at runtime via fallback logic, but the types were incomplete
and could mask bugs in exhaustive switch/case checks.

formatTimeAgo now shows weeks (2w–4w), months (1mo–11mo), and years
instead of raw day counts for older issues. "30d ago" → "1mo ago".

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: incomplete IssueStatus/IssueType type definitions and formatTimeAgo granularity

1 participant