Repository navigation
Feat: Serve DefaultIcons from material3 as Icons.Default - #50
Merged
Merged
Conversation
INTENT 5.7: the notebook imports DefaultIcons from pythonx.compose.material3 and means Kotlin's Icons.Default. The binder now walks material-icons-core (python-multiplatform #37/#38): Icons.Default is a static getter declared Icons.Filled, and each icon (Add) is an extension property getter on it. - New manifest rows: pythonx.compose.material and pythonx.compose.material.icons, each a one-line re-export. - [aliases] gains a renaming, path form -- still data, no per-name code: "pythonx.compose.material.icons" = { DefaultIcons = "Icons.Default" }. The list form is unchanged. A bare-name alias is resolved once and kept; a dotted path is read on every access, because the binder serves Icons.Default as an uncached static getter. - gen_stubs.py emits the path alias, so DefaultIcons type-checks as Icons.Filled; the icons stubs come from the run 37098191598 artefact, where Add is still typed Any (python-multiplatform #68). The notebook writes DefaultIcons.Add() with parentheses. Add is a property, read without them like every constant since python-multiplatform 46be0212, so DefaultIcons.Add works and DefaultIcons.Add() is a TypeError; a test pins it and SPEC says so. Raised with the ecosystem lead as a spelling decision. Drafted by a subagent in a worktree; reviewed here. Tested against the fake host only; drawing the icon is python-multiplatform's render test. feature added: path aliases, the icons module, DefaultIcons. test added: DefaultIconsAlias (11), manifest alias checks, a renamed-alias stub test, a committed-icons-stub test, mypy cases. Red: 9 + 1 + 7 failed. Neutering the path step fails 4. documentation corrected: SPEC 0/1.2/2/S5.3/8, PROJECT.md, guide, README and README_ko. Suite with python-multiplatform 31c092f0 (worktree): 202 passed, 1 skipped -> 221 passed, 1 skipped; without a checkout, 116 passed, 87 skipped -> 124 passed, 98 skipped. check_guide.py: 0. Refs #9
…elling Decided with the ecosystem lead: Add is read without parentheses, like every constant, and the notebook's Add() is the spelling of its time. SPEC section 8 now says so in one line; the notebook itself is not touched. documentation corrected: SPEC section 8. Tests unchanged. Refs #9
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.
Refs #9
from pythonx.compose.material3 import DefaultIconsnow gives Kotlin'sIcons.Default(INTENT §5.7). This uses a new renaming path alias in the manifest,{ DefaultIcons = "Icons.Default" }, which is data, not code, plus newmaterialandmaterial.iconsmodule rows. The path is read on every access, matching the binder's uncached static getter. The stubs typeDefaultIconsasIcons.Filled;Addis stillAnyupstream (python-multiplatform #68).Notebook mismatch: the notebook writes
DefaultIcons.Add().Addis a property, soDefaultIcons.Addworks andAdd()is aTypeError. This is pinned by a test, recorded in SPEC, and raised with the lead.Test added: 11 alias tests plus manifest, stub and mypy tests. Red: 17 failed. The disable check fails 4.
Drafted by a subagent; reviewed here. Fake host only; drawing the icon is python-multiplatform's render test.