How to Perform Code Reviews for Palmier Pro: Complete Guidelines for Swift Video Editor Contributions

Code reviews for Palmier Pro require verifying that all UI constants originate from AppTheme, state management utilizes @Observable with @MainActor isolation, and code strictly targets macOS 26 on Apple Silicon while maintaining minimal commentary that explains intent rather than mechanics.

Palmier Pro is a native macOS video editor built with Swift 6.2, utilizing a SwiftUI + AppKit hybrid architecture with AVFoundation for media handling. When reviewing contributions to the palmier-io/palmier-pro repository, you must validate that new code respects the modular separation between app bootstrap, UI theming, observable view-models, and GPU-accelerated compositing kernels.

Core Architectural Layers and Review Focus

The codebase organizes functionality into distinct layers. Focus your review on these representative files to ensure architectural consistency.

App Bootstrap and Initialization

Verify initialization order in Sources/PalmierPro/App/main.swift. Confirm that logging, telemetry, fonts, and account services start before NSApplication launches, and ensure feature flags read from UserDefaults rather than hard-coded boolean values.

Design System Compliance in AppTheme.swift

All UI styling must route through Sources/PalmierPro/UI/AppTheme.swift. Check that new code references AppTheme.Background.base, AppTheme.Spacing.md, or AppTheme.FontSize.sm instead of numeric literals.

enum AppTheme {
    enum Background {
        static let base = NSColor(red: 10/255, green: 10/255, blue: 10/255, alpha: 1)
        // Additional theme definitions...
    }
}

When reviewing UI changes, search for hard-coded CGFloat values or NSColor initializers in the diff and reject them in favor of theme constants.

Observable State Management in EditorViewModel.swift

The Sources/PalmierPro/Editor/ViewModel/EditorViewModel.swift file declares the primary state container with @Observable and @MainActor:

@Observable @MainActor final class EditorViewModel {
    // Holds project state: timeline, mediaManifest, currentFrame, etc.
}

Verify that all mutable state properties are marked @Observable or stored within observable classes. Confirm that side effects remain confined to @MainActor and that async work uses proper cancellation mechanisms with weak self captures (see lines 88-94 in the file).

Media Handling and GPU Kernels

