[codex] Avoid intrinsic sizing for RTL markdown documents#72
Draft
[codex] Avoid intrinsic sizing for RTL markdown documents#72
Conversation
Co-authored-by: Codex <noreply@openai.com>
Enable the RTL compatibility samples to exercise compatibility mode, keep HTML block alignment explicit in compatibility mode, and avoid forcing paragraph alignment unless a containing block needs a shared side. Co-authored-by: Codex <noreply@openai.com>
8d43aeb to
65687e6
Compare
Skip the compatibility measurement slot when the parent already supplies a bounded max width, and keep the non-intrinsic measurement fallback only for unbounded layouts. Co-authored-by: Codex <noreply@openai.com>
Render markdown once in compatibility mode and leave direction handling to the existing block-level paragraph, quote, list, and code paths. This removes both intrinsic sizing and the document-level max-width wrapper. Co-authored-by: Codex <noreply@openai.com>
Codex: Avoid expanding same-direction markdown text while still giving opposite-direction paragraphs a parent-width line box for far-edge placement. Co-authored-by: Codex <noreply@openai.com>
Codex: Applies the RTL compatibility width helper to paragraph, list, quote, and code block width expansion points while keeping the helper internal to each module boundary. Co-authored-by: Codex <noreply@openai.com>
Codex: Pass the RTL compatibility flag directly to width helpers and keep UI RTL conversion helpers grouped in the UI RTL file. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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.
Let's back of the idea to use intrinsic width since it caused issues with SubcomposeLayouts, instead to avoid over expanding stuff we make sure to add maxWidth only when the current layout direction and the needed one for compatibility are not the same.
Also refactored the code a bit so it's maybe cleaner, it's still a mess since interventions are needed all over the place
Codex:
Summary:
BasicMarkdown, with noIntrinsicSize.Max, no document-levelSubcomposeLayout, and no top-level forced max width.enableRtlCompatibilityboolean into width helpers instead of threading the full render options object.richtext-markdown/.../rtl/RtlCompatibility.ktand UI RTL helpers inrichtext-ui/.../rtl/RtlCompatibility.kt.Root cause:
SubcomposeLayout, which cannot answer intrinsic measurement.Why the fill is conditional:
fillMaxWidth()just expands compact previews.Testing:
git diff --check./gradlew :richtext-markdown:allTests./gradlew :android-sample:testDebugUnitTest :android-sample:recordRoborazziDebug./gradlew checkArtifacts:
~/Downloads/codex-artifacts; screenshots were not uploaded to the PR.