Commit 1b1e3f6
authored
[fluent] Update to Compose 1.10 and Kotlin 2.3.0 (#150)
* Refactor: Migrate desktop target to jvm and update kotlin to 2.3.0
This commit migrates the desktop target to jvm, which involves renaming `desktopMain` to `jvmMain` in source sets and file paths.
The following changes were made:
- Renamed `desktopMain` to `jvmMain` in `gallery/build.gradle.kts` and updated relevant file paths.
- Removed platform-specific `defaultFontFamily` implementations for Android, Apple, desktop, and web, consolidating into a single common implementation that returns null.
- Updated Kotlin and KSP versions in `gradle/libs.versions.toml`.
- Commented out `kotlin.js.yarn=false` in `gradle.properties`.
* [gallery] feat(macos): Add support for macOS Tahoe style icons
This commit introduces support for macOS Tahoe style icons by:
- Adding the necessary icon assets (`Assets.car`, individual PNG layers, and `icon.json` configuration).
- Updating the `gallery/build.gradle.kts` to configure macOS packaging tasks to use the new `Assets.car` file. This includes:
- Injecting `CFBundleIconName` into the `Info.plist` if not present.
- Copying the `Assets.car` file to the app bundle's Resources directory.
- Applying this configuration to both native executable packaging and distributable creation tasks for macOS.
- Adding a `build_mac_icon.md` file with instructions and credits for compiling the `Assets.car` file.
* Refactor: commonize fluent them configuration
* Bump compose to 1.10
* Refactor: Migrate Compose dependencies to version catalog
This commit migrates Compose dependencies from the `compose` convention plugin to the `libs` version catalog.
- Adds `compose-foundation`, `compose-ui`, `compose-ui-util`, `compose-components-resources`, and `compose-ui-tooling-preview` to `gradle/libs.versions.toml`.
- Updates `build.gradle.kts` files in `fluent`, `fluent-icons-core`, `fluent-icons-extended`, `gallery`, and `source-generated` modules to use the new version catalog aliases.
- Removes an unused resource copying block for macOS packaging in `gallery/build.gradle.kts`.
* Refactor: Use SubcomposeLayout's `compose` instead of deprecated `measure`
This commit updates the `OverflowRow` composable to adapt to changes in the `SubcomposeLayout` API. The deprecated `measure` function has been replaced with the new `compose` function, which returns a list of measurables that are then measured individually.
This change affects the measurement logic within the start, end, start and end, and none overflow scenarios, ensuring compatibility with the updated API.
* Refactor: Modularize gallery app and update resource package name
This commit restructures the `gallery` module into a multi-module setup to improve separation of concerns and build efficiency. The core logic and UI are now in a `sharedApp` module, with platform-specific application modules (`androidApp`, `jvmApp`, `macosApp`, `webApp`).
Key changes include:
- **Created `sharedApp` module**: Extracted all common source sets (`commonMain`, `jvmMain`, `iosMain`, etc.) and resources from the old `gallery` module into `gallery/sharedApp`.
- **Created platform-specific app modules**:
- `gallery/androidApp` for the Android application.
- `gallery/jvmApp` for the JVM desktop application.
- `gallery/macosApp` for the macOS native application.
- `gallery/webApp` for the JS and WasmJs browser applications.
- **Updated build scripts**:
- Deleted the monolithic `gallery/build.gradle.kts`.
- Added new `build.gradle.kts` files for each new module (`sharedApp`, `androidApp`, `jvmApp`, `macosApp`, `webApp`), defining their specific dependencies and configurations.
- The `sharedApp` build script now contains the common multiplatform configuration, dependencies, and `buildkonfig` setup.
- Platform-specific app modules now depend on the `sharedApp` module.
- **Updated `settings.gradle.kts`**: Replaced the single `gallery` inclusion with includes for the new modules: `gallery:sharedApp`, `gallery:androidApp`, `gallery:jvmApp`, `gallery:webApp`, and `gallery:macosApp`.
- **Relocated files**: Moved all source code, resources, and configuration files from `gallery/` to their corresponding new modules (e.g., `gallery/src/androidMain` to `gallery/androidApp/src/main`).
- **Updated resource package name**:
- Changed the package name for Compose resources from `fluentdesign.gallery.generated.resources` to `io.github.composefluent.gallery.resources` in `sharedApp/build.gradle.kts`.
- Updated all resource imports across the codebase to reflect this change.
- **Removed test dependency**: Deleted the `androidx-test-junit` dependency from `gradle/libs.versions.toml` as the corresponding test file was removed.
* include missing files
* [fix] Use getBoundsInWindow for layer hit testing
The `isInBounds` method was removed in a recent Compose version. This commit updates the layer hit testing logic to use the `getBoundsInWindow` method instead, ensuring compatibility.
* feat(gallery): Refactor navigation to use Navigation 3
This commit refactors the gallery's navigation logic to use the `navigation3` library.
Key changes include:
* Integrating `navigation3-ui` and `navigationevent-compose`.
* Replacing `AnimatedContent` with `NavDisplay` for handling screen transitions.
* Making `ComponentItem` a serializable `NavKey` to support state restoration.
* Updating `ComponentNavigator` to manage the navigation backstack with `rememberSerializable`.
* Adding a custom `GallerySceneStrategy` to control how content is displayed.
* Upgrading the Android Gradle Plugin and adding the Kotlin serialization plugin.
* Refactor: Simplify `ComponentItem` serialization for navigation
This commit streamlines the serialization process for `ComponentItem` within the navigation logic.
- **Removed polymorphic serializer:** The custom `SerializersModule` that registered `ComponentItem` as a polymorphic subclass of `NavKey` has been removed from `ComponentNavigator`.
- **Simplified `rememberSerializable`:** The `rememberSerializable` call in `rememberComponentNavigator` now uses `SavedStateConfiguration.DEFAULT` instead of a custom configuration, as the polymorphic mapping is no longer needed.
- **Exposed `ItemSerializer`:** The custom `ComponentItem.ItemSerializer` is now public to allow `NavBackStackSerializer` to access it directly.
* Fix: Add workaround for macOS Compose resources in debug builds
This commit introduces a workaround for an issue where Compose resources are not correctly included in debug builds for macOS targets, as tracked in issue CMP-9568.
A new `Sync` task, `syncComposeResourceForDebug`, has been added to manually copy the aggregated Compose resources to the debug executable's output directory. This task is now a dependency for the `runDebugExecutable` and `linkDebugExecutable` tasks, ensuring resources are available when running or building the app in debug mode.
* downgrade kotlin to 2.2.20, see https://youtrack.jetbrains.com/projects/CMP/issues/CMP-9456
* Fix: Add workaround for TextField `decorationBox` crash
This commit introduces a temporary workaround to prevent a crash in `TextField` and `OutlinedTextField` composables, related to an issue with the `decorationBox` parameter.
- A `decorationBoxWorkaround` function has been created to wrap the `DecorationBox` implementation, addressing the crash described in JetBrains YouTrack issue CMP-9456.
- All instances of `TextField` and `OutlinedTextField` have been updated to use this workaround.
- The Kotlin version has been bumped from 2.2.20 to 2.3.0.
* [gallery] update web app html style
* [chore](ci) Refactor multiplatform build workflow
- Introduce a `module` variable in the build matrix to specify the Gradle module for each platform (e.g., `jvmApp`, `macosApp`, `webApp`).
- Update build and artifact upload steps to use the new `module` variable, making the paths dynamic.
- Add `deps/compose_1.10` branch to the push triggers for the snapshot build workflow.
- Adjust the `deploy-gh-pages` workflow to use the new `webApp` module path for building and deploying the WasmJs target.
* Fix: Update iOS build script path after modularization
This commit updates the Xcode project file for the `iosApp` to correct the path for the `embedAndSignAppleFrameworkForXcode` Gradle task.
The path was changed from `:gallery:embedAndSignAppleFrameworkForXcode` to `:gallery:sharedApp:embedAndSignAppleFrameworkForXcode` to reflect the recent modularization of the gallery app.
* feat: Set android framework name and update dependencies
Sets the base name for the android framework to "gallery.shared".
- Updates Android dependencies by adding `compose.foundation` and moving the `coreLibraryDesugaring` dependency.
- Simplifies `MainActivity` by removing the component navigator and back handler logic.
* Build: Add workaround for KSP execution in common-only modules
This commit adds a workaround to the build scripts for the `fluent`, `fluent-icons-core`, and `fluent-icons-extended` modules to address an issue with KSP task dependencies.
When KSP is configured only for the `commonMain` source set, other compilation tasks do not automatically depend on the `kspCommonMainKotlinMetadata` task. This change explicitly adds this dependency to all Kotlin compilation tasks, ensuring that KSP runs before them.
* ci: Add macosArm64 and macosX64 to build matrix
This commit updates the `multiplatform_snapshot_build.yml` workflow to:
- Add `macosArm64` and `macosX64` to the build matrix.
- Set `fail-fast` to `false` for the build strategy.
- Configure a unique `GRADLE_USER_HOME` for each matrix job type.
* ci: Remove test branch
* Fix: Use unique content keys for navigation to prevent recomposition issues
This commit changes the `contentKey` for `NavEntry` from a static string (`"${it.group}/${it.name}"`) to a unique identifier generated by `Uuid.generateV4().toString()`.
This ensures that each navigation entry has a unique key, preventing incorrect recomposition behavior when navigating between items, which previously caused content to not update correctly. The `ExperimentalUuidApi` annotation has been added to support this change.1 parent c63ea50 commit 1b1e3f6
183 files changed
Lines changed: 946 additions & 605 deletions
File tree
- .github/workflows
- build-plugin/src/main/java/io/github/composefluent/plugin/build
- mac
- fluent-icons-core
- fluent-icons-extended
- fluent
- src
- androidMain/kotlin/io/github/composefluent
- appleMain/kotlin/io/github/composefluent
- commonMain/kotlin/io/github/composefluent
- component
- layout/overflow
- desktopMain/kotlin/io/github/composefluent
- jvmMain
- kotlin/io/github/composefluent
- component
- resources
- webMain/kotlin/io/github/composefluent
- gallery
- androidApp
- src/main
- kotlin/io/github/composefluent/gallery
- res
- drawable
- mipmap-anydpi-v26
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- values
- xml
- icons
- icon.icon
- Assets
- iosApp/iosApp.xcodeproj
- jvmApp
- src/main/kotlin/io/github/composefluent/gallery
- macosApp
- src/macosMain/kotlin/io/github/composefluent/gallery
- src
- androidInstrumentedTest/kotlin/io/github/composefluent/gallery
- commonMain/kotlin/io/github/composefluent/gallery/component
- wasmJsMain/resources
- webApp
- src/webMain
- kotlin
- resources
- gradle
- wrapper
- source-generated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| 57 | + | |
| 58 | + | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| 68 | + | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| 78 | + | |
60 | 79 | | |
61 | 80 | | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
65 | 84 | | |
| 85 | + | |
| 86 | + | |
66 | 87 | | |
67 | 88 | | |
68 | 89 | | |
| |||
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
108 | | - | |
| 129 | + | |
109 | 130 | | |
110 | 131 | | |
111 | 132 | | |
| |||
118 | 139 | | |
119 | 140 | | |
120 | 141 | | |
121 | | - | |
| 142 | + | |
122 | 143 | | |
123 | 144 | | |
124 | 145 | | |
125 | 146 | | |
126 | 147 | | |
127 | | - | |
| 148 | + | |
128 | 149 | | |
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
133 | 154 | | |
134 | | - | |
| 155 | + | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
140 | | - | |
| 161 | + | |
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
145 | 166 | | |
146 | | - | |
| 167 | + | |
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
| |||
155 | 176 | | |
156 | 177 | | |
157 | 178 | | |
158 | | - | |
| 179 | + | |
159 | 180 | | |
160 | 181 | | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
165 | | - | |
| 186 | + | |
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
169 | 190 | | |
170 | 191 | | |
171 | | - | |
| 192 | + | |
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
176 | 197 | | |
177 | 198 | | |
178 | | - | |
| 199 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 45 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
11 | | - | |
| 16 | + | |
12 | 17 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 37 | + | |
| 38 | + | |
45 | 39 | | |
46 | 40 | | |
47 | | - | |
| 41 | + | |
48 | 42 | | |
| 43 | + | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 52 | + | |
| 53 | + | |
63 | 54 | | |
64 | 55 | | |
| 56 | + | |
65 | 57 | | |
66 | 58 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 59 | + | |
| 60 | + | |
88 | 61 | | |
| 62 | + | |
89 | 63 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
93 | 79 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
97 | 86 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 87 | + | |
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments