Skip to content

Conversation

@timothyfroehlich
Copy link
Owner

feat: Implement comprehensive issue status redesign system

Summary

Implements a comprehensive 4-field metadata system for issues, replacing the single "status" field with Status, Severity, Priority, and Consistency fields. This overhaul provides richer context for issue tracking and improves the user experience with vibrant, accessible badge components.

Key improvements:

  • 11 distinct statuses organized into 3 groups (New, In Progress, Closed)
  • Player-centric severity taxonomy (Cosmetic, Minor, Major, Unplayable)
  • Badge grid component with full ARIA accessibility
  • Consolidated database migrations for cleaner V2 launch
  • Comprehensive test coverage (unit, integration, E2E)

Breaking Changes

Important

This PR requires a database reset for preview/staging environments. The migration consolidates 7 previous migrations into a single clean init schema.

Migration strategy:

  • Local dev: Already handled by consolidated 0000_init-schema.sql
  • Preview/Staging: Run pnpm run db:reset or equivalent
  • Production: Will require careful migration (future work)

Changes by Category

1. Database Schema

New fields added to issues table:

  • status - Enum with 11 values (default: "new")
  • severity - Enum with 4 values (default: "minor")
  • priority - Enum with 3 values (default: "medium")
  • consistency - Enum with 3 values (default: "intermittent")

Migration consolidation:

  • Consolidated migrations 0001 through 0006 into 0000_init-schema.sql
  • Removed 6 migration files and their metadata
  • Updated test schema export for PGlite compatibility

Files changed:

  • src/server/db/schema.ts
  • drizzle/0000_init-schema.sql
  • drizzle/meta/*
  • src/test/setup/schema.sql

2. Type System

New types added:

  • IssueStatus - 11 status values
  • IssueStatusGroup - 3 groups (new, in_progress, closed)
  • IssueSeverity - 4 severity levels
  • IssuePriority - 3 priority levels
  • IssueConsistency - 3 consistency levels

Files changed:

  • src/lib/types/database.ts
  • src/lib/types/index.ts

3. Components

New component:

  • IssueBadgeGrid.tsx - Grid-based badge display with 3 variants (mini, half, normal)

Updated components:

  • IssueRow.tsx - Uses badge grid instead of status indicator
  • RecentIssuesPanel.tsx - Mini variant badges
  • IssueSidebar.tsx - Full 1x4 badge strip
  • SidebarActions.tsx - Update forms for all 4 fields
  • IssueFilters.tsx - Filter by all metadata fields

Deleted components:

  • StatusIndicator.tsx - Replaced by badge grid
  • PreBetaBanner.tsx - Removed (was already commented out)

Files changed:

  • src/components/issues/*
  • src/app/(app)/dashboard/page.tsx
  • src/app/(app)/issues/page.tsx
  • src/app/(app)/m/[initials]/page.tsx
  • src/app/(app)/m/[initials]/i/[issueNumber]/page.tsx

4. Forms & Actions

Public report form:

  • Added Severity dropdown (required)
  • Added Consistency dropdown (required)
  • Priority visible only to authenticated members/admins

Update forms (issue detail page):

  • update-issue-status-form.tsx - Grouped <optgroup> for status
  • update-issue-severity-form.tsx - Severity dropdown
  • update-issue-priority-form.tsx - Priority dropdown (members only)
  • update-issue-consistency-form.tsx - NEW Consistency dropdown

ARIA accessibility:

  • All form controls have aria-label attributes
  • Consistent labeling for reliable E2E test selectors

Files changed:

  • src/app/report/unified-report-form.tsx
  • src/app/report/actions.ts
  • src/app/report/schemas.ts
  • src/app/report/validation.ts
  • src/app/(app)/issues/actions.ts
  • src/app/(app)/issues/schemas.ts
  • src/app/(app)/m/[initials]/i/[issueNumber]/update-issue-*-form.tsx

5. Business Logic

Status utilities:

  • getIssueStatusGroup() - Determine status group (new/in_progress/closed)
  • getIssueStatusIcon() - Icon component for status
  • getIssueStatusLabel() - Display label for status
  • Status badge styles with individual border colors

Machine status derivation:

  • Updated getMachineStatus() to use new severity levels
  • Machines with "unplayable" issues marked as "Unplayable"

Files changed:

  • src/lib/issues/status.ts
  • src/lib/machines/status.ts
  • src/lib/timeline/events.ts

6. Styling

New CSS variables:

  • Status colors (cyan/teal for New, purple/fuchsia for In Progress, green/gray for Closed)
  • Severity colors (amber scale)
  • Priority colors (purple scale)
  • Consistency colors (cyan scale)

Badge styling:

  • Individual border colors per status
  • Consistent border colors per field type (severity, priority, consistency)
  • Icon + label layout with proper spacing

Files changed:

  • src/app/globals.css
  • src/app/layout.tsx (removed PreBetaBanner)

7. Test Coverage

Unit tests:

  • status.test.ts - Status utility functions
  • status.ts (machines) - Machine status derivation
  • issue-schemas.test.ts - Schema validation
  • public-issue-schema.test.ts - Public form validation
  • factories.ts - Test data factories

Integration tests:

  • dashboard.test.ts - Dashboard data fetching
  • machines.test.ts - Machine status logic
  • issues.test.ts - Issue CRUD operations
  • issue-services.test.ts - NEW - Service layer tests

E2E tests:

  • issues-crud.spec.ts - Updated for new fields
  • navigation.spec.ts - Updated assertions
  • public-reporting.spec.ts - Updated for severity/consistency
  • email-notifications.spec.ts - Updated ARIA labels
  • notifications.spec.ts - Updated ARIA labels
  • status-overhaul.spec.ts - NEW - Comprehensive status workflow test

Files changed:

  • src/test/**/*.test.ts
  • e2e/smoke/*.spec.ts
  • e2e/full/*.spec.ts

8. Seed Data

Enhanced seed data:

  • Updated seed-users.mjs to use new status/severity values
  • Added timeline events (comments) for test machines
  • Realistic status progression examples

Files changed:

  • supabase/seed-users.mjs

9. Documentation

Implementation guide:

  • _issue-status-redesign/README.md - Comprehensive specification
  • Visual mockups (PNG images)
  • Field specifications and design system
  • Migration guide and verification checklist

Files changed:

  • _issue-status-redesign/README.md
  • _issue-status-redesign/*.png (mockups)

Files removed:

  • _issue-status-redesign/mockups/** (TypeScript mockup files - no longer needed)

Testing

Test results:

  • ✅ All unit tests passing
  • ✅ All integration tests passing
  • ✅ Smoke tests passing (Chromium + Mobile Chrome)
  • ✅ 37/40 full E2E tests passing (92.5% pass rate)

Remaining E2E failures (3):

  • 2 Mobile Chrome timing issues (email notification race conditions)
  • 1 Test pollution issue (dashboard card link - passes in isolation)

Verification:

pnpm run preflight  # Passes all checks
pnpm run smoke      # Chromium + Mobile Chrome pass

Migration Guide

For preview/staging environments:

  1. Reset database:

    pnpm run db:reset
  2. Verify migration:

    pnpm run typecheck
    pnpm run test
    pnpm run test:integration
  3. Start dev server:

    pnpm run dev

For production (future work):

  • Will require data migration script to map old statuses to new system
  • Severity/Priority/Consistency can default to "minor"/"medium"/"intermittent"

Screenshots

See _issue-status-redesign/README.md for visual mockups


Related Issues

Closes #[ISSUE_NUMBER]


Checklist

  • Database schema updated with new fields
  • Type definitions added/updated
  • Components updated to use badge grid
  • Forms updated with new fields
  • E2E tests updated for ARIA labels
  • E2E tests updated for new severity values
  • Seed data updated
  • All existing tests passing
  • pnpm run preflight passes
  • Migration consolidation complete
  • Documentation updated

- Created _issue-status-redesign/ directory with complete implementation guide
- Finalized 11 status values (down from 14): removed Unconfirmed, Diagnosing, Diagnosed, Parts Ordered
- Added 'Waiting on Owner' status to In Progress group
- Included visual mockups, code examples, and verification checklist
- Clarified field permissions and public report form behavior
- Noted future color distinction improvements needed for non-status fields
- Preserved all mockup code for implementation reference
Implements a 4-field metadata system for issues:
- Status: 11 values in 3 groups (New, In Progress, Closed)
- Severity: Cosmetic, Minor, Major, Unplayable (player-centric)
- Priority: Low, Medium, High (member/admin only)
- Consistency: Intermittent, Frequent, Constant

BREAKING CHANGE: Database schema changes require reset for preview/staging.
Consolidates migrations 0001-0006 into 0000_init-schema for clean V2 launch.

Key changes:
- New IssueBadgeGrid component with 3 variants (mini/half/normal)
- Updated all forms with ARIA labels for accessibility
- Enhanced public report form with severity/consistency fields
- Comprehensive test coverage (37/40 E2E tests passing)
- Removed PreBetaBanner and StatusIndicator components
- Updated seed data with realistic status progression examples

Test results: All unit/integration tests pass, smoke tests pass,
92.5% E2E pass rate (3 Mobile Chrome timing issues remaining).
Copilot AI review requested due to automatic review settings January 8, 2026 16:47
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pin-point Ready Ready Preview, Comment Jan 9, 2026 5:03am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a comprehensive 4-field metadata system for issues, replacing the single "status" field with Status (11 values), Severity (4 values), Priority (3 values), and Consistency (3 values). The changes include database schema updates, consolidated migrations, new type definitions, updated UI components with accessibility improvements, comprehensive test coverage, and E2E test updates.

Key changes:

  • Consolidated 7 migrations into a single init schema for cleaner V2 launch
  • Replaced old severity taxonomy (minor/playable/unplayable) with player-centric taxonomy (cosmetic/minor/major/unplayable)
  • Added new Consistency field to track issue frequency
  • Created new IssueBadgeGrid component with full ARIA accessibility
  • Updated all forms, actions, services, and queries to support new fields
  • Comprehensive test coverage with new integration tests and E2E workflows

Reviewed changes

Copilot reviewed 71 out of 77 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/server/db/schema.ts Added consistency field, updated severity/priority defaults, renamed resolvedAt→closedAt
src/lib/types/database.ts Added IssueConsistency type, updated Issue type with proper enum types
src/lib/issues/status.ts Complete rewrite with 11 statuses, new label/icon/style functions
src/services/issues.ts Added updateIssueConsistency, updated timeline labels to use human-readable names
src/components/issues/IssueBadgeGrid.tsx New component with 4 variants (mini/half/normal/strip) and ARIA support
src/app/report/unified-report-form.tsx Added consistency field with aria-labels, updated severity options
supabase/seed-users.mjs Updated seed data with new status/severity/consistency values
drizzle/meta/_journal.json Consolidated migrations from 7 to 1 entry
e2e/smoke/status-overhaul.spec.ts New E2E test verifying 4-badge system and status updates
Test files (20+) Updated all tests for new field values and renamed fields

});

test.afterEach(async ({ request }) => {
if (createdIssueId) {
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use of variable 'createdIssueId' always evaluates to false.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 75 out of 81 changed files in this pull request and generated no new comments.

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.

2 participants