Skip to content

Fix reversed priority colors in project views - #46

Merged
hackertron merged 1 commit into
10xapp:mainfrom
mwzhu:fix/priority-color-mismatch
Apr 8, 2026
Merged

Fix reversed priority colors in project views#46
hackertron merged 1 commit into
10xapp:mainfrom
mwzhu:fix/priority-color-mismatch

Conversation

@mwzhu

@mwzhu mwzhu commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Fixes #42

This fixes the priority flag color mapping in the Projects UI so it matches the actual priority convention used in the codebase:

  • P1 = Urgent = rose/red
  • P2 = High = orange
  • P3 = Medium = amber
  • P4 = Low = slate/gray

The bug was caused by duplicated priority color mappings in multiple components that had the scale reversed. I moved the priority display metadata into a shared priorityOptions source and updated:

  • KanbanCard
  • CardDetailModal
  • ProjectsFilterBar
  • PriorityPicker

to use the same canonical mapping.

Why

PriorityPicker already had the correct mapping, but the other project views were showing the opposite severity colors. This made urgent items look low priority and low-priority items look urgent.

Verification

  • Ran targeted ESLint on the touched files
  • Ran npx tsc -b

Summary by CodeRabbit

Release Notes

  • Refactor
    • Unified priority configuration across project components to improve code consistency and maintainability. No changes to existing functionality or user experience.

@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d08d2e82-faf9-44b5-a689-68701e0837de

📥 Commits

Reviewing files that changed from the base of the PR and between 6c5ed7c and d3c0f0d.

📒 Files selected for processing (5)
  • core-web/src/components/Projects/components/CardDetailModal.tsx
  • core-web/src/components/Projects/components/KanbanCard.tsx
  • core-web/src/components/Projects/components/PriorityPicker.tsx
  • core-web/src/components/Projects/components/ProjectsFilterBar.tsx
  • core-web/src/components/Projects/components/priorityOptions.ts

📝 Walkthrough

Walkthrough

A new centralized priorityOptions.ts module is introduced, exporting priority type definitions and a PROJECT_PRIORITY_OPTIONS constant. Four existing components (CardDetailModal, KanbanCard, PriorityPicker, ProjectsFilterBar) now import this constant instead of maintaining local priority configuration, eliminating duplication.

Changes

Cohort / File(s) Summary
Priority Options Module
core-web/src/components/Projects/components/priorityOptions.ts
New file exporting ProjectPriorityValue type (0–4), ProjectPriorityOption interface, and PROJECT_PRIORITY_OPTIONS constant with five priority levels including labels, short labels, and color/background styling.
Priority Configuration Consolidation
core-web/src/components/Projects/components/CardDetailModal.tsx, core-web/src/components/Projects/components/KanbanCard.tsx, core-web/src/components/Projects/components/PriorityPicker.tsx
Removed locally-defined priority constants and now import PROJECT_PRIORITY_OPTIONS to source priority option data, labels, and styling.
Filter Bar Refactoring
core-web/src/components/Projects/components/ProjectsFilterBar.tsx
Replaced local PRIORITY_CONFIG with imported PROJECT_PRIORITY_OPTIONS. Introduced local variables boardStates and boardLabels to refine memoization dependency tracking in columns and labelOptions computations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~13 minutes

Poem

🐰 Priorities once scattered and spread,
Now neatly bundled, one source instead,
Colors and labels in harmony sing,
A refactor so clean—let the whole project ring!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing reversed priority colors by consolidating priority options into a shared source and updating components to use it.
Linked Issues check ✅ Passed The PR successfully addresses issue #42 by creating a centralized priority options module with correct color mappings (1=urgent=rose, 2=high=orange, 3=medium=amber, 4=low=slate) and updating all affected components to use it.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing priority color mismatches. The new priorityOptions module, updates to CardDetailModal, KanbanCard, PriorityPicker, and ProjectsFilterBar are all scoped to consolidating and correcting priority display logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

sonarqubecloud Bot commented Apr 7, 2026

Copy link
Copy Markdown

@hackertron
hackertron merged commit 8459aed into 10xapp:main Apr 8, 2026
2 checks passed
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.

Project issue priority UI and code mismatch?

2 participants