Repository navigation
Conversation
The simplest custom strategy is now the formula itself: base is the
value passed, the result is the scaled value.
- scalingFormula("base * pow(sw / 360, 0.8)") (shared per text, bounded
at 256 texts; ScalingStrategies.formula) and
scalingFormula { base, screen -> ... } (code, no limits)
- Compose 16.cdp("...") / cdpPx / csp / cspPx and code.custom
16.cdp(appContext, "...") / cdpDp / csp / cspUnits
- Formulas shaped base * (E), with E free of base/scaled/factor, are
screen-only: E is evaluated once per window and the strategy skips the
per-value cache, bit-identical to evaluating the formula per value
- explain() shows the formula; docs, README, guide, LLMS, skill,
CHANGELOG and demo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
Plain-Kotlin factor lambda; screen-only, so it runs once per window and each value costs one multiply. Auto scale#N id; an id registers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
scalingFormula { base * pow(sw / 360f, 0.8f) } and
CustomScaleStrategy { (width / 360f).coerceIn(0.85f, 1.8f) } take
receiver lambdas (FormulaScope / ScreenScope) with the same names as
the text language, so the IDE autocompletes them and typos fail at
compile time. Replaces the unreleased (base, screen) / (screen)
lambdas. Docs lead with the typed form; text stays for JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
bodenberg
marked this pull request as ready for review
October 24, 2026 13:46
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. |
- A rule range (smallestWidth/width/height/aspectRatio) that is not an object now fails with its JSON path instead of being ignored, which made the rule match every screen. - ignoreMultiWindow in multi-window also skips the formula / transform: the value stays unscaled (value bounds still apply). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
- Rule 'when' / 'set', clamp and valueClamp must be objects, and ignoreMultiWindow / multiWindow / aspectRatio.enabled must be booleans: a mistyped value now fails with its JSON path instead of being ignored (a non-object 'when' used to match every screen). - Value bounds must be >= 0 (they clamp the magnitude). - loadJson resolves 'default' before registering, so a failed load leaves the registry untouched. - withAxis variants are cached per source instance, not per id, so a re-registered id never returns another config's variant. - A sensitivity-only rule patch is exported (it was dropped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
Add quick start, code formulas, text formulas, configuration, JSON, API reference, performance, cookbook and troubleshooting guides for appdimens-kmp-custom; turn DOCUMENTATION/custom.md into an entry page; add library-custom/README.md and skills/custom.md; link them from the docs indexes, README, LLMS.txt and the skills files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
The how-it-computes block read value = formula(clampValue(base × factor)), which suggested the formula runs on top of the default scaling. It now shows scaled = clampValue(base × factor) and value = formula ? formula(base, scaled, factor) : scaled: a formula gets the original base and replaces the result; scaled and factor are only for post-processing. Same fix as the hub review (bodenberg/appdimens#31). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012PgB1P23sEhr2a9Wmu5M1h
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.
Follow-up to #3. The simplest custom strategy is now the formula itself:
baseis the value you pass, and the result is the scaled value.scalingFormula(text): shared per text, capped at 256 texts.scalingFormula(text, id): registered.scalingFormula { base, screen -> }: code form, not JSON-serializable. AlsoScalingStrategies.formula(text).cdp,cdpPx,csp,cspPx; code APIcdp,cdpDp,csp,cspUnits.base,base * EorE * base, where E does not readbase,scaledorfactor, depends only on the screen. E is evaluated once per window, so each value costs one multiply. The result is bit-identical to evaluating the formula per value.explain()shows the formula.ScalingFormulaTest(8). The existing engine, JSON and expression tests and the cross-platform fixture are unchanged.Same feature as bodenberg/appdimens-dynamic#16 (commit b140ca0c).
Generated by Claude Code