diff --git a/CHANGELOG.md b/CHANGELOG.md index 652181b..e53f121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ Alle nennenswerten Änderungen an SyncDrive. Format nach [Keep a Changelog](http Korrekturen heben PATCH. Die Version steht an einer Stelle (`04-umsetzung/Directory.Build.props`); ein Test prüft, dass sie mit dem obersten Eintrag hier übereinstimmt. Jede Version bekommt ein Git-Tag `vX.Y.Z`. Die Versionen 0.1.0 bis 0.11.0 wurden nachträglich vergeben. +## [0.39.2] – 2026-10-23 – Mac: Panel wie unter Windows + +### Geändert +- Mac-Vorschau: Ein Klick auf das Symbol in der Menüleiste öffnet jetzt das **Panel wie unter Windows** (Status, Zuletzt geändert, + Benachrichtigungen, Schnellzugriffe) unter der Menüleiste, statt nur ein Menü zu zeigen. Pause, Fehlersuche und Beenden stehen im + neuen „⋯“-Knopf der Fußleiste (nur auf dem Mac; unter Windows bleibt das Rechtsklick-Menü). + +### Behoben +- Mac: Aus dem geöffneten Disk-Image gestartet, legte die App einen Autostart auf das Disk-Image an, der nach dem Auswerfen ins Leere + lief. Jetzt nur noch aus „Programme“; beim Start aus dem Disk-Image erscheint ein Hinweis, die App in „Programme“ zu ziehen. +- Test auf dem Mac-Runner: Vom Sync geschriebene Dateien sind im Finder normal (nicht versteckt, lesbar, kein „in Arbeit“-Datum, + keine Zusatzattribute). + ## [0.39.1] – 2026-10-23 – Mac: kein „On-Demand braucht NTFS“ mehr ### Behoben diff --git a/Directory.Build.props b/Directory.Build.props index fdeedc0..0fcf2d4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ - 0.39.1 + 0.39.2 enable enable latest diff --git a/src/SyncDrive.Client.Daemon/LocalEnvironment.cs b/src/SyncDrive.Client.Daemon/LocalEnvironment.cs index d2b5c64..b9d5237 100644 --- a/src/SyncDrive.Client.Daemon/LocalEnvironment.cs +++ b/src/SyncDrive.Client.Daemon/LocalEnvironment.cs @@ -77,9 +77,13 @@ public sealed class MacLaunchAgent(string executable, string? launchAgents = nul public string PlistPath { get; } = Path.Combine( launchAgents ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "LaunchAgents"), Label + ".plist"); + /// Aus dem geöffneten Disk-Image gestartet (/Volumes/…): der Pfad verschwindet beim Auswerfen. + public static bool RunsFromDiskImage(string executable) => executable.StartsWith("/Volumes/", StringComparison.Ordinal); + public void Apply(bool enabled) { - if (!enabled) + // Ein Autostart auf das Disk-Image liefe nach dem Auswerfen ins Leere; erst aus „Programme“ heraus anlegen + if (!enabled || RunsFromDiskImage(executable)) { File.Delete(PlistPath); return; diff --git a/src/SyncDrive.Client.Tray/App.axaml b/src/SyncDrive.Client.Tray/App.axaml index ce28ca3..64fe13c 100644 --- a/src/SyncDrive.Client.Tray/App.axaml +++ b/src/SyncDrive.Client.Tray/App.axaml @@ -38,6 +38,7 @@ M3.5 4H9L11 6H20.5A1.5 1.5 0 0 1 22 7.5V18.5A1.5 1.5 0 0 1 20.5 20H3.5A1.5 1.5 0 0 1 2 18.5V5.5A1.5 1.5 0 0 1 3.5 4Z M3 4.9H21V7.3H3Z M3 10.8H21V13.2H3Z M3 16.7H21V19.1H3Z M12 2A10 10 0 1 1 12 22A10 10 0 1 1 12 2Z M12 4.2A7.8 7.8 0 1 0 12 19.8A7.8 7.8 0 1 0 12 4.2Z M10.8 15.8H13.2V18.2H10.8Z M8.6 9.4A3.4 3.4 0 1 1 13.6 12.4C12.9 12.8 13.1 13.2 13.1 14.4H10.9C10.9 12.6 11.1 11.9 12.4 11.1A1.3 1.3 0 1 0 10.7 9.4Z + M3.5 12A2.5 2.5 0 1 1 8.5 12A2.5 2.5 0 1 1 3.5 12Z M9.5 12A2.5 2.5 0 1 1 14.5 12A2.5 2.5 0 1 1 9.5 12Z M15.5 12A2.5 2.5 0 1 1 20.5 12A2.5 2.5 0 1 1 15.5 12Z M19.55 12.86L22.02 14.4 20.78 17.38 17.95 16.73 16.73 17.95 17.38 20.78 14.4 22.02 12.86 19.55 11.14 19.55 9.6 22.02 6.62 20.78 7.27 17.95 6.05 16.73 3.22 17.38 1.98 14.4 4.45 12.86 4.45 11.14 1.98 9.6 3.22 6.62 6.05 7.27 7.27 6.05 6.62 3.22 9.6 1.98 11.14 4.45 12.86 4.45 14.4 1.98 17.38 3.22 16.73 6.05 17.95 7.27 20.78 6.62 22.02 9.6 19.55 11.14Z M15.3 12A3.3 3.3 0 1 0 8.7 12A3.3 3.3 0 1 0 15.3 12Z diff --git a/src/SyncDrive.Client.Tray/App.axaml.cs b/src/SyncDrive.Client.Tray/App.axaml.cs index c7dc499..d4a768c 100644 --- a/src/SyncDrive.Client.Tray/App.axaml.cs +++ b/src/SyncDrive.Client.Tray/App.axaml.cs @@ -103,6 +103,12 @@ private static async Task OpenStartAsync(ShellViewModel shell, WindowManager win { windows.OpenMainWindow(MainPage.SyncTasks); } + + // macOS: direkt aus dem Disk-Image gestartet – dort fehlt SyncDrive in „Programme“, und der Autostart bliebe aus + if (OperatingSystem.IsMacOS() && SyncDrive.Client.Daemon.MacLaunchAgent.RunsFromDiskImage(AppContext.BaseDirectory)) + { + _ = windows.ShowMessageAsync(shell.Texts.MoveToApplications); + } }); } @@ -114,7 +120,9 @@ private void SetUpTray(ShellViewModel shell, WindowManager windows, Texts texts) var troubleshoot = new NativeMenuItem(texts.MenuTroubleshoot) { Command = shell.TroubleshootCommand }; var exit = new NativeMenuItem(texts.MenuExit) { Command = shell.ExitCommand }; var menu = new NativeMenu { pause, settings, new NativeMenuItemSeparator(), about, troubleshoot, new NativeMenuItemSeparator(), exit }; - var tray = new TrayIcon { Menu = menu, ToolTipText = shell.Tooltip, IsVisible = true }; + // macOS zeigt bei einem Menü am Symbol nur das Menü und meldet keinen Klick: dort öffnet der Klick das Panel wie unter Windows, + // Pause, Info, Fehlersuche und Beenden stehen im „⋯“-Menü des Panels. + var tray = new TrayIcon { Menu = OperatingSystem.IsMacOS() ? null : menu, ToolTipText = shell.Tooltip, IsVisible = true }; tray.Clicked += (_, _) => windows.TogglePanel(); MacOSProperties.SetIsTemplateIcon(tray, true); // nur macOS: Vorlagenbild, hell oder dunkel wie die Menüleiste TrayIcon.SetIcons(this, [tray]); diff --git a/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml b/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml index 77dad92..31e375c 100644 --- a/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml +++ b/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml @@ -38,6 +38,18 @@ + + diff --git a/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml.cs b/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml.cs index 47649de..c0e7197 100644 --- a/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml.cs +++ b/src/SyncDrive.Client.Tray/Views/PanelWindow.axaml.cs @@ -20,9 +20,10 @@ public void ShowNearTray(PanelViewModel viewModel) { var area = screen.WorkingArea; var scale = screen.Scaling; + // Windows: über der Taskleiste unten rechts; macOS: unter der Menüleiste oben rechts, dort sitzt das Symbol Position = new PixelPoint( area.Right - (int)(Width * scale) - (int)(12 * scale), - area.Bottom - (int)(Height * scale) - (int)(12 * scale)); + OperatingSystem.IsMacOS() ? area.Y + (int)(6 * scale) : area.Bottom - (int)(Height * scale) - (int)(12 * scale)); } Show(); diff --git a/src/SyncDrive.Client.Ui/ShellViewModel.cs b/src/SyncDrive.Client.Ui/ShellViewModel.cs index 08b78a3..50df842 100644 --- a/src/SyncDrive.Client.Ui/ShellViewModel.cs +++ b/src/SyncDrive.Client.Ui/ShellViewModel.cs @@ -297,6 +297,9 @@ public PanelViewModel(ShellViewModel shell, IUiServices ui, Texts texts, TimePro public bool ShowNotifications => !ShowRecent; + /// „⋯“ mit Pause, Fehlersuche, Beenden: unter macOS, wo das Symbol in der Menüleiste kein eigenes Menü hat. + public bool ShowMoreMenu { get; init; } = OperatingSystem.IsMacOS(); + public ObservableCollection Recent { get; } = []; public ObservableCollection Notifications { get; } = []; diff --git a/src/SyncDrive.Client.Ui/Texts.cs b/src/SyncDrive.Client.Ui/Texts.cs index 600e0c2..6e6463a 100644 --- a/src/SyncDrive.Client.Ui/Texts.cs +++ b/src/SyncDrive.Client.Ui/Texts.cs @@ -39,6 +39,11 @@ public sealed record Texts public required string MenuExit { get; init; } + public required string More { get; init; } + + /// macOS: aus dem Disk-Image gestartet. + public required string MoveToApplications { get; init; } + // Panel public required string TabRecentlyChanged { get; init; } @@ -390,6 +395,8 @@ public sealed record Texts MenuAbout = "About", MenuTroubleshoot = "Troubleshoot", MenuExit = "Exit", + More = "More", + MoveToApplications = "SyncDrive is running from the disk image. Quit it, drag SyncDrive into the Applications folder and start it from there – only then does it open at login.", TabRecentlyChanged = "Recently Changed", TabNotifications = "Notifications", EmptyRecent = "Nothing has changed yet", @@ -560,6 +567,8 @@ public sealed record Texts MenuAbout = "Info", MenuTroubleshoot = "Fehlersuche", MenuExit = "Beenden", + More = "Weitere", + MoveToApplications = "SyncDrive läuft aus dem Disk-Image. Beenden Sie es, ziehen Sie SyncDrive in den Ordner „Programme“ und starten Sie es dort – nur dann öffnet es sich beim Anmelden.", TabRecentlyChanged = "Zuletzt geändert", TabNotifications = "Benachrichtigungen", EmptyRecent = "Noch keine Änderungen", diff --git a/tests/SyncDrive.Client.Tests/LocalFileStoreTests.cs b/tests/SyncDrive.Client.Tests/LocalFileStoreTests.cs index 8e92a5c..1f85de9 100644 --- a/tests/SyncDrive.Client.Tests/LocalFileStoreTests.cs +++ b/tests/SyncDrive.Client.Tests/LocalFileStoreTests.cs @@ -65,6 +65,51 @@ public async Task Names_written_in_another_unicode_form_are_found_under_their_nf Assert.Null(await _store.StatAsync(path, Ct)); } + /// + /// macOS: Eine vom Sync geschriebene Datei muss im Finder normal erscheinen und sich öffnen lassen – nicht versteckt, lesbar, kein + /// „in Arbeit“-Datum (Finder graut Dateien mit Erstellungsdatum 24.01.1984 aus), keine fremden Zusatzattribute. + /// + [Fact] + public async Task On_macos_a_downloaded_file_looks_like_any_other_file_in_finder() + { + if (!OperatingSystem.IsMacOS()) + { + return; + } + + await using (var staged = await _store.StageAsync(P("Ordner/Bericht.pdf"), Ct)) + { + await staged.Content.WriteAsync("%PDF-1.4"u8.ToArray(), Ct); + await staged.CommitAsync(new DateTimeOffset(2026, 9, 11, 13, 35, 0, TimeSpan.Zero), Ct); + } + + var file = Full("Ordner/Bericht.pdf"); + var stat = Run("/usr/bin/stat", "-f", "%SB|%Sm|%Sf|%Sp|%Su", file); + var folder = Run("/usr/bin/stat", "-f", "%Sf|%Sp", Full("Ordner")); + var xattr = Run("/usr/bin/xattr", "-l", file); + var parts = stat.Split('|'); + + Assert.True( + !parts[2].Contains("hidden", StringComparison.Ordinal) && parts[3].StartsWith("-rw", StringComparison.Ordinal) + && !parts[0].Contains("1984", StringComparison.Ordinal) && !folder.Contains("hidden", StringComparison.Ordinal) + && xattr.Length == 0, + $"Datei: {stat} | Ordner: {folder} | xattr: {xattr}"); + } + + private static string Run(string program, params string[] arguments) + { + var start = new System.Diagnostics.ProcessStartInfo(program) { RedirectStandardOutput = true, UseShellExecute = false }; + foreach (var argument in arguments) + { + start.ArgumentList.Add(argument); + } + + using var process = System.Diagnostics.Process.Start(start)!; + var output = process.StandardOutput.ReadToEnd().Trim(); + process.WaitForExit(); + return output; + } + private string Full(string relative) => Path.Combine(_root, relative.Replace('/', Path.DirectorySeparatorChar)); private void Write(string relative, string content = "x") diff --git a/tests/SyncDrive.Server.Host.Tests/MacLaunchAgentTests.cs b/tests/SyncDrive.Server.Host.Tests/MacLaunchAgentTests.cs index 5d9c637..e442424 100644 --- a/tests/SyncDrive.Server.Host.Tests/MacLaunchAgentTests.cs +++ b/tests/SyncDrive.Server.Host.Tests/MacLaunchAgentTests.cs @@ -39,4 +39,15 @@ public void Enabling_writes_a_launch_agent_that_starts_the_app_in_the_background agent.Apply(false); Assert.False(File.Exists(agent.PlistPath)); } + + [Fact] + public void Started_from_the_disk_image_no_launch_agent_points_to_a_path_that_disappears_on_eject() + { + new MacLaunchAgent("/Applications/SyncDrive.app/Contents/MacOS/syncdrive", _folder).Apply(true); + var fromImage = new MacLaunchAgent("/Volumes/SyncDrive/SyncDrive.app/Contents/MacOS/syncdrive", _folder); + + fromImage.Apply(true); + + Assert.False(File.Exists(fromImage.PlistPath)); // auch ein alter Eintrag ist weg; aus „Programme“ entsteht er neu + } }