Skip to content

feat(ui): close 5 sharity-port UI gaps #706/#707/#708/#709/#710#716

Merged
proggeramlug merged 4 commits into
mainfrom
worktree-fix-706-710-ui-gaps
May 12, 2026
Merged

feat(ui): close 5 sharity-port UI gaps #706/#707/#708/#709/#710#716
proggeramlug merged 4 commits into
mainfrom
worktree-fix-706-710-ui-gaps

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

Closes #706, #707, #708, #709, #710 — all five gaps from the sharity-app port.

Plumbing: new perry-dispatch MethodRow entries, perry-api-manifest entries, and .d.ts exports with usage examples. No new HIR variants needed.

Test plan

  • cargo build --release -p perry-runtime -p perry-stdlib -p perry clean
  • cargo build --release -p perry-ui-macos -p perry-dispatch -p perry-api-manifest clean
  • cargo build --release -p perry-ui-ios --target aarch64-apple-ios-sim clean
  • Workspace tests (excluding cross-host UI crates): 0 failed
  • cargo fmt --check clean
  • Smoke test /tmp/test_706_710_smoke.ts exercises all new APIs — compiles + binary launches AppKit
  • Manual visual check on a real iOS device (not done by me; bottom-nav tint, multi-line button, alert dialog all need eyes)
  • Confirm Android / GTK4 / Windows / tvOS / watchOS / visionOS stubs don't crash on bring-up (they're empty extern "C" fn so should be safe)

….866)

- #706 bottomNavSetTintColor / bottomNavSetUnselectedTintColor — iOS
  UITabBar.tintColor + unselectedItemTintColor; macOS overrides the
  custom NSStackView's per-tab tint pass in apply_styling
- #707 textSetNumberOfLines / textSetTruncationMode — UILabel.numberOfLines
  + lineBreakMode; macOS NSTextField.maximumNumberOfLines + cell wrap +
  lineBreakMode. Mode 0=word-wrap, 1=head, 2=middle, 3=tail
- #708 iOS alertWithButtons — new perry-ui-ios/src/widgets/alert.rs uses
  UIAlertController + per-button UIAlertAction RcBlock handlers,
  presented on topmost VC via main-queue dispatch
- #709 iOS Button \n support — titleLabel.numberOfLines=0 + center +
  wordWrap unconditionally; single-line labels unchanged
- #710 AttributedText builder — per-handle NSMutableAttributedString
  accumulator with appendAttributedString runs (NSFont/NSColor/NSUnderline);
  iOS UILabel via setAttributedText, macOS NSTextField via
  setAttributedStringValue. Stubs on other platforms.

Plumbing: new perry-dispatch MethodRow entries + perry-api-manifest
entries + types/perry/ui/index.d.ts exports. Workspace tests pass
(0 failed). Smoke test compiles + launches.
…indows/Android/watchOS (v0.5.867)

Replaces the v0.5.866 cross-platform stubs with actual implementations:

- tvOS / visionOS: UIKit-based — copied alert.rs / attributed_text.rs /
  bottom_nav.rs from iOS (same UIKit API surface). Also fixed pre-existing
  ABI bug in visionOS perry_ui_alert (was i64 instead of f64 for buttons)
  and added the missing alert_simple symbol.
- GTK4: bottom_nav tint via Pango AttrColor on labels; text setters via
  GtkLabel.set_lines + ellipsize; AttributedText via Pango AttrList per-run.
- Windows: bottom_nav tint stored on NavEntry + InvalidateRect (visual
  application waits on owner-drawn button rewrite — Win32 BUTTON ignores
  WM_CTLCOLORBTN); text setters via SS_*ELLIPSIS style bits;
  AttributedText via RichEdit50W + EM_SETCHARFORMAT runs.
- Android: bottom_nav tint stored on BottomNavState + applied via
  setColorFilter/setTextColor; text setters via TextView.setMaxLines +
  setEllipsize; AttributedText via SpannableStringBuilder + StyleSpan /
  UnderlineSpan / ForegroundColorSpan / AbsoluteSizeSpan.
- watchOS: new NodeData fields + NodeKind::AttributedText variant + 9
  new perry_watchos_node_attr_run_* introspection FFI symbols; SwiftUI
  host will apply via .lineLimit / .truncationMode / Text concat.

Workspace tests pass; cargo fmt clean.
@proggeramlug proggeramlug force-pushed the worktree-fix-706-710-ui-gaps branch from 14f99a3 to 81e88f4 Compare May 12, 2026 17:37
@proggeramlug proggeramlug merged commit 282f639 into main May 12, 2026
9 checks passed
@proggeramlug proggeramlug deleted the worktree-fix-706-710-ui-gaps branch May 12, 2026 20:02
proggeramlug added a commit that referenced this pull request May 12, 2026
PR #716 added crates/perry-ui-gtk4/src/widgets/attributed_text.rs
with pango Attribute construction that doesn't compile against the
pango-rs sub-attribute type hierarchy. `AttrInt::new_weight()` etc.
return concrete subtype (AttrInt, AttrSize, AttrColor); the push
closure expects the parent `pango::Attribute`. Need explicit
.upcast() per the glib type system.

The error didn't surface on #716's CI because the gtk4 doc-tests
matrix entry is disabled (v0.5.874 timeouts), and the release build
matrix is the only path that builds perry-ui-gtk4 cross-arch.
Surfaced on v0.5.888's release run.

5 sites updated. Uses gtk4::glib::object::Cast trait import.
proggeramlug added a commit that referenced this pull request May 12, 2026
…0.5.890)

v0.5.889's pango upcast was correct but `BUFFERS.with(|b| ...)` used
`b` as the closure parameter, shadowing the outer fn's `b: f64`
(blue color component). Line 119's `to16(b)` resolved to the
closure's RefCell instead of the f64 — E0308 mismatched-types
("expected f64, found &RefCell<HashMap<i64, Buffer>>").

Renamed closure binding to `bufs`. Same shape as the workaround
v0.5.889 added the .upcast() for.

Also fallout from PR #716.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perry/ui-ios: BottomNavigation has no active-tab tint setter (locked to iOS-default blue)

1 participant