feature: model-owned resolvedOneDriveFolder + OneDrive Settings/menu panel snapshots
SettingsView's OneDrive row called OneDriveLocator.resolveOneDriveFolder() directly with the real UserDefaults.standard and the real home directory, which made that row impossible to drive from a fake/isolated environment. Moved that resolution into AppModel as a tracked resolvedOneDriveFolder property (nil means "no OneDrive folder found"), refreshed at init, bootstrap, chooseTransport, chooseOneDriveFolder, and inside send()'s live folder check. SettingsView and chooseOneDriveFolder's picker-start path now read model.resolvedOneDriveFolder instead of calling OneDriveLocator directly — state flows through the model like everything else in this app. PanelSnapshot (SHOTDECK_SNAPSHOT_DIR) adds three panels on a SEPARATE isolated model so the transport switch never bleeds into the six existing AirDrop-mode panels: - panel-07-settings-onedrive.png: transport=oneDrive with a resolved folder, built by pointing OneDriveLocator.defaultRedlineFolder at a fake home tree (Library/CloudStorage/OneDrive-MMDGROUP under this snapshot's own temp root) so the displayed path is shaped like the real default without ever touching the real home. - panel-08-settings-onedrive-missing.png: a fake home with no Library/CloudStorage at all, resolved through a throwaway UserDefaults suite (never .standard) so the "no OneDrive folder found" state and its still-usable Choose... button are exercised for real. - panel-09-captures-present-onedrive.png: 3 captures + transport=oneDrive, confirming the menu row reads "Send to OneDrive". Extracted the 3-swatch capture seeding (panel 04) into addSampleCaptures(to:) so panel 09 reuses it instead of duplicating the loop. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ZiTXPbPCSjzPVsfoweAbp
This commit is contained in:
@@ -31,10 +31,12 @@ extension AppModel: SendCapable {
|
||||
let path = OneDriveLocator.resolveOneDriveFolder()?.path
|
||||
?? TransportSettings.storedOneDriveFolderPath()
|
||||
?? "no OneDrive folder found"
|
||||
setResolvedOneDriveFolder(nil)
|
||||
setStatus(ShotdeckError.oneDriveFolderUnavailable(path: path).errorDescription)
|
||||
setSending(false)
|
||||
return
|
||||
}
|
||||
setResolvedOneDriveFolder(folder)
|
||||
if outboxURL != folder || watchFolderURL != folder {
|
||||
setFolderURLs(outbox: folder, watch: folder)
|
||||
try? await watcher.updateWatchFolder(folder)
|
||||
|
||||
Reference in New Issue
Block a user