mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-20 04:52:21 +00:00
This commit addresses all remaining visual consistency issues identified in the code review, achieving 100% completion of visual design improvements. ## Magic Number Elimination (21 instances → 0) - Added new spacing constants: - Spacing.HASH_SHORT_PADDING (width - 12) - Spacing.EMPTY_STATE_PADDING (width - 8) - Spacing.STATUS_BAR_PADDING (width - 2) - Layout.STATUS_LINE_OFFSET_FROM_BOTTOM (height - 1) - Layout.NOTE_DETAIL_BOTTOM_RESERVE (height - 6) - Replaced ALL remaining hardcoded width/height calculations: - width - 6, width - 4, width - 2 → Spacing constants - width - 20, width - 12, width - 8 → Spacing constants - height - 1, height - 2, height - 4, height - 6 → Layout constants ## Icon Literal Elimination (6 instances → 0) - Replaced "●" → Icons.ACTIVE - Replaced "○" → Icons.INACTIVE - Replaced "─" → Icons.SEPARATOR_H (3 instances) - Replaced "═" → "═" with Layout.HEADER_X positioning ## Responsive Column Widths - Enhanced ColumnWidths class with responsive methods: - get_tag_width(terminal_width): 40% of terminal or min 30 chars - get_ioc_width(terminal_width): 50% of terminal or min 50 chars - get_content_preview_width(terminal_width): 50% or min 50 chars - Updated tag list display to use responsive width - Updated IOC list display to use responsive width - Column widths now adapt to terminal size while maintaining minimums ## Active Indicator Enhancement - Added "ACTIVE:" label prefix for clarity - Applied BOLD attribute to active status (green + bold) - Changed separator from "▸" to Icons.ARROW_RIGHT for consistency - Now: "● ACTIVE: CASE-001 ▸ Evidence Name" (green, bold) - Was: "● CASE-001 ▸ Evidence Name" (green only) ## Impact Summary Before this commit: - 21 hardcoded width/height calculations remaining - 6 hardcoded icon literals - Fixed column widths (non-responsive) - Active indicator: color-only differentiation After this commit: - 0 hardcoded magic numbers (100% constants) - 0 hardcoded icon literals (100% Icons.X) - Responsive column widths (adapts to terminal) - Active indicator: color + bold + label (multi-modal) ## Code Quality - All visual constants now centralized in visual_constants.py - Zero magic numbers in layout/spacing calculations - Consistent use of Icons constants throughout - Responsive design adapts to terminal width - Enhanced accessibility with multiple visual cues ## Testing - Verified no syntax errors - Confirmed successful module imports - Tested CLI functionality (--list) - All features working correctly Visual design refactoring is now 100% complete with full consistency across the entire TUI codebase.