Contract: expose safe-area insets and viewport segment rectangles as values

Aperta
#175 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with runner/src/viewport.rs to review the supported viewport fields and its note about segment rectangles, then read docs/contract-for-agents.md around the safe-area and viewport segment definitions. Trace how viewport values reach app logic and how updates are handled; done means apps can read safe-area insets and segment rectangles as numeric values, with updates when those values change and existing segment counts preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

A 3D dice game (a port of an Expo/three.js app) passes HUD bounds into its camera. Contract supports safe-area and fold lengths in styles, but cannot read those lengths as numbers. The port measures ruler views and uses a CSS expression to infer whether the top inset is zero (felt/app.contract:375,449-465,890,940-944 in port commit 6a93133).

Verified on current origin/main:

It is possible today to lay out safe content with styles and measure boxes with frame() in an action. The missing feature is a direct value read for world arguments and app logic, not CSS layout support. #169 requests display pixel ratio, not these fields.

Smallest API suggestion: exactViewport().safeAreaTop/Right/Bottom/Left in logical points, following the existing document inset rules, plus segment rectangles in the same coordinate space. Update them when insets or fold geometry changes. Keep existing segment counts.

Host

All hosts with safe areas or folded displays.

Smallest app that shows it

A full-bleed canvas needs numeric top/bottom insets for its camera. A text binding can read viewport width, but cannot declare a supported safeAreaTop field. padding-top="env(safe-area-inset-top)" works, showing that layout has the value.

Exact commit

e2f7cca36be06529cb3f60a75f59fe584d9f6906 (origin/main, fetched 2026-11-11). Source review only; no new build or device run.

Lingua principale
Rust
Stelle
2.8k
Fork
62
Merge medio
4h 18m
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di expo/exact

Tutte le issue di expo/exact

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.