Apple renderer: honour Prop.Axis (horizontal Scroll) in both Swift shims #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Prop.Axis(Orientation)is new inmodules/renderer-apiand is the framework's answer toRowoverflow:Rowclips, so a row wider than the screen goes inside a horizontalScroll. GTK and Android now honour it; the Apple renderer ignores it (AppleRenderer.updatehas an explicit no-opcase Prop.Axis(_)with a comment pointing here), so on macOS and iOS such a row still clips.Why it needs the Mac. The axis is read at
create, andcreatereaches Swift as a single int kind code (sui_create(kindCode)), so the axis has to travel as a new code rather than a later setter. On Android the two directions are genuinely different classes; on AppKit/UIKit one class does both, so the shim change is small.What to do
scalaui_apple.h/AppleRenderer.kindCode: reserve kind code 9 for a horizontalScroll. Keep 6 as the vertical one so nothing existing moves.AppleRenderer.create: pick 9 whenpropscontainsProp.Axis(Orientation.Horizontal), 6 otherwise. Then delete the no-opcase Prop.Axis(_) => ()comment's "not yet honoured" wording and leave it a documented create-only no-op, exactly as GTK and Android have it (the contract says a renderer may ignore an axis change atupdate).Shim+AppKit.swift: for 9, anNSScrollViewwithhasHorizontalScroller = true,hasVerticalScroller = false, and the document view pinned so it can exceed the clip view's width but not its height.Shim+UIKit.swift: for 9, aUIScrollViewwithshowsHorizontalScrollIndicator = true,alwaysBounceHorizontal = true, and the content's height constrained to the scroll view's frame height while its width is free.How to verify.
examples/sharedTodoAppnow puts its five action buttons (Add,Rotate,Drop,About,10 000 rows) insideScroll(axis = Orientation.Horizontal). The GTK self-test measures it and should be mirrored: the row's content wants ~429px while the scroller's own natural width is ~46px. On Apple, assert the equivalent — the scroll view's intrinsic/fitting width is far below its content's — and confirm the fifth button is reachable by scrolling rather than clipped. Add the check to the existing 23-check macOS/iOS self-test and record the two numbers in the report.See
docs/11-what-it-looks-like.md("Two gaps this exposed") and the 2026-09-28 entry indocs/decisions.md.