Skip to content

Add tests#38

Open
AlexW00 wants to merge 6 commits intomainfrom
tests
Open

Add tests#38
AlexW00 wants to merge 6 commits intomainfrom
tests

Conversation

@AlexW00
Copy link
Copy Markdown
Owner

@AlexW00 AlexW00 commented Mar 9, 2026

No description provided.

AlexW00 added a commit that referenced this pull request Apr 15, 2026
Bookmarks were created and resolved with `options: []` instead of
`.withSecurityScope`, so the sandbox access grant was not embedded
in the bookmark data.  macOS sometimes caches grants across restarts,
masking the bug — but OS updates and app re-signs clear the cache,
leaving `contentsOfDirectory` to fail silently and the sidebar empty.

Changes:
- Use `.withSecurityScope` when creating and resolving bookmarks
- Check and log `startAccessingSecurityScopedResource()` return value
- Replace silent `try?` in `contentsOfDirectory` with explicit error
  logging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AlexW00 added a commit that referenced this pull request Apr 27, 2026
…it (#40)

* Fix macOS sidebar empty after restart or app update (#38)

Bookmarks were created and resolved with `options: []` instead of
`.withSecurityScope`, so the sandbox access grant was not embedded
in the bookmark data.  macOS sometimes caches grants across restarts,
masking the bug — but OS updates and app re-signs clear the cache,
leaving `contentsOfDirectory` to fail silently and the sidebar empty.

Changes:
- Use `.withSecurityScope` when creating and resolving bookmarks
- Check and log `startAccessingSecurityScopedResource()` return value
- Replace silent `try?` in `contentsOfDirectory` with explicit error
  logging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add macOS update note for the bookmark fix

Shows a changelog note on first launch after updating to v1.3,
mirroring the iOS changelog pattern. The note explains the sidebar
bug fix and instructs users to re-select their storage folder once.

- MacChangelogData: static changelog entries (same pattern as iOS)
- MacChangelogManager: tracks last-seen version via UserDefaults
- AppDelegate: checks for pending changelog before restoring notes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix activationPolicy call missing parentheses

`NSApplication.shared.activationPolicy` is a method, not a property —
needs `()` to call it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix app quitting when closing the Settings window

applicationShouldTerminateAfterLastWindowClosed returned true whenever
the Dock icon was hidden, but macOS counts the Settings window too.
Closing Settings as the last window would quit the app unexpectedly.

Now only returns true when no note windows remain (checked via
ZettelWindowManager.hasNoWindows).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix Dock icon click creating new windows instead of focusing

Two issues:
1. applicationShouldHandleReopen returned true, causing macOS to
   also perform its default reopen behavior on top of ours — leading
   to duplicate windows and broken Stage Manager integration.
2. The hasVisibleWindows flag is unreliable for NSPanel windows with
   accessory activation policy, so it always took the create-window
   branch.

Now uses our own window tracking (hasNoWindows) and returns false to
prevent macOS default behavior. Added focusLastWindow() to bring just
the last-used window forward on Dock click.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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