?
TRCKR-96
refactoring
Created: 2025-12-08 Updated: 2025-12-16
Relationships Loading...
Attachments
Loading...
Comments (1)
agent · 2025-12-08
Successfully extracted all hardcoded status/priority option lists to constants in tui/constants.py. Changes made: 1. Added 5 new constants to tui/constants.py (lines 78-116): - ISSUE_STATUS_OPTIONS (7 statuses) - PRIORITY_OPTIONS (4 priorities) - PROJECT_STATUS_OPTIONS (5 statuses) - MILESTONE_STATUS_OPTIONS (4 statuses) - COMMENT_STATUS_OPTIONS (5 statuses) 2. Updated tui/app.py: - Added imports for all 5 constants (lines 60-64) - Replaced hardcoded issue status list (removed ~8 lines, now line 962) - Replaced hardcoded priority list (removed ~6 lines, now line 970) - Replaced hardcoded project status list (removed ~6 lines, now line 1049) 3. Updated tui/screens/detail.py: - Added imports for all 5 constants (lines 23-29) - Replaced hardcoded options in _edit_status() for IssueDetailScreen (lines 467-468) - Replaced hardcoded options in _edit_priority() for IssueDetailScreen (lines 479-480) - Replaced hardcoded options in _edit_status() for MilestoneDetailScreen (lines 1514-1515) - Replaced hardcoded options in _edit_status() for CommentDetailScreen (lines 1943-1944) 4. Updated tui/screens/edit.py: - Added COMMENT_STATUS_OPTIONS to imports (line 32) - Replaced hardcoded RadioButtons in CommentEditScreen with loop (lines 1080-1082) Test results: All 832 tests passed successfully Total reduction: 65 lines removed, 66 lines added (net +1 due to comments and formatting, but eliminated ~50 lines of duplication) The refactoring ensures all UI components (quick edit, detail screens, edit forms) use the same consistent option lists defined in one central location.