From 16144621b54e2d089fb7cfb565926d4bdbd2c731 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 04:47:03 +0000 Subject: [PATCH 1/2] CI: check that LaTeX rendering is compiled into the app Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015ihz5z81AZ27T33PMCKkaL --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a305f9..ca3a1ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,26 @@ jobs: echo "warnings: $(grep -cE '^/.*:[0-9]+:[0-9]+: warning:' build/xcodebuild-build.log || true)" exit $status + # MarkdownView builds its LaTeX support, and links SwiftMath, only when + # its `LaTeX` trait is on. Without it the app still builds and every + # formula shows up as raw `$$…$$` source, so check for both here. + - name: Check LaTeX rendering is compiled in + run: | + ls -d /Applications/Xcode*.app + echo "ENABLE_MATH_RENDERING mentions: $(grep -c 'ENABLE_MATH_RENDERING' build/xcodebuild-build.log || true)" + grep -o "in target '[A-Za-z]*' from project 'SwiftMath'" build/xcodebuild-build.log | sort -u || true + ls build/DerivedData/Build/Products/Debug/ClassNote.app/Contents/Resources + status=0 + if ! grep -q 'ENABLE_MATH_RENDERING' build/xcodebuild-build.log; then + echo "::error::MarkdownView was built without ENABLE_MATH_RENDERING, so formulas would show as raw LaTeX" + status=1 + fi + if ! ls build/DerivedData/Build/Products/Debug/ClassNote.app/Contents/Resources | grep -q SwiftMath; then + echo "::error::SwiftMath's resources are missing from ClassNote.app" + status=1 + fi + exit $status + - name: Run unit + integration tests run: | set +e From a16536795117193e3e198e5483d4cc25c31bced6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 04:50:20 +0000 Subject: [PATCH 2/2] Render LaTeX formulas again; opaque study tool lists; 0.16.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Formulas showed as raw `$$…$$` source everywhere (notes, study tools, Ask AI). MarkdownView compiles its LaTeX support and links SwiftMath only when its `LaTeX` trait is on, and an Xcode project does not pass package traits before Xcode 26.4, so CI (Xcode 26.2) built every release without it. MarkdownView now comes in through a local package, Packages/MarkdownRendering, whose manifest asks for the trait. A CI step fails the build if the flag or SwiftMath's resources are missing. The study tool, highlight and note version lists used the sidebar list style, which brings the window sidebar's translucent material into the page. They use the opaque inset style now. Version 0.16.5 (build 23). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015ihz5z81AZ27T33PMCKkaL --- .github/workflows/ci.yml | 4 --- Core/Utils/RichMarkdownView.swift | 2 +- Core/Utils/Theme.swift | 6 ++++ Features/Session/HighlightsView.swift | 2 +- Features/Session/NotesView.swift | 2 +- Features/Session/StudyView.swift | 2 +- Packages/MarkdownRendering/Package.swift | 31 +++++++++++++++++++ .../MarkdownRendering/MarkdownRendering.swift | 3 ++ project.yml | 14 ++++----- 9 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 Packages/MarkdownRendering/Package.swift create mode 100644 Packages/MarkdownRendering/Sources/MarkdownRendering/MarkdownRendering.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3a1ac..0224e81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,10 +79,6 @@ jobs: # formula shows up as raw `$$…$$` source, so check for both here. - name: Check LaTeX rendering is compiled in run: | - ls -d /Applications/Xcode*.app - echo "ENABLE_MATH_RENDERING mentions: $(grep -c 'ENABLE_MATH_RENDERING' build/xcodebuild-build.log || true)" - grep -o "in target '[A-Za-z]*' from project 'SwiftMath'" build/xcodebuild-build.log | sort -u || true - ls build/DerivedData/Build/Products/Debug/ClassNote.app/Contents/Resources status=0 if ! grep -q 'ENABLE_MATH_RENDERING' build/xcodebuild-build.log; then echo "::error::MarkdownView was built without ENABLE_MATH_RENDERING, so formulas would show as raw LaTeX" diff --git a/Core/Utils/RichMarkdownView.swift b/Core/Utils/RichMarkdownView.swift index a562f58..9280b29 100644 --- a/Core/Utils/RichMarkdownView.swift +++ b/Core/Utils/RichMarkdownView.swift @@ -1,5 +1,5 @@ import SwiftUI -import MarkdownView +import MarkdownRendering /// Every piece of Markdown the app shows (notes, Q&A, study tools, highlight /// explanations, live tutor cards), rendered by the MarkdownView package: diff --git a/Core/Utils/Theme.swift b/Core/Utils/Theme.swift index 4d9e943..ed12f33 100644 --- a/Core/Utils/Theme.swift +++ b/Core/Utils/Theme.swift @@ -204,6 +204,12 @@ extension View { modifier(CardBackground(radius: radius, filled: filled)) } func pill(_ color: Color) -> some View { modifier(PillStyle(color: color)) } + + /// A list of choices inside a page (study tools, highlights, note + /// versions). The sidebar style brings the window sidebar's translucent + /// material with it, which inside a page shows the desktop through a hole + /// in the window; the inset style draws an opaque background. + func paneListStyle() -> some View { listStyle(.inset) } } /// A titled group on a settings-style page. diff --git a/Features/Session/HighlightsView.swift b/Features/Session/HighlightsView.swift index b86150b..4195091 100644 --- a/Features/Session/HighlightsView.swift +++ b/Features/Session/HighlightsView.swift @@ -24,7 +24,7 @@ struct HighlightsView: View { } } } - .listStyle(.sidebar) + .paneListStyle() .frame(width: 240) Divider() HighlightDetail(vm: vm) diff --git a/Features/Session/NotesView.swift b/Features/Session/NotesView.swift index b01e0fa..6569745 100644 --- a/Features/Session/NotesView.swift +++ b/Features/Session/NotesView.swift @@ -185,6 +185,6 @@ struct NotesView: View { } .buttonStyle(.plain) } - .listStyle(.sidebar) + .paneListStyle() } } diff --git a/Features/Session/StudyView.swift b/Features/Session/StudyView.swift index fe1889c..3031c69 100644 --- a/Features/Session/StudyView.swift +++ b/Features/Session/StudyView.swift @@ -441,7 +441,7 @@ struct StudyToolsPane: View { .padding(.vertical, 3) .tag(tool.id) } - .listStyle(.sidebar) + .paneListStyle() .frame(width: 250) Divider() VStack(spacing: 0) { diff --git a/Packages/MarkdownRendering/Package.swift b/Packages/MarkdownRendering/Package.swift new file mode 100644 index 0000000..3544fe9 --- /dev/null +++ b/Packages/MarkdownRendering/Package.swift @@ -0,0 +1,31 @@ +// swift-tools-version: 6.1 + +import PackageDescription + +// MarkdownView compiles its LaTeX support, and links SwiftMath, only when its +// `LaTeX` trait is on. The trait is on by default, but an Xcode project does +// not pass package traits before Xcode 26.4, so the app depended on it +// directly got neither and showed every formula as raw `$$…$$` source. Asking +// for the trait here, in a package manifest, turns it on whatever the Xcode. +let package = Package( + name: "MarkdownRendering", + platforms: [.macOS(.v14)], + products: [ + .library(name: "MarkdownRendering", targets: ["MarkdownRendering"]), + ], + dependencies: [ + .package( + url: "https://github.com/LiYanan2004/MarkdownView", + from: "3.0.0", + traits: ["LaTeX"] + ), + ], + targets: [ + .target( + name: "MarkdownRendering", + dependencies: [ + .product(name: "MarkdownView", package: "MarkdownView"), + ] + ), + ] +) diff --git a/Packages/MarkdownRendering/Sources/MarkdownRendering/MarkdownRendering.swift b/Packages/MarkdownRendering/Sources/MarkdownRendering/MarkdownRendering.swift new file mode 100644 index 0000000..6759d5d --- /dev/null +++ b/Packages/MarkdownRendering/Sources/MarkdownRendering/MarkdownRendering.swift @@ -0,0 +1,3 @@ +// The app imports MarkdownView through this package, which is where its LaTeX +// trait is turned on. See Package.swift. +@_exported import MarkdownView diff --git a/project.yml b/project.yml index fee5eff..862c242 100644 --- a/project.yml +++ b/project.yml @@ -15,8 +15,8 @@ settings: SWIFT_STRICT_CONCURRENCY: complete SWIFT_TREAT_WARNINGS_AS_ERRORS: "NO" ENABLE_USER_SCRIPT_SANDBOXING: NO - MARKETING_VERSION: "0.16.3" - CURRENT_PROJECT_VERSION: "22" + MARKETING_VERSION: "0.16.5" + CURRENT_PROJECT_VERSION: "23" DEAD_CODE_STRIPPING: YES packages: @@ -27,10 +27,10 @@ packages: url: https://github.com/sindresorhus/KeyboardShortcuts from: 2.2.0 # Renders every piece of Markdown in the app: CommonMark/GFM, LaTeX through - # SwiftMath. See RichMarkdownView. - MarkdownView: - url: https://github.com/LiYanan2004/MarkdownView - from: 3.0.0 + # SwiftMath. See RichMarkdownView. MarkdownView comes in through this local + # package, which turns on its LaTeX trait; see its Package.swift. + MarkdownRendering: + path: Packages/MarkdownRendering targets: ClassNote: @@ -90,7 +90,7 @@ targets: dependencies: - package: GRDB - package: KeyboardShortcuts - - package: MarkdownView + - package: MarkdownRendering settings: base: PRODUCT_BUNDLE_IDENTIFIER: com.beluga.classnote