diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..6e29798 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,65 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Build & Development + +This is a native macOS SwiftUI app. Open `FastMemos.xcodeproj` in Xcode and build with `⌘B`. + +From the command line: +```bash +xcodebuild -project FastMemos.xcodeproj -scheme FastMemos -configuration Debug build +``` + +To run: +```bash +xcodebuild -project FastMemos.xcodeproj -scheme FastMemos -configuration Debug build +open ./build/Debug/FastMemos.app +``` + +**Requirements:** macOS 13.0+ (Ventura), Xcode 15+ + +## Architecture + +FastMemos is a menubar-only macOS app for quickly capturing notes to a self-hosted [Memos](https://github.com/usememos/memos) server. + +### Key Components + +**Entry Point (`FastMemosApp.swift`):** +- `AppDelegate` sets up the menubar status item and popover +- App runs as `.accessory` (no dock icon) +- Global hotkey (⌘⇧M) triggers `showNoteWindow()` +- `NotePanel` is a floating `NSPanel` for the note capture UI + +**State Management:** +- `AppState` (in `ViewModels/`) is the single source of truth, passed to all views +- Publishes: `isLoggedIn`, `serverURL`, `defaultVisibility`, `isLoading`, `lastError`, `launchAtLogin` +- Handles authentication flow and memo creation + +**Services (in `Services/`):** +- `MemosAPIService` - Communicates with Memos v1 API (`/api/v1/memos`, `/api/v1/auth/status`) +- `KeychainService` - Stores access tokens securely in macOS Keychain (service: `me.orzech.FastMemos`) +- `ShortcutService` - Registers global hotkey using Carbon Events API + +**Views (in `Views/`):** +- `MenuBarView` - Main popover shown from menubar icon +- `NoteWindowView` - Floating note capture panel with visibility picker +- `LoginView` - Access token authentication flow +- `SettingsView` - App preferences (visibility, launch at login) + +**Models (in `Models/`):** +- `Memo`, `CreateMemoRequest` - API request/response structures +- `MemoVisibility` - Enum: `.private`, `.protected`, `.public` + +### Data Flow + +1. User triggers hotkey → `AppDelegate.showNoteWindow()` → `NotePanel` appears +2. User writes note, selects visibility, presses ⌘Enter +3. `NoteWindowView.submitMemo()` → `AppState.createMemo()` → `MemosAPIService.createMemo()` +4. Token from `KeychainService` is used for Bearer auth + +### Settings Storage + +- `UserDefaults`: `serverURL`, `defaultVisibility`, `shortcutKeyCode`, `shortcutModifiers` +- Keychain: `accessToken`, `username` +- `SMAppService.mainApp` for launch at login diff --git a/FastMemos-1.0.0.zip b/FastMemos-1.0.0.zip deleted file mode 100644 index 09a9ca8..0000000 Binary files a/FastMemos-1.0.0.zip and /dev/null differ diff --git a/FastMemos-1.0.1.zip b/FastMemos-1.0.1.zip new file mode 100644 index 0000000..9f26fa1 Binary files /dev/null and b/FastMemos-1.0.1.zip differ diff --git a/FastMemos.app/Contents/Info.plist b/FastMemos.app/Contents/Info.plist index afdcbd7..c4dc57a 100644 --- a/FastMemos.app/Contents/Info.plist +++ b/FastMemos.app/Contents/Info.plist @@ -10,6 +10,8 @@ FastMemos CFBundleIconFile AppIcon + CFBundleIconName + AppIcon CFBundleIdentifier me.orzech.FastMemos CFBundleInfoDictionaryVersion @@ -19,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.0 + 1.0.1 CFBundleSupportedPlatforms MacOSX diff --git a/FastMemos.app/Contents/MacOS/FastMemos b/FastMemos.app/Contents/MacOS/FastMemos index eb744ab..93d6c80 100755 Binary files a/FastMemos.app/Contents/MacOS/FastMemos and b/FastMemos.app/Contents/MacOS/FastMemos differ diff --git a/FastMemos.app/Contents/Resources/AppIcon.icns b/FastMemos.app/Contents/Resources/AppIcon.icns new file mode 100644 index 0000000..9a32c52 Binary files /dev/null and b/FastMemos.app/Contents/Resources/AppIcon.icns differ diff --git a/FastMemos.app/Contents/Resources/Assets.car b/FastMemos.app/Contents/Resources/Assets.car index 0bbee1b..baff44e 100644 Binary files a/FastMemos.app/Contents/Resources/Assets.car and b/FastMemos.app/Contents/Resources/Assets.car differ diff --git a/FastMemos.app/Contents/_CodeSignature/CodeResources b/FastMemos.app/Contents/_CodeSignature/CodeResources index 76e7429..b47350a 100644 --- a/FastMemos.app/Contents/_CodeSignature/CodeResources +++ b/FastMemos.app/Contents/_CodeSignature/CodeResources @@ -4,18 +4,29 @@ files + Resources/AppIcon.icns + + ORGbkp1S899rWbEjZ/tNkVVLdro= + Resources/Assets.car - CsD7XkAT/ARWQWJ99BetayOzLlE= + cksUAC98EafZIfKsBaoS+aP805o= files2 + Resources/AppIcon.icns + + hash2 + + ME58VQGz3AD9X5q7Xj654HeiGHgQ4D2k8mSLplwLvc4= + + Resources/Assets.car hash2 - k+rxT6Xd2FCQLfhgNlPCgS1IiDV1Klw0FQfNaCX1A3s= + m3hT/zd8OdcdoapvIxDo+aPRvDvSej90Wfiy+aU6GlE= diff --git a/FastMemos/Info.plist b/FastMemos/Info.plist index a3774b3..594fba1 100644 --- a/FastMemos/Info.plist +++ b/FastMemos/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.0 + 1.0.1 CFBundleVersion 1 LSApplicationCategoryType