docs: §4.3 API & docs example audit - #196
Merged
Merged
Conversation
Pre-1.0 hardening checklist item §4.3. Walked the public surface against every tutorial / guide / cookbook snippet and corrected eight discrepancies that would have surprised a reader copying code into their own app: - app-layer.md: Cmd.asyncResult signature (onSuccess / onError, not a single toCmd); Sub.TerminalResize signature ((millis, mkMsg, ctx), not (msg, sink)); Cmd.RequestAttention / Cmd.Notify added to the enum block + table. - widgets.md: MultiLineInput.handleKey is not curried; dropped the bogus (_ => None) trailing parameter list. - terminal-layer.md: Capabilities now lists notifications: NotificationKind. - intro/architecture.md: Cmd.FCmd type params are [A, Msg], not [Future[A], Msg]; pointed at Cmd.asyncResult for fallible work. - tut/01-hello-world.md: full-source RootNode was missing the required input arg. - tut/03-async.md: Cmd.FCmd table mislabelled the 2nd param as onComplete; vague \"Cookbook recipe\" footnote replaced with a concrete Cmd.asyncResult pointer. - cookbook/file-picker.md: Cmd.FCmd(future, Msg.LoadDone.apply) would not typecheck — switched to Cmd.asyncResult. - cookbook/full-screen-layout.md: removed an orphaned Layout.column(...) block that came before the actual layout. Also populated reference/migration.md with the explicit \"no migration required for 0.2.x → 1.0\" statement and a catalogue of additive changes since 0.2.0 (error overlay, asyncResult, notifications, Grid/Border/toBudgetedRootNode, mouse-wheel scrollback). Marked §4.3 as ☑ landed in the roadmap with a 2026-04-30 decision entry. mdbook build (with linkcheck) is clean.
rorygraves
force-pushed
the
docs/api-docs-audit-43
branch
from
April 30, 2026 12:39
591a3c0 to
8902924
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pre-1.0 hardening item §4.3 — walk the public surface, every tutorial / guide / cookbook snippet, and remove copy-into-your-app surprises.
Doc fixes
docs/guide/app-layer.mdCmd.asyncResultsignature wrong (toCmd: A => Cmd[Msg]);Sub.TerminalResizesignature wrong ((msg, sink)); enum block missingRequestAttention/Notify(task, onSuccess, onError, onEnqueue); corrected to(millis, mkMsg, ctx); added new cases to enum + tabledocs/guide/widgets.mdMultiLineInput.handleKey[Msg](state, key)(_ => None)— that variant doesn't take a curried second arg list(_ => None)docs/guide/terminal-layer.mdCapabilitiesdefinition missingnotifications: NotificationKindfielddocs/intro/architecture.mdCmd.FCmd[Future[A], Msg]— wrong type paramsCmd.FCmd[A, Msg]; pointed atCmd.asyncResultdocs/tut/01-hello-world.mdRootNode(...)missing requiredinputarg — wouldn't compileinput = Nonedocs/tut/03-async.mdCmd.FCmdtable mislabeled 2nd param asonComplete; vague "Cookbook has a recipe" footnotetoCmd; replaced footnote with concreteCmd.asyncResultpointerdocs/cookbook/file-picker.mdCmd.FCmd(Future{…}, Msg.LoadDone.apply)—A => Msg≠A => Cmd[M], wouldn't typecheckCmd.asyncResult(future, Msg.LoadDone.apply, Msg.LoadFailed.apply)docs/cookbook/full-screen-layout.mdLayout.column(gap = 0)(header, …)builder block before the real layoutMigration notes
docs/reference/migration.mdis no longer an empty placeholder. Now states explicitly that 1.0 is source-compatible with 0.2.x / 0.3.x and catalogues the additive changes since 0.2.0 (error overlay,asyncResult, notifications,Grid/Border/toBudgetedRootNode, mouse-wheel scrollback) so apps can opt in. MiMa enforcement remains scheduled for the 1.0.x / 1.1 cycle as decided 2026-04-30.Roadmap
Marked §4.3 as ☑ landed and added a 2026-04-30 decision entry under §8.
SPI surface
TuiRenderer,CmdConsumer,CmdBus,EventSink,EventSourcealready carry@note SPIin source Scaladoc.TerminalBackendis consumed by the runtime, rarely implemented by apps; an SPI annotation there is a Scaladoc tweak that fits §4.8 polish rather than this audit. ANSI raw escape constants inAnsiRendereraren't surfaced in user docs.Test plan
mdbook build(withlinkcheckbackend) — clean, no warnings, no broken links