Repository navigation
fix: render native image alt fallback - #428
Closed
tiensonqin wants to merge 6 commits into
Closed
tiensonqin wants to merge 6 commits into
tiensonqin wants to merge 6 commits into
Conversation
Measure and paint image alt text when no decoded bitmap is available, matching browser fallback behavior for broken or pending typed images.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Classify alt text changes as layout-affecting so a mounted image without a bitmap remeasures its inline fallback instead of retaining stale bounds.
Clip image alt fallback text to the image box so long labels cannot overlap neighboring content.
Record the native typed-image fallback sizing and clipping behavior in the migration guide.
Assert that fallback text operations are emitted inside the image-bounds clip rather than merely counting clip operations.
Track clip depth and count in the fallback paint test so unmatched clips cannot satisfy the assertion.
Contributor
There was a problem hiding this comment.
Devin Review found 5 findings. Devin automatically fixed all 5 findings.
Fixed by Devin (5)
- Clip test misses an unmatched push — The test now tracks numeric clip depth and requires exactly one balanced image-bounds clip containing the marker text operation.
- Undocumented image sizing default — The migration guide now documents the native typed-image alt fallback sizing/clipping behavior and migration impact.
- Image fallback clipping lacks coverage — Strengthened the paint test to emit a marker text operation and assert both its position inside the clip and the exact image clip bounds.
- Stale image bounds after alt updates — Alt changes now invalidate layout as well as paint/semantics, so mounted bitmap-less images remeasure instead of retaining stale bounds.
- Alt text overlaps neighboring content — Alt fallback text is now painted inside a clip matching the image box, preventing overlap into neighboring content.
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.
Summary
Render measurable alt text for native typed images when no decoded bitmap is available. Browser images expose alt text as inline fallback content while loading or after decode failure; the native backend previously measured those images as zero-sized and painted nothing, so broken images collapsed invisibly.
lui_layoutnow falls back to the host text measurer for non-emptyalttext whenimage_measurehas no bitmap, andlui_paintemits the corresponding text operations whenimage_ofhas no bitmap. Focused layout and paint tests cover the fallback contract.Validation:
opam exec --switch=5.5.0 -- dune build platform/native/lui_layout platform/native/lui_paintopam exec --switch=5.5.0 -- dune exec platform/native/lui_layout/test/lui_layout_test.exe(81 tests)opam exec --switch=5.5.0 -- dune exec platform/native/lui_paint/test/lui_paint_test.exe(82 tests)Link to Devin session: https://app.devin.ai/sessions/c5d7e54b078e47e28153404536bb3def
Open in Devin Desktop: https://app.devin.ai/desktop/session/c5d7e54b078e47e28153404536bb3def?variant=devin
Requested by: @tiensonqin
🟢 Devin fixed all 5 findings · Follow Devin's work