Skip to content

[P3.4] De-duplicate web-ui status maps, cost formatter and workspace storage key #971

Description

@frankbria

Filed by the SaaS launch review. Priority P3.4 — severity low, category duplication.

Problem

STATUS_BADGE_VARIANT and STATUS_LABEL are duplicated verbatim across TaskCard, TaskDetailModal and TaskColumn, so adding or renaming a status requires editing three files no test links together and the board and detail modal will drift. Four independent USD formatters exist across the costs components plus raw toFixed(4) in two session components, so the Costs page, task cards and session cards can disagree on the same figure — a credibility problem for a billing surface. useNotifications hardcodes 'codeframe_workspace_path', duplicating the unexported STORAGE_KEY, so notification workspace-scoping breaks silently the moment that key changes. eventDetailIcons is exported with no importer and msw is a declared dev dependency no test imports.

Evidence

  • web-ui/src/components/tasks/TaskCard.tsx:45
  • web-ui/src/components/costs/TopTasksTable.tsx:15
  • web-ui/src/lib/eventStyles.ts:120
  • web-ui/src/hooks/useNotifications.ts:116
  • web-ui/package.json:57

Acceptance criteria

  • STATUS_BADGE_VARIANT and STATUS_LABEL live in one module imported by all three components
  • One exported currency formatter used by all cost/session/task displays; no remaining toFixed(4) on a USD value in src/components
  • workspace-storage.ts exports STORAGE_KEY and useNotifications imports it; no literal 'codeframe_workspace_path' elsewhere
  • eventDetailIcons deleted or consumed; msw removed or used
  • cd web-ui && npm test && npm run build passes

Atomic by construction: one developer, one focused session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-post-betaLow priority - can wait until after beta (v2.0)priority:lowrefactorIssues specifically associated with the refactor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions