Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 92 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ jobs:
fail-fast: false
matrix:
include:
- name: Xcode 15.4
- name: Xcode 15.4 arm64
os: macos-14
developer_directory: /Applications/Xcode_15.4.app/Contents/Developer
- name: Current
architecture: arm64
- name: Current arm64
os: macos-26
developer_directory: ""
architecture: arm64
- name: macOS 15 Intel
os: macos-15-intel
developer_directory: ""
architecture: x86_64

steps:
- name: Check out repository
Expand All @@ -31,6 +37,16 @@ jobs:
if: matrix.developer_directory != ''
run: sudo xcode-select --switch "${{ matrix.developer_directory }}"

- name: Verify runner architecture
env:
EXPECTED_ARCHITECTURE: ${{ matrix.architecture }}
run: |
actual_architecture="$(uname -m)"
if [[ "$actual_architecture" != "$EXPECTED_ARCHITECTURE" ]]; then
echo "Expected $EXPECTED_ARCHITECTURE runner, got $actual_architecture." >&2
exit 1
fi

- name: Report toolchain
run: |
xcodebuild -version
Expand All @@ -42,3 +58,77 @@ jobs:

- name: Run tests
run: COPYFILE_DISABLE=1 swift test

universal-package:
name: Package (Universal)
runs-on: macos-14
timeout-minutes: 25

steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Select Xcode 15.4
run: sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer

- name: Report packaging toolchain
run: |
xcodebuild -version
swift --version
xcrun --show-sdk-version

- name: Package Universal app without release credentials
env:
CODEX_NOTES_INSTALL_LOCAL: "0"
COPYFILE_DISABLE: "1"
run: zsh scripts/package-app.sh

- name: Verify Universal archive and all code slices
env:
EXTRACT_DIRECTORY: ${{ runner.temp }}/codexnotes-universal
run: |
mkdir -p "$EXTRACT_DIRECTORY"
ditto -x -k dist/CodexNotes.zip "$EXTRACT_DIRECTORY"
app_path="$EXTRACT_DIRECTORY/CodexNotes.app"
test -d "$app_path"
zsh scripts/verify-universal-app.sh "$app_path"
codesign \
--verify \
--deep \
--strict \
--all-architectures \
--verbose=2 \
"$app_path"

- name: Reject an app with one architecture removed
env:
EXTRACT_DIRECTORY: ${{ runner.temp }}/codexnotes-universal
NEGATIVE_DIRECTORY: ${{ runner.temp }}/codexnotes-missing-slice
run: |
mkdir -p "$NEGATIVE_DIRECTORY"
negative_app="$NEGATIVE_DIRECTORY/CodexNotes.app"
ditto "$EXTRACT_DIRECTORY/CodexNotes.app" "$negative_app"

executable="$negative_app/Contents/MacOS/CodexNotesProbe"
thin_executable="$NEGATIVE_DIRECTORY/CodexNotesProbe-arm64"
lipo "$executable" -remove x86_64 -output "$thin_executable"
mv "$thin_executable" "$executable"
chmod 755 "$executable"
if [[ "$(lipo -archs "$executable")" != "arm64" ]]; then
echo "Failed to construct the arm64-only negative fixture." >&2
exit 1
fi

codesign --force --deep --sign - "$negative_app"
codesign \
--verify \
--deep \
--strict \
--all-architectures \
--verbose=2 \
"$negative_app"

if zsh scripts/verify-universal-app.sh "$negative_app"; then
echo "Universal verifier accepted an app missing x86_64." >&2
exit 1
fi
4 changes: 2 additions & 2 deletions AppBundle/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.69</string>
<string>1.4.70</string>
<key>CFBundleVersion</key>
<string>89</string>
<string>90</string>
<key>LSUIElement</key>
<true/>
<key>LSMinimumSystemVersion</key>
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ CodexNotes 是一个跟随 Codex 当前任务自动切换的原生 macOS Markdow

## 系统要求

