Skip to content

PR #7: Final Polish - StatusIndicator & Settings View Extraction#75

Merged
eyelock merged 1 commit into
mainfrom
feat/pr7-final-polish-documentation
Jan 19, 2026
Merged

PR #7: Final Polish - StatusIndicator & Settings View Extraction#75
eyelock merged 1 commit into
mainfrom
feat/pr7-final-polish-documentation

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Jan 19, 2026

Overview

Final polish PR completing deferred work from PR #6 and fixing SwiftLint violations in SettingsView.swift.

Changes

1. StatusIndicator Applied to Global Settings ✅

2. Settings View Extraction ✅

Fixed critical SwiftLint violations in SettingsView.swift:

Before:

  • File length: 528 lines (limit 500) ❌
  • Type body length: 398 lines (limit 300) ❌

After:

  • File length: 335 lines ✅
  • Type body length: Under limit ✅

Extracted Views:

  • SettingsGeneralView.swift - Terminal, Bin, Updates, Language, Uninstall, About sections
  • SettingsDataSecurityView.swift - Security, Data Storage, Data Protection sections

Technical Implementation:

  • Used Binding wrapper for defaultBackend (String ↔ TerminalBackend conversion)
  • Maintained exact same functionality, no behavior changes
  • All sections preserved with identical UI/UX

3. Component Documentation ✅

Added "Reusable UI Components" section to .claude/commands/code-style.md:

Documented Components:

  • PathInputField - Path inputs with validation and file picker
  • SharedToggle - Two-tier permission system toggles
  • StatusIndicator - Feature/service status display with visual indicators
  • LargeTextInput - Multi-line input with fixed height (prevents layout jumping)
  • KeyValueEditor - Environment variables and tag management

Each component includes:

  • When to use (use cases)
  • Code examples
  • Technical notes where relevant
  • File location reference

Testing

Build & Tests

make check
  • ✅ Build successful (zero errors)
  • ✅ All 521 tests pass
  • ✅ No SwiftLint warnings for modified files

Manual Testing

  • ✅ Settings > General tab - All controls functional
  • ✅ Settings > Data & Security tab - All controls functional
  • ✅ Settings > Tools tab - StatusIndicator displays correctly
  • ✅ No visual differences from before extraction
  • ✅ All bindings work correctly

Files Modified

Modified

  • Sources/TermQ/Views/SettingsView.swift - View extraction, reduced from 528 → 335 lines
  • Sources/TermQ/Views/ToolsTabContent.swift - Applied StatusIndicator
  • .claude/commands/code-style.md - Added component usage patterns

Created

  • Sources/TermQ/Views/Settings/SettingsGeneralView.swift - 169 lines
  • Sources/TermQ/Views/Settings/SettingsDataSecurityView.swift - 74 lines

Related

Success Criteria

  • ✅ StatusIndicator applied to Global Settings > Tools tab
  • ✅ SettingsView.swift file length under 500 lines (now 335)
  • ✅ SettingsView.swift type body length under 300 lines
  • ✅ All extracted views maintain exact same functionality
  • ✅ Component usage patterns documented in code-style.md
  • ✅ All 521 tests pass
  • ✅ Zero build errors
  • ✅ Manual testing verified (all tabs work correctly)
  • ✅ SettingsView.swift SwiftLint warnings eliminated

Next Steps

After this PR merges:

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

…iews

## Changes

### StatusIndicator Applied to Global Settings
- Applied StatusIndicator component to Global Settings > Tools tab
- Replaced manual HStack status displays with StatusIndicator
- Consistent with Terminal Details editor (PR #6)
- Removed ~90 lines of duplicate status display code

### View Extraction (Fix SwiftLint Violations)
- Extracted SettingsGeneralView from SettingsView.swift
  - Contains Terminal, Bin, Updates, Language, Uninstall, About sections
  - Reduced SettingsView.swift from 528 → 335 lines
- Extracted SettingsDataSecurityView from SettingsView.swift
  - Contains Security, Data Storage, Data Protection sections
  - Includes browseForDataDirectory() helper
- Fixed file length violations:
  - File: Was 528/500 (28 over) → Now 335/500 ✅
  - Type body: Was 398/300 (98 over) → Under limit ✅

### Component Documentation
- Added "Reusable UI Components" section to code-style.md
- Documented all 5 components with usage patterns:
  - PathInputField - Path inputs with validation
  - SharedToggle - Two-tier permission toggles
  - StatusIndicator - Feature/service status display
  - LargeTextInput - Multi-line input with fixed height
  - KeyValueEditor - Environment variables, tags

## Testing
- All 521 tests pass
- Build successful with zero errors
- No SwiftLint warnings for modified files
- Manual testing: All Settings tabs functional

## Files Modified
- SettingsView.swift - View extraction, reduced length
- ToolsTabContent.swift - Applied StatusIndicator
- code-style.md - Added component documentation

## Files Created
- Sources/TermQ/Views/Settings/SettingsGeneralView.swift
- Sources/TermQ/Views/Settings/SettingsDataSecurityView.swift

## Technical Notes
- Used Binding wrapper for defaultBackend (String ↔ TerminalBackend)
- Maintained exact same functionality, no behavior changes
- View extraction preserves all existing features

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Jan 19, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@eyelock eyelock merged commit 426eef5 into main Jan 19, 2026
6 checks passed
@eyelock eyelock deleted the feat/pr7-final-polish-documentation branch January 19, 2026 00:41
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.

1 participant