Repository navigation
Tifroz/attributed text - #597
Merged
Merged
Conversation
5 tasks done
tifroz
added a commit
to skiptools/skipapp-showcase
that referenced
this pull request
Nov 5, 2026
…les + superscript) Depends on 3 merged PRs - the dependencies are pinned to their respective commit until the next release - [SkipFoundation #143](skiptools/skip-foundation#143) - [SkipUI #597](skiptools/skip-ui#597) - [SkipFuseUI #164](skiptools/skip-fuse-ui#164). * Added attributed text examples using merged Skip dependencies * Added shared attributed-text and search highlighting examples * Listed editable attributed text in the playground index * Avoided Swift type-check timeout in the Alert playground
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.
Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.
Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Skip Pull Request Checklist:
swift testCodex generated the code, manually tested in the Showcase app
THIS PR DEPENDS ON skiptools/skip-foundation#143
Summary
Skip Lite callers can now style an
AttributedStringrange and render those edits withText(value), including ranges found with case-insensitive search. Previously, the transpiled initializer consumed the stored Markdown representation instead of the current editable attribute runs.Render editable attributes in Skip Lite
Add typed
font,foregroundColor,underlineStyle,strikethroughStyle, andbaselineOffsetproperties to attributed strings, substrings, and attribute containers, with read access on runs. Convert the current Foundation runs into the existing attributed-text renderer, preserving links and inline presentation intents.Source files:
Sources/SkipUI/SkipUI/Text/AttributedString.swift— added typed UI attributes.Sources/SkipUI/SkipUI/Text/AttributedText.swift— converts editable Foundation runs.Sources/SkipUI/SkipUI/Text/Text.swift— routes transpiledText(AttributedString)through those runs.Package.swift— requires the merged Foundation implementation.README.md— documents usage and supported attributes.Tests:
Tests/SkipUITests/EditableAttributedTextTests.swift:testRangeStylingAndCopyIndependence,testAttributeContainerAndRunAccess, andtestCaseInsensitiveSearchHighlightingcheck typed attributes, copy independence, and highlighting a search result.Tests/SkipUITests/Skip/EditableAttributedTextRenderingTests.kt:editedSwiftRangesReachMaterialTextchecks the actual Compose text, span boundaries, font, color, underline, baseline shift, and URL after a case-insensitive Unicode range edit.Share inline Markdown conversion with Foundation
Use Foundation's editable attributed-string parser for
markdownRuns(_:)and remove the duplicate inline Markdown helper. Attribute edits made after parsing are reflected in the rendered runs.Source files:
Sources/SkipUI/SkipUI/Text/AttributedText.swift— uses Foundation's parsed runs.Sources/SkipUI/Skip/InlineMarkdown.kt— removed.Tests:
testEditedMarkdownProducesCurrentRenderRunsinTests/SkipUITests/EditableAttributedTextTests.swiftto check edited color, baseline offset, URL, and preserved inline styles.testInlineParsingPreservesWhitespaceWithinEmphasisinTests/SkipUITests/AttributedTextTests.swiftto accept coalesced runs while checking the full styled text.Usage Example
API Shape
New typed properties on
AttributedString,AttributedSubstring, andAttributeContainer; read-only equivalents onAttributedString.Run:The existing
Text.init(_: AttributedString)signature is unchanged. Range searching and editing come from SkipFoundation.Testing
Validated after rebasing, at
92f3777, with no editable dependencies:swift test --build-system native --filter EditableAttributedTextTests: 3 Apple tests passed.:SkipUI:testDebugUnitTest, filtered toAttributedTextTests,EditableAttributedTextTests, andEditableAttributedTextRenderingTests, with-Pkotlin.incremental=false: 14 Android tests passed, zero failures, errors, or skips.git diff --checkpassed; the branch introduces no local package paths or debug artifacts.The full package suite was not run.
Risks / Limitations
ba10460923b9e495bbd54ad494b8b0cb3dd7ba26. Replace this pin with the minimum containing release once available.Range<AttributedString.Index>slicing are not supported.[]and.caseInsensitive; ICU matching can differ from Apple Foundation, including the documentedStraße/STRASSEdifference.