- Apple Silicon Mac(arm64)
- Apple Silicon(arm64)或 Intel(x86_64)Mac
- macOS 14.0 或更高版本
- 正式 Release 为 Universal 2,同一份应用同时包含 arm64 与 x86_64
- 当前已验证兼容 Codex `26.803.41515`

CodexNotes 是非官方第三方工具,与 OpenAI 没有隶属、授权或背书关系。

## 安装

1. 从 [Releases](https://github.com/jiangsir-tech/CodexNotes/releases/latest) 下载最新版 ZIP
1. 从 [Releases](https://github.com/jiangsir-tech/CodexNotes/releases/latest) 下载 `CodexNotes-v<版本号>-macOS-universal.zip`;同一份 Universal 2 文件适用于 Apple Silicon 与 Intel Mac
2. 解压后,把 `CodexNotes.app` 移到 `/Applications` 或 `~/Applications`。
3. 首次打开后,CodexNotes 会常驻菜单栏,不会在 Dock 显示图标。

正式 Release 使用 Developer ID 签名并通过 Apple notarization。你可以在终端验证:

```sh
codesign --verify --deep --strict --verbose=2 /Applications/CodexNotes.app
codesign --verify --deep --strict --all-architectures --verbose=2 /Applications/CodexNotes.app
spctl --assess --type exec --verbose=4 /Applications/CodexNotes.app
```

Expand Down Expand Up @@ -84,7 +85,7 @@ zsh scripts/verify-localizations.sh
zsh scripts/package-app.sh
```

`package-app.sh` 默认只在 `dist/` 生成本地 ad-hoc 构建,不会覆盖已安装应用。开发者如需安装本地构建,必须显式执行:
`package-app.sh` 默认只在 `dist/` 生成 Universal 2 的本地 ad-hoc 构建,不会覆盖已安装应用。开发者如需安装本地构建,必须显式执行:

```sh
CODEX_NOTES_INSTALL_LOCAL=1 \
Expand All @@ -104,6 +105,8 @@ zsh scripts/release-notarized.sh

自动跟随目前依赖 Codex `26.803.41515` 写出的本机主窗口导航日志。该日志不是公开稳定接口,因此 Codex 大版本更新后需要重新进行兼容性测试。

Universal 2 产物会验证 arm64 与 x86_64 两个架构。当前 Codex 联动验证以 Apple Silicon 真机为主;Intel 版已包含原生 x86_64 架构代码,完整联动兼容性将在真实 Intel Mac 上持续验证,交叉编译或 Rosetta 启动仅作为补充。

## 许可证

本仓库目前尚未采用开源许可证。公开源码用于透明度、审查与问题反馈,不代表授予复制、修改或再分发源码及品牌素材的许可。
4 changes: 2 additions & 2 deletions Sources/CodexNotesCore/CompanionVisibilityPolicy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ public enum CompanionVisibilityPolicy {
public static func shouldShow(
frontmostBundleIdentifier: String?,
companionBundleIdentifier: String?,
isSettingsVisible: Bool = false
isCodexAvailable: Bool
) -> Bool {
guard !isSettingsVisible else { return false }
guard isCodexAvailable else { return false }
guard let frontmostBundleIdentifier else { return false }
return frontmostBundleIdentifier == codexBundleIdentifier
|| frontmostBundleIdentifier == companionBundleIdentifier
Expand Down
5 changes: 3 additions & 2 deletions Sources/CodexNotesCore/Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ public enum L10n {
case settingsEditorFontSizeAccessibilityHint = "settings.editor.font_size.accessibility_hint"
case settingsEditorLineSpacing = "settings.editor.line_spacing"
case settingsEditorLineSpacingAccessibilityHint = "settings.editor.line_spacing.accessibility_hint"
case settingsEditorPreviewText = "settings.editor.preview_text"
case settingsEditorPreviewAccessibilityLabel = "settings.editor.preview.accessibility_label"
case settingsEditorWindowResizeHint = "settings.editor.window_resize_hint"
case settingsEditorRestoreWindowSize = "settings.editor.restore_window_size"
case settingsEditorRestoreWindowSizeAccessibilityHint = "settings.editor.restore_window_size.accessibility_hint"
case settingsEditorWindowSizeRestored = "settings.editor.window_size_restored"
case settingsEditorRestoreDefaults = "settings.editor.restore_defaults"
case settingsEditorRestoreDefaultsAccessibilityLabel = "settings.editor.restore_defaults.accessibility_label"
case settingsEditorRestoreDefaultsAccessibilityHint = "settings.editor.restore_defaults.accessibility_hint"
Expand Down
7 changes: 4 additions & 3 deletions Sources/CodexNotesCore/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@
"settings.editor.font_size.accessibility_hint" = "Adjust the font size of note text.";
"settings.editor.line_spacing" = "Line Spacing";
"settings.editor.line_spacing.accessibility_hint" = "0 pt uses the font’s default line spacing. Higher values add more space.";
"settings.editor.preview_text" = "This is how your note text will look.\nThe second line changes with line spacing.\nAdjust it until it feels comfortable to read.";
"settings.editor.preview.accessibility_label" = "Body Text Preview";
"settings.editor.window_resize_hint" = "Drag a note window edge to resize. CodexNotes remembers the size.";
"settings.editor.window_resize_hint" = "Text size and line spacing update the note window live. Drag its edges to resize it; CodexNotes remembers the size.";
"settings.editor.restore_window_size" = "Restore Default Note Window Size";
"settings.editor.restore_window_size.accessibility_hint" = "Restores the note window to the default size for the current display while keeping its position when possible. Notes and editor settings are not changed.";
"settings.editor.window_size_restored" = "Note window restored to its default size";
"settings.editor.restore_defaults" = "Restore Editor Defaults";
"settings.editor.restore_defaults.accessibility_label" = "Restore Editor Defaults";
"settings.editor.restore_defaults.accessibility_hint" = "Restore the 15 pt body text size and 4 pt line spacing.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@
"settings.editor.font_size.accessibility_hint" = "调整笔记正文的字体大小";
"settings.editor.line_spacing" = "行间距";
"settings.editor.line_spacing.accessibility_hint" = "0 pt 使用字体默认行距,数值越大行距越宽";
"settings.editor.preview_text" = "这是笔记正文的显示效果\n第二行会随行间距变化\n调到阅读舒适的位置即可";
"settings.editor.preview.accessibility_label" = "正文预览";
"settings.editor.window_resize_hint" = "拖动笔记窗口边缘可调整大小,尺寸会自动记住。";
"settings.editor.window_resize_hint" = "字号和行距会实时应用到笔记窗口;拖动窗口边缘可调整大小,尺寸会自动记住。";
"settings.editor.restore_window_size" = "恢复笔记窗口默认大小";
"settings.editor.restore_window_size.accessibility_hint" = "将笔记窗口恢复为适合当前显示器的默认大小,尽量保留窗口位置,不会更改笔记内容或编辑器设置。";
"settings.editor.window_size_restored" = "笔记窗口已恢复默认大小";
"settings.editor.restore_defaults" = "恢复编辑器默认";
"settings.editor.restore_defaults.accessibility_label" = "恢复编辑器默认设置";
"settings.editor.restore_defaults.accessibility_hint" = "恢复 15 pt 正文字号和 4 pt 行间距";
Expand Down
4 changes: 2 additions & 2 deletions Sources/CodexNotesProbe/CodexNotesProbeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ struct CodexNotesProbeApp: App {
}
}
.defaultSize(
width: MainWindowInitialPlacementPolicy.fallbackSize.width,
height: MainWindowInitialPlacementPolicy.fallbackSize.height
width: MainWindowInitialPlacementPolicy.swiftUIBootstrapSize.width,
height: MainWindowInitialPlacementPolicy.swiftUIBootstrapSize.height
)
.windowResizability(.contentMinSize)
.commands {
Expand Down
Loading
Loading