This document summarizes the refactoring and modernization work completed in this session.
- SwiftUI modernization (deprecated APIs, accessibility labels, modifiers).
- Concurrency safety improvements (cancellable tasks, removal of unstructured
Task.detachedwhere possible). - Large view extraction and logic cleanup (move logic out of
body, create dedicated subviews).
- Replaced
.foregroundColor(...)with.foregroundStyle(...)across the codebase. - Replaced icon-only toolbar buttons with labeled buttons using
Label(...).labelStyle(.iconOnly)to improve VoiceOver support. - Converted
Text + Textconcatenation to string interpolation with styledTextfragments. - Replaced
onTapGesturetoggling onTogglewith.animation(..., value:)where appropriate.
- Replaced
Task.sleep(nanoseconds:)withTask.sleep(for:)and handled throwing sleeps withtry?inside non-throwing task closures. - Converted
DispatchQueue.*usage toTaskwhere safe. - Added cancellable debounced tasks in several views to prevent overlapping work.
- Removed
Task.detachedusage where it was unnecessary, keeping one debug-only detached task inCreateStreamingHandlersby design.
Created new SwiftUI subviews to shrink large bodies and isolate responsibilities:
RsyncUI/Views/InspectorViews/LogRecords/LogRecordsFooterView.swiftRsyncUI/Views/Tasks/TasksFocusActionsView.swiftRsyncUI/Views/Snapshots/SnapshotsMainContentView.swiftRsyncUI/Views/Restore/RestoreContentView.swiftRsyncUI/Views/Restore/RestoreControlsView.swiftRsyncUI/Views/ScheduleView/CalendarMonthGridView.swiftRsyncUI/Views/Detailsview/SummarizedDetailsContentView.swiftRsyncUI/Views/Tasks/TasksListPanelView.swiftRsyncUI/Views/InspectorViews/Add/GlobalChangeFormView.swiftRsyncUI/Views/Quicktask/QuicktaskFormView.swiftRsyncUI/Views/Sidebar/SidebarStatusMessagesView.swiftRsyncUI/Views/InspectorViews/Add/AddTaskContentView.swift
- None intended. UI flows and task execution behavior should be identical; changes are structural and accessibility-oriented.
Added:
RsyncUI/Views/InspectorViews/LogRecords/LogRecordsFooterView.swiftRsyncUI/Views/Tasks/TasksFocusActionsView.swiftRsyncUI/Views/Snapshots/SnapshotsMainContentView.swiftRsyncUI/Views/Restore/RestoreContentView.swiftRsyncUI/Views/Restore/RestoreControlsView.swiftRsyncUI/Views/ScheduleView/CalendarMonthGridView.swiftRsyncUI/Views/Detailsview/SummarizedDetailsContentView.swiftRsyncUI/Views/Tasks/TasksListPanelView.swiftRsyncUI/Views/InspectorViews/Add/GlobalChangeFormView.swiftRsyncUI/Views/Quicktask/QuicktaskFormView.swiftRsyncUI/Views/Sidebar/SidebarStatusMessagesView.swiftRsyncUI/Views/InspectorViews/Add/AddTaskContentView.swift
Removed:
- None
RsyncUI/Views/Tasks/TasksView.swiftRsyncUI/Views/InspectorViews/LogRecords/LogRecordsTabView.swiftRsyncUI/Views/Snapshots/SnapshotsView.swiftRsyncUI/Views/Restore/RestoreTableView.swiftRsyncUI/Views/ScheduleView/CalendarMonthView.swiftRsyncUI/Views/Detailsview/SummarizedDetailsView.swiftRsyncUI/Views/InspectorViews/Add/GlobalChangeTaskView.swiftRsyncUI/Views/Quicktask/QuicktaskView.swiftRsyncUI/Views/Sidebar/SidebarMainView.swiftRsyncUI/Views/InspectorViews/Add/AddTaskView.swift
- UI flows, navigation, and task execution logic are unchanged.
- All extracted subviews preserve existing layout and logic, just moved into dedicated files.
- Debug-only concurrency checks remain intact.
XcodeRefreshCodeIssuesInFilefor all refactored files; no outstanding issues remain.
- A debug-only
Task.detachedremains inCreateStreamingHandlersfor threading verification.
-
Optional view model extraction
- Some views still have substantial business logic. If desired, extract to
@Observableview models forQuicktaskView,TasksView, andSidebarMainView.
- Some views still have substantial business logic. If desired, extract to
-
Additional accessibility sweep
- Verify any remaining labels/buttons for VoiceOver and Dynamic Type compliance.
-
Build + tests
- Run a full Xcode build to validate the refactors across the project.
- If available, run unit/UI tests to catch regressions.
-
Performance pass
- Evaluate large tables/lists for expensive inline computations and consider caching or precomputing where appropriate.
-
Optional follow-ups
- Further subview extraction in
SidebarMainView,QuicktaskView, andAddTaskViewif desired.
- Further subview extraction in
- Add tests for
VerifyConfigurationerror propagation for eachValidateInputErrorcase. - Verify snapshot side effects by asserting when
snapshotcreateremotecatalogis invoked and when it is not. - Expand
DeeplinkURL.handleURLtests for invalid schemes, unsupported actions, andvalidateNoAction. - Strengthen
ArgumentsSynchronizecoverage by validating specific argument flags per task type. - Add JSON decode/encode tests for
DecodeSynchronizeConfiguration,DecodeLogRecords, andDecodeUserConfiguration, including invalid and backward-compat cases. - Cover storage read/write flows for log records, schedules, widgets, and configurations.
- Add utility tests for
SSHParams,Rsyncversion, andGetfullpathforRsync. - Add async/actor tests for storage actors (
ActorReadSchedule,ActorReadSynchronizeConfigurationJSON,ActorLogToFile).