For files in Sources/PalmierPro/Audio/*.swift, check robust error handling for offline or corrupted media files. In Sources/PalmierPro/Compositing/Kernels/*.swift, verify that kernel parameters include clamping and safe default fallbacks to prevent rendering crashes.

SwiftUI and AppKit Integration Rules

When reviewing drag-and-drop functionality, ensure contributors do not stack SwiftUI .onDrop modifiers. Reference the implementation pattern in MediaPanelDropArea to verify compliance with the hybrid UI integration standards.

Essential Review Checklist for Palmier Pro

Apply these concrete verification steps to every pull request:

  • Design System Verification: Confirm all colors, spacing, and fonts reference AppTheme enums rather than magic numbers.
  • Observable Pattern Validation: Ensure new state properties support SwiftUI updates through @Observable conformance.
  • Main-Thread Guarantees: Verify @MainActor annotations or explicit DispatchQueue.main.async usage for UI updates.
  • Platform Guardrails: Reject any #if arch(x86_64) or legacy macOS conditionals; the app targets macOS 26 (Tahoe) on Apple Silicon exclusively.
  • Security Scanning: Check Sources/PalmierPro/Generation/GenerationBackend.swift and other areas for hard-coded API keys, tokens, or leaked secrets in MCP server implementations.
  • Error Handling: Confirm media errors propagate to the UI via MediaPanelToast rather than causing crashes.
  • Testing Requirements: Demand unit tests (swift test) for new logic in EditorViewModel and snapshot tests for UI components.
  • Documentation Standards: Reject comments that explain what code does; only accept commentary explaining why.

Practical Review Example: Evaluating a Trim Feature

Consider a PR adding a trim button to the media inspector. Here is how to apply the review guidelines.

Initial Implementation Issues

The contributor submits this diff:

Button(action: viewModel.trimCurrentClip) {
    Image(systemName: "scissors")
        .foregroundColor(AppTheme.Accent.primary)   // Uses theme correctly
}

extension EditorViewModel {
    func trimCurrentClip() {
        guard let clipId = selectedClipIds.first,
              let clip = clipFor(id: clipId) else { return }
        // naïve trimming logic – BUG: ignores linked audio
        clip.trimEndFrame = clip.trimStartFrame + 30
        notifyTimelineChanged()
    }
}

Identifying Violations

Review this code against the architectural requirements:

  1. Missing @MainActor: The trimCurrentClip method mutates UI state but lacks the @MainActor annotation.
  2. Architectural Bug: Trimming video clips requires synchronizing linked audio via linkGroupId, which the implementation ignores.
  3. Comment Style: The comment "naïve trimming logic – BUG" describes what the code does rather than explaining the architectural oversight regarding audio synchronization.
  4. Test Coverage: No unit tests exist in Tests/PalmierProTests/EditorViewModelTests.swift to verify trimming behavior.

Corrected Implementation

Request these changes:

extension EditorViewModel {
    @MainActor
    func trimCurrentClip() {
        guard let clipId = selectedClipIds.first,
              let clip = clipFor(id: clipId) else { return }
        
        // Trim visual portion; linked audio synchronizes automatically
        // via linkGroupId to maintain playback alignment.
        let newEnd = clip.trimStartFrame + 30
        clip.trimEndFrame = newEnd

        // Update linked audio when present
        if let linkId = clip.linkGroupId,
           let audioClip = timeline.tracks.flatMap(\.clips)
                                   .first(where: { $0.linkGroupId == linkId && $0.mediaType == .audio }) {
            audioClip.trimEndFrame = newEnd
        }

        notifyTimelineChanged()
    }
}

Additionally, require a unit test validating that audio clips update when their linked video counterparts are trimmed.

Summary

Performing effective code reviews for Palmier Pro requires systematic verification of:

  • Design system adherence through AppTheme constant usage in all UI code
  • Observable architecture compliance with @Observable and @MainActor annotations in EditorViewModel.swift
  • Platform constraints limited to macOS 26 Tahoe on Apple Silicon without legacy compatibility code
  • Integration patterns that avoid stacking SwiftUI modifiers like .onDrop in hybrid UI components
  • Documentation standards that favor self-explanatory code with "why" comments only when necessary

Frequently Asked Questions

What is the most common mistake in Palmier Pro pull requests?

The most frequent violation involves hard-coded UI constants instead of AppTheme references. Contributors often insert literal CGFloat values or NSColor initializers directly in SwiftUI views. Always verify that spacing, colors, fonts, and shadows come from Sources/PalmierPro/UI/AppTheme.swift to maintain visual consistency across the native macOS video editor interface.

Why must EditorViewModel use both @Observable and @MainActor?

The @Observable macro enables SwiftUI to track state changes efficiently for properties like timeline and currentFrame, while @MainActor guarantees that all UI mutations occur on the main thread. This pattern in Sources/PalmierPro/Editor/ViewModel/EditorViewModel.swift prevents race conditions and ensures thread-safe updates to the editor's single source of truth.

How should I handle security review for the MCP server implementation?

When reviewing Sources/PalmierPro/Generation/GenerationBackend.swift, strictly validate request authentication and verify that no API keys or secrets are hard-coded in the HTTP endpoint handlers. The MCP server exposes editor control to AI agents, making input validation and secret management critical to preventing unauthorized access to the video editing pipeline.

What testing is required before approving a Palmier Pro PR?

Require passing unit tests via swift test for any logic added to view-models or models, particularly in EditorViewModel.swift. For UI changes, demand snapshot tests or UI test coverage. Additionally, verify that swift build completes successfully on macOS 26 with Apple Silicon architecture, as the codebase uses Swift 6.2 features incompatible with older platforms.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →