🐛 fix: fix binary compatibility issues caused by #418 - #421
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped to ABI restoration via hidden shims and compiler-supported version overloading, with no apparent behavioral risk to current call paths.
Pull request overview
This PR addresses binary compatibility regressions introduced in #418 by reintroducing compatible JVM signatures and stubs in the Paper and Minestom inventory framework APIs, ensuring older compiled plugins can still load and link against the updated artifacts.
Changes:
- Added Kotlin version-overloading metadata (
@OptIn(ExperimentalVersionOverloading::class)+@IntroducedAt) to generate backward-compatible constructor/copy overloads for view settings data classes. - Restored removed/changed API surface via hidden binary-compatibility shims (a hidden constructor on
ViewContainerTitleComponentand a hiddenViewContainerBackHintComponentstub). - Bumped patch version from
3.43.0to3.43.1.
File summaries
| File | Description |
|---|---|
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/inventory/framework/view/settings/SimpleViewSettings.kt | Enables version overloading and marks newer parameters as introduced to preserve older JVM constructor signatures. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/inventory/framework/view/settings/PaginatedViewSettings.kt | Same compatibility treatment for paginated settings, including pagination-specific fields. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/inventory/framework/view/container/component/components/ViewContainerTitleComponent.kt | Adds a hidden constructor matching an older JVM signature for binary compatibility. |
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/inventory/framework/view/container/component/components/ViewContainerBackHintComponent.kt | Reintroduces the removed component as a hidden no-op stub to prevent NoClassDefFoundError. |
| surf-api-paper/surf-api-paper/api/surf-api-paper.api | Updates API dump to reflect added compatibility stubs/overloads. |
| surf-api-minestom/src/main/kotlin/dev/slne/surf/api/minestom/inventory/framework/view/settings/SimpleViewSettings.kt | Mirrors Paper’s version-overloading changes for Minestom simple settings. |
| surf-api-minestom/src/main/kotlin/dev/slne/surf/api/minestom/inventory/framework/view/settings/PaginatedViewSettings.kt | Mirrors Paper’s version-overloading changes for Minestom paginated settings. |
| surf-api-minestom/src/main/kotlin/dev/slne/surf/api/minestom/inventory/framework/view/container/component/components/ViewContainerTitleComponent.kt | Mirrors Paper’s hidden binary-compat constructor for Minestom. |
| surf-api-minestom/src/main/kotlin/dev/slne/surf/api/minestom/inventory/framework/view/container/component/components/ViewContainerBackHintComponent.kt | Mirrors Paper’s hidden no-op back-hint stub for Minestom. |
| surf-api-minestom/api/surf-api-minestom.api | Updates API dump to reflect added compatibility stubs/overloads. |
| gradle.properties | Increments project version to 3.43.1. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d9b00309a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @IntroducedAt("3.43.0") override val headerTextColor: TextColor = SurfViewSettingsDefaults.DEFAULT_HEADER_TEXT_COLOR, | ||
| @IntroducedAt("3.43.0") override val headerFontMetrics: ViewFontMetrics = SurfViewSettingsDefaults.DEFAULT_HEADER_FONT_METRICS, | ||
| @IntroducedAt("3.43.0") override val rowFontMetrics: ViewFontMetrics = SurfViewSettingsDefaults.DEFAULT_ROW_FONT_METRICS, | ||
| @IntroducedAt("3.43.0") override val headerGeometry: ViewHeaderGeometry = SurfViewSettingsDefaults.DEFAULT_HEADER_GEOMETRY, | ||
| @IntroducedAt("3.43.0") override val backgroundGlyph: Boolean = SurfViewSettingsDefaults.DEFAULT_BACKGROUND_GLYPH, |
There was a problem hiding this comment.
Preserve the legacy data-class component methods
For plugins compiled against 3.42.x that destructure SimpleViewSettings, these inserted primary-constructor properties shift the generated componentN() methods. The checked API confirms that version overloading restores constructors and copy, but not the old components: for example, the former component3(): Boolean is now component3(): TextColor, while the still-linkable component7(): Boolean now returns backgroundGlyph instead of navigateBackOnOutsideClick. Such binaries therefore either throw NoSuchMethodError or silently read the wrong value. PaginatedViewSettings and both Paper mirrors have the same problem, so the legacy component descriptors/ordering also need to be preserved.
Useful? React with 👍 / 👎.
| ) : this( | ||
| title = text(title), | ||
| font = font, | ||
| textAlignment = textAlignment, | ||
| metrics = ViewFontMetrics( |
There was a problem hiding this comment.
Retain the legacy title constructor's rendering defaults
When a plugin compiled against the old five-argument constructor uses LEFT or RIGHT alignment, this delegation silently adopts the new default geometry and color rather than the constructor's former behavior. Before #418 it aligned inside leftShift=31, padding=2, containerWidth=100 and rendered white; this call instead uses ViewHeaderGeometry.DEFAULT (-8, 0, 176) and the 0x404040 default color, moving left/right-aligned titles by roughly 40 pixels and recoloring them. Pass the legacy geometry and color explicitly in this compatibility constructor; the Paper mirror has the same issue.
Useful? React with 👍 / 👎.
No description provided.