Skip to content

Commit 2038a3f

Browse files
committed
docs: add ecosystem section with FileKit and spell-check guides
1 parent 7fd05b7 commit 2038a3f

3 files changed

Lines changed: 82 additions & 0 deletions

File tree

docs/ecosystem/file-dialog.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# File Dialog
2+
3+
Nucleus does not ship a file/folder picker module. The Compose Multiplatform ecosystem already has an excellent native solution.
4+
5+
## Recommended: FileKit
6+
7+
[**FileKit**](https://github.com/vinceglb/FileKit) by [@vinceglb](https://github.com/vinceglb) — native file pickers and file operations for Compose Multiplatform, including JVM Desktop.
8+
9+
```kotlin
10+
dependencies {
11+
implementation("io.github.vinceglb:filekit-compose:<version>")
12+
}
13+
```
14+
15+
```kotlin
16+
val launcher = rememberFilePickerLauncher(
17+
type = PickerType.File(extensions = listOf("png", "jpg")),
18+
title = "Pick an image",
19+
) { file ->
20+
// file: PlatformFile?
21+
}
22+
23+
Button(onClick = { launcher.launch() }) {
24+
Text("Pick image")
25+
}
26+
```
27+
28+
### What it covers
29+
30+
- Native open / save / folder pickers on macOS (`NSOpenPanel` / `NSSavePanel`), Windows (`IFileOpenDialog` / `IFileSaveDialog`), and Linux (xdg-desktop-portal `FileChooser` with fallback to GTK / zenity)
31+
- File type filters with descriptions
32+
- Single-file, multi-file, folder, and save modes
33+
- Compose-friendly API with `rememberFilePickerLauncher`
34+
- Cross-platform `PlatformFile` abstraction with read / write / metadata helpers
35+
36+
### Why Nucleus doesn't ship this
37+
38+
FileKit already covers the full surface natively, has active maintenance, and integrates cleanly with Compose state. Reimplementing it inside Nucleus would duplicate effort with no benefit.
39+
40+
### GraalVM native image — zero config
41+
42+
The Nucleus Gradle plugin ships **preloaded reachability metadata for FileKit** as part of its [library metadata bundle](../graalvm/automatic-metadata.md). The metadata is conditionally included only when `io.github.vinceglb.filekit` is present on your runtime classpath, and covers:
43+
44+
- macOS Foundation proxy + callback types (`FoundationLibrary`, `ID`, runnable callbacks)
45+
- Windows JNA COM bindings (`FileDialog`, `FileOpenDialog`, `FileSaveDialog`, `ShellItem`, `Shell32`, `COMDLG_FILTERSPEC`, `PROPERTYKEY`, …)
46+
- XDG desktop-portal D-Bus proxy (`FileChooserDbusInterface`) for Linux
47+
48+
So if you package with the Nucleus plugin and target `native-image`, FileKit works out of the box — no manual entries in `reachability-metadata.json`, no tracing-agent run required.

docs/ecosystem/spell-check.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Spell Check
2+
3+
Nucleus does not ship a spell-checking module. The ecosystem already has a native cross-platform solution for Kotlin.
4+
5+
## Recommended: PlatformSpellCheckerKt
6+
7+
[**PlatformSpellCheckerKt**](https://github.com/Wavesonics/PlatformSpellCheckerKt) by [@Wavesonics](https://github.com/Wavesonics) — a Kotlin Multiplatform wrapper over the native OS spell-check engines.
8+
9+
```kotlin
10+
dependencies {
11+
implementation("com.darkrockstudios:platform-spellchecker:<version>")
12+
}
13+
```
14+
15+
```kotlin
16+
val checker = PlatformSpellChecker()
17+
18+
val misspellings = checker.check("This is a sentance with errors")
19+
// → [Misspelling(word = "sentance", suggestions = ["sentence", ...])]
20+
```
21+
22+
### What it covers
23+
24+
- macOS — `NSSpellChecker` (the same engine as TextEdit and the system text fields)
25+
- Windows — Windows Spell Check API (`ISpellChecker`, available since Windows 8)
26+
- Linux — `enchant` / `hunspell`
27+
- Suggestions, language detection, and custom dictionary support
28+
29+
### Why Nucleus doesn't ship this
30+
31+
Spell checking is a deep, locale-heavy domain that benefits from a focused, well-tested library. PlatformSpellCheckerKt already wraps the right native engines and has no JVM-specific limitations that Nucleus would need to work around.

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ nav:
117117
- Native HTTP: runtime/native-http.md
118118
- Comparison:
119119
- Packaging: comparison/packaging.md
120+
- Ecosystem:
121+
- File Dialog: ecosystem/file-dialog.md
122+
- Spell Check: ecosystem/spell-check.md
120123
- Migration: migration.md
121124
- Changelog: changelog.md
122125
- LLM Documentation: llm.md

0 commit comments

Comments
 (0)