Sync markdown guides and KDoc with the config overhaul's collateral changes - #5
Conversation
…hanges The config-system overhaul (71e2697) touched the GUI composable, networking, and serialization layers it depends on but only updated config.md/index.md, leaving gui.md, networking.md, and serialization.md describing stale APIs. This closes that gap: - config.md: fixes a stale claim that config screens still register through Mod Menu/Catalogue-specific glue - that bridge (ArchieModMenu/ArchieCatalogue/ AConfigPlatform) was removed; screens now register via Architectury's Mod.registerConfigurationScreen, and Catalogue has no working path anymore. - gui.md: fixes a TabContainer usage example that no longer compiles against the current signature, fixes a Text() example passing the wrong color type, and documents the new GuiGraphics.pose/scissor/invoke rendering helpers. - networking.md: documents the reified serverbound<T>/clientbound<T> overloads, registration-time validation rules, and cross-references config's use of a NetworkChannel for server-config sync. - serialization.md: scopes the page against config.md's separate IConfigSerializer layer to avoid overlap/confusion. Also fixes/adds KDoc across ConfigSpec, IConfigSerializer, NetworkChannel, GuiGraphics, KColor, and BuiltinSerializers where it had gone stale or was missing entirely - including a ConfigSpec.init() doc comment that still described a registration flow and AConfigPlatform link that no longer exist. events.md, registries.md, resource-packs.md, and transfer.md were checked against current source and found already accurate; no changes needed there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two areas had no dedicated guide at all: - datagen.md: the ADataGenerator DSL (client/common provider scopes), blockstate/model generation, languages, recipes + custom ingredients, tags, and the cross-loader condition system used to gate datapack entries. - gametest.md: both GameTest layers - vanilla server-side GameTestHelper tests registered through AGameTestEventObject, and the from-scratch client GameTest DSL (ClientGameTestContext, node lookup, TestNodeScope click/hover/type, UINode.renderState assertions, lightweight probe screens vs. world-backed tests, screenshot-comparison infra and why render-state assertion is preferred over it in practice). Both are wired into Archie/mkdocs.yml's nav and index.md's feature table (GameTest didn't have a row there either; Data Gen already did). Replaced gui.md's "Automated GUI Testing" section - which showed a @ClientGameTest example that didn't match reality, since GuiClientHarnessTests.kt is actually a plain JUnit test file with no client GameTest involved at all - with a pointer to gametest.md's real coverage of the same ground. Also adds missing KDoc to several previously-undocumented central types in AClientGameTestHarness.kt (TestInput, TestWorldBuilder, TestSingleplayerContext, TestDedicatedServerContext, TestServerConnection, TestClientWorldContext, TestServerContext, AClientGameTestSummary, AClientGameTestHarness). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates Archie’s documentation set and KDoc to match collateral API changes that landed during the config-system overhaul, removing stale references and aligning examples with current signatures/usage across GUI, networking, and serialization. It also expands the docs nav and introduces dedicated guides for GameTest and datagen.
Changes:
- Refreshes markdown guides (
config.md,gui.md,networking.md,serialization.md) to reflect the current post-overhaul APIs and behaviors. - Adds new documentation pages for GameTest and Data Generation, and wires them into
mkdocs.ymlnavigation. - Updates/extends KDoc for several affected APIs (config serializer layer, networking channel helpers, GUI rendering helpers, GameTest harness types).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Archie/mkdocs.yml | Adds gametest.md and datagen.md to the MkDocs nav. |
| Archie/docs/serialization.md | Clarifies scope vs. config persistence (IConfigSerializer) to reduce overlap/confusion. |
| Archie/docs/networking.md | Updates handler registration examples to reified overloads; documents validation behavior and config sync usage. |
| Archie/docs/index.md | Adds GameTest feature row to the project overview table. |
| Archie/docs/gui.md | Fixes stale examples (TabContainer/Text color) and documents GuiGraphics rendering helpers; points to the new GameTest guide. |
| Archie/docs/gametest.md | New comprehensive guide for server GameTests and the client GameTest DSL/harness. |
| Archie/docs/datagen.md | New guide describing datagen runs, event wiring, provider DSL, and conditions/tags/recipes patterns. |
| Archie/docs/config.md | Updates config screen registration flow to Architectury’s Mod.registerConfigurationScreen; removes Mod Menu/Catalogue glue references. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/serialization/serializers/BuiltinSerializers.kt | KDoc clarification about side-conditional registration. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/networking/NetworkChannel.kt | Adds reified serverbound<T>/clientbound<T> KDoc; documents internal config sync wiring helpers. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/gui/util/KColor.kt | Adds KDoc for toTextColor() clarifying alpha limitations. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/gui/util/extension/GuiGraphics.kt | Adds KDoc for pose, scissor, and invoke rendering helpers. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/gui/composables/basic/Text.kt | Fixes KDoc example to pass KColor (not argb). |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/gametest/AClientGameTestHarness.kt | Adds missing/stale KDoc across client GameTest harness interfaces/types. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/config/IConfigSerializer.kt | Clarifies KDoc around configFolder resolution and server serverconfig/ behavior. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/config/ConfigSpec.kt | Updates stale init() KDoc to match current registration/loading responsibilities. |
| Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/Archie.kt | Updates initClient() KDoc to match the new config screen registration entrypoint. |
Suppressed comments (1)
Archie/common/src/main/kotlin/net/kernelpanicsoft/archie/gui/util/extension/GuiGraphics.kt:139
GuiGraphics.scissor/itsIntRectoverload don't disable scissoring if the block throws. That can leave scissor state enabled and clip unrelated rendering. WrappingdisableScissor()in afinallymatches the helper's intended semantics (and the docs ingui.md).
fun <T> GuiGraphics.scissor(minX: Int, minY: Int, maxX: Int, maxY: Int, block: () -> T): T
{
enableScissor(minX, minY, maxX, maxY)
val ret = block()
disableScissor()
return ret
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -120,6 +126,11 @@ fun <T> GuiGraphics.pose(block: PoseStack.() -> T): T | |||
| return ret | |||
| /** | ||
| * Registers [spec] as a server-bound "save my changes" packet: when the server receives one, | ||
| * it is decoded with [spec]'s own [kotlinx.serialization.KSerializer] (via | ||
| * [net.kernelpanicsoft.archie.config.ConfigSpec.serializer]) rather than the reflective one | ||
| * used for ordinary packet classes, since a `ConfigSpec` singleton isn't itself | ||
| * `@Serializable`. The permission check, persistence, and broadcast/rejection of the | ||
| * resulting value happen in `decodeDispatchData`, not in the handler registered here (which | ||
| * just calls [net.kernelpanicsoft.archie.config.ConfigSpec.save] again for symmetry with | ||
| * [configClientbound]). No-op if [spec] is already registered. | ||
| * | ||
| * Internal: used by [net.kernelpanicsoft.archie.config.ConfigSpec.init] to wire up | ||
| * server/client config sync. Not part of the public packet API. | ||
| */ |
| * Text( | ||
| * text = Component.literal("Hello, Archie!"), | ||
| * fontScale = 1.5f, | ||
| * color = KColor.YELLOW.argb, | ||
| * color = KColor.YELLOW, | ||
| * ) |
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Summary
The config-system overhaul (71e2697) touched the GUI composable, networking, and serialization layers it depends on, but only
config.md/index.mdwere updated at the time —gui.md,networking.md, andserialization.mdwere left describing stale APIs. This PR closes that gap.ArchieModMenu/ArchieCatalogue/AConfigPlatform) was removed in an earlier commit. Screens now register via Architectury'sMod.registerConfigurationScreen; Catalogue no longer has a working integration path.TabContainerusage example that no longer compiles against the current signature, fixes aText()example passing the wrong color type, and documents the newGuiGraphics.pose/scissor/invokerendering helpers.serverbound<T>/clientbound<T>overloads, registration-time validation rules, and cross-references config's use of aNetworkChannelfor server-config sync.IConfigSerializerlayer to avoid overlap/confusion.Also fixes/adds KDoc across
ConfigSpec,IConfigSerializer,NetworkChannel,GuiGraphics,KColor, andBuiltinSerializerswhere it had gone stale or was missing entirely — including aConfigSpec.init()doc comment that still described a registration flow and an[AConfigPlatform]link that no longer exist.events.md,registries.md,resource-packs.md, andtransfer.mdwere checked against current source and found already accurate; no changes needed there.Test plan
./gradlew :Archie:common:compileKotlin -q— clean, confirms KDoc edits are syntactically sound🤖 Generated with Claude Code