Skip to content

v6.2.0

Choose a tag to compare

@Meet-Miyani Meet-Miyani released this 23 Oct 04:14
· 4 commits to main since this release
45e00d2

v6.2.0 teaches the kit to plan screens for every window an app runs in: phones, tablets, foldables, desktop and web. Layouts follow the window size class, never the device. It also ships the guard-script fixes prepared as v6.1.2, which was never published. It replaces v6.1.1 as Latest.

What's new

Layouts follow the window size class, never the device (#28)

  • compose-ui rule 12 (non-negotiable). Each destination keeps one <Dest>Screen:

    • The composition root computes the window size class once.
    • The Route maps it to a <Dest>Layout value.
    • The Screen branches once on that value.

    Variants are named after the smallest class they serve (NotesCompactLayout, NotesExpandedLayout) and share their leaves. Device-named screens (NotesTabletScreen) and isTablet checks are declined even when a request names them: an iPad in Split View, a folded phone and a narrow desktop window are all narrow windows.

  • compose-ui rule 10 reworded: a pane gets a width, not a size class. A destination that can show inside a list-detail pane picks its arrangement from the width it is given, never from the window size class.

  • New reference compose-ui/references/adaptive-layouts.md. It holds:

    • a Choose tree: reflow, layout variants or multi-pane;
    • reflow caps the content width, cap before fill (Modifier.widthIn(max = …).fillMaxWidth());
    • breakpoints come from the library's WindowSizeClass constants;
    • list state sits above the layout branch, so a resize keeps the scroll position;
    • gotchas: use the V2 adaptive-info function, and never the deprecated width-class enum.
  • Router. The compose entry tree sends tablet, foldable and window-size tasks to that reference.

Targets recorded when a project starts (#29)

  • compose-project bootstrap (default). ## Project decisions records the targets the app ships and the window size classes every screen works in. Compact through Expanded is the default. Example: Targets: Android phones and tablets, iPhone and iPad, desktop. Every screen works in Compact through Expanded windows.
  • Choose tree. Only the request text or a provided design adds a wider arrangement. Recorded targets make the width cap necessary; they never add a layout on their own.

Guard-script fixes (#26, prepared as v6.1.2)

  • check-file-level-state.sh (arch rule 13) now reports, in every main source set:

    • a top-level var with any annotations or modifiers before it (lateinit, @Volatile, visibility, actual);
    • a top-level val created as a mutable holder: MutableStateFlow, MutableSharedFlow, mutableStateOf and its variants, mutable collections, Channel;
    • either form as a direct member of an object or companion object.

    Before, it checked only navigation/ and presentation/. Test source sets, strings and comments are skipped.

  • check-contract-shape.sh skips annotations on the declaration's own line. So @Immutable data class …UiState passes, and a one-line @Serializable enum class counts as a fourth declaration.

How it was tested

  • #28 and #29 were built test-first on new dev-set scenarios (UI-05, UI-06, FEAT-07, FEAT-07b). Each used routed agent runs on Claude Haiku (5 per arm) and Sonnet (1 per arm), comparing the old kit with the new one.
  • Asked for NotesPhoneScreen/NotesTabletScreen with an isTablet check, Haiku declined and built one Screen with size-class variants in 0 of 5 runs before and 5 of 5 after. Sonnet also moved to computing the class once at the root with the current API.
  • A detail inside a list-detail pane picked its arrangement from the pane's own width in 3 of 5 Haiku runs before and 5 of 5 after.
  • With no targets in context, no run (Haiku 0 of 5, Sonnet 0 of 1) capped a new editor's width on wide windows. With targets recorded and the final wording, every run passed (Haiku 5 of 5, Sonnet 1 of 1).
  • Evidence: the #28 description and evals-v2/results/2026-10-22-compose-feature.md.
  • Not re-run: the v6 held-out benchmark, and the new rules were not tested on DeepSeek, Gemini or GPT. The v6.1 benchmark results describe v6.1.0's guidance.

Behaviour changes

  • Layout checks in new code and reviews.

    • New code and reviews treat device-named screens (*TabletScreen, *PhoneScreen) and isTablet or platform checks used for layout as findings.
    • A wide arrangement is a size-class variant inside the one Screen.
    • A screen with no wide design gets one layout with a capped width.
  • compose-ui/references/adaptive-and-insets.md is gone. It is split into adaptive-layouts.md and edge-to-edge-and-insets.md; the inset and IME rules are unchanged but renumbered. Update any project notes or links that named the old file or its rule numbers.

  • The targets line in ## Project decisions. New projects get it at bootstrap. Existing projects should add it (see Upgrade).

  • check-file-level-state can fail on code it used to pass. It now scans data, domain, DI, core, app and platform source sets. Typical new findings:

    • a platform handle kept in a file (private lateinit var applicationContext: Context);
    • a top-level mutableMapOf() cache;
    • companion object { lateinit var instance: App }.

    Fix: move the value into a class the DI graph owns as a @Single and inject it.

  • .composekit.conf is unchanged, and no setting is new.

Upgrade

  1. Update the skills:
    • npx skills: npx skills update.
    • gh skill: gh skill update --all. If you installed with --pin, run gh skill update --unpin --all once: gh skill update skips pinned skills.
    • Claude Code plugin: claude plugin marketplace update compose-kit, then claude plugin update compose-kit@compose-kit, then restart Claude Code.
    • Codex plugin: codex plugin marketplace upgrade.
  2. Update the installed guards in each project: run the compose-architecture skill's scripts/install-guards.sh <project-root>. Your .composekit.conf is kept. To check, grep -c module-level scripts/composekit/check-file-level-state.sh prints 1 or more; the v6.1.1 copy prints 0. Then run run-checks.sh and fix any new check-file-level-state findings as above.
  3. Record your targets: add one line to ## Project decisions in the project's AGENTS.md/CLAUDE.md, for example Targets: Android phones and tablets, iPhone and iPad, desktop. Every screen works in Compact through Expanded windows.

Install

See the README or https://compose.avinya.dev/install/. The install commands there always install the latest release.