Skip to content

Migrate Foliary desktop app to Nucleus 2 #189

Description

@MessiasLima

Description

Upgrade the desktop app from Nucleus 1.x to Nucleus 2 so Foliary uses the current plugin ID, Maven coordinates, package namespace, and application bootstrap model. The current desktop entry point still relies on application {} plus manual deep-link and single-instance handling; Nucleus 2 replaces that with nucleusApplication(args), automatic bootstrap, and renamed dev.nucleusframework APIs. This migration should preserve current desktop behavior while reducing custom startup plumbing and aligning follow-up desktop work, including AOT cache setup, with the supported API surface.

Scope and constraints

  • Migrate the desktop module from Nucleus 1.15.6 / io.github.kdroidfilter.* to Nucleus 2 / dev.nucleusframework.*
  • Update the Gradle plugin ID, dependency coordinates, DSL imports, and Kotlin imports touched by the migration
  • Replace the current desktop startup path in desktop/src/main/kotlin/Main.kt with nucleusApplication(args) and move deep-link handling to the Nucleus 2 API
  • Remove or adapt manual single-instance and restore logic in ManageSingleInstance.kt and DecoratedWindow.kt where Nucleus 2 now provides the behavior automatically
  • Preserve the current Material 3 decorated window, tray integration, deep-link dispatch, and packaging targets
  • Do not expand scope into unrelated desktop UX changes, auto-update work, or non-desktop platform changes
  • If the selected Nucleus 2 artifacts require extra repository or toolchain changes, include only the minimal build changes needed for this migration

References

Scope

In scope: version/catalog updates, package and import renames, desktop bootstrap migration, removal of 1.x-only startup plumbing, and validation that desktop runtime behavior still works under Nucleus 2.

Out of scope: redesigning window or tray UX, enabling new optional Nucleus features, changing packaging targets, or making Android/iOS-specific changes unrelated to shared import updates.

Acceptance criteria

  • Foliary uses Nucleus 2 plugin and dependency coordinates instead of the current io.github.kdroidfilter 1.x setup, and all migrated imports compile under the dev.nucleusframework namespace
  • The desktop app starts through nucleusApplication(args) and uses the Nucleus 2 deep-link API instead of manual DeepLinkHandler.register(...) bootstrap in Main.kt
  • Manual 1.x-only single-instance / restore plumbing is removed or reduced to only behavior still required by Foliary, while second-launch restore and deep-link delivery continue to work
  • Existing desktop packaging configuration still resolves and remains compatible with the migration
  • Any additional repository or JVM toolchain requirements discovered during the migration are applied only where needed and documented in the implementation
  • Follow-up AOT cache work is aligned with the Nucleus 2 bootstrap model so issue Enable AOT cache for desktop application startup #102 no longer depends on 1.x-specific startup assumptions

Additional information

Current files likely touched by this migration include:

  • gradle/libs.versions.toml
  • desktop/build.gradle.kts
  • desktop/src/main/kotlin/Main.kt
  • desktop/src/main/kotlin/ManageSingleInstance.kt
  • desktop/src/main/kotlin/DeeplinkHandler.kt
  • desktop/src/main/kotlin/DecoratedWindow.kt
  • foliary/src/jvmMain/kotlin/dev/appoutlet/foliary/feature/main/MainScreen.jvm.kt

The current codebase does not appear to use Jewel-specific window components, so JDK 25 and the IntelliJ snapshots repository should be treated as conditional migration requirements rather than assumed baseline changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions