fix(fold): make reported screen dimensions match their coordinate-space contract

Abierto
#2,729 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Read AGENTS.md, then inspect packages/contracts/src/fold-runtime.ts and packages/platform-apple/src/foldable/pose.ts, along with the owning response fixtures/schema and user docs/help. Run the focused contract tests and pnpm check:affected --run. Done means reported dimensions retain their native-panel values and discriminator, ambiguous panels still omit screen, and documentation no longer describes snapshot coordinates.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug ready-for-agent

Part of #2725.

Decision: report native panel points, not an app viewport

Keep the already-released screen.display, screen.widthPt, and screen.heightPt fields and their numeric meaning. Add the required discriminator screen.coordinateSpace: "native-panel" whenever screen is present. These are the panel's native pixel dimensions divided by its point scale; do not rotate them. Explicitly state that they are not snapshot coordinates and cannot be used to place a tap. A caller needing the app viewport must take a fresh snapshot.

Example for the open Duo:

{"pose":"open","hingeAngleDegrees":180,"screen":{"display":"LCD-1","coordinateSpace":"native-panel","widthPt":669,"heightPt":951}}

Its active app window can be 951x669. That difference is expected and must be documented.

Evidence and rationale

git tag --contains e8da1e10d includes v0.21.8: fold metadata is released. Preserve the existing fields/values, add explicit meaning, and correct the false contract instead of adding aliases or breaking field names. PR #2724 and the native capture investigation in #2727 measure a 951x669 app window on the 669x951 native-point inner panel. currentOrientation describes the display and is not a sufficient app-orientation contract for a locked app. Choosing native geometry removes that inference entirely; no locked-app experiment is needed to justify these fields.

Fold remains independent of app identity and runner startup. Do not query XCTest or rotate native dimensions solely to fill this metadata.

Bounded implementation

  • Update packages/contracts/src/fold-runtime.ts, packages/platform-apple/src/foldable/pose.ts, owning response fixtures/schema where applicable, and user docs/help.
  • Set the literal discriminator at the report construction site. Remove every claim that these dimensions equal the next snapshot's viewport.
  • Do not alter pose control, display selection, snapshot geometry, or gestures.

Acceptance and validation

  • Closed native panel: 466x678; open/half-open inner panel: 669x951 for the existing measured fixture, all marked native-panel.
  • Changing fixture currentOrientation alone does not swap native dimensions.
  • Unresolved/ambiguous panel selection retains the existing omission of screen; never invent a viewport.
  • Cover the public fold response through its owning contract tests, run focused tests and pnpm check:affected --run, and record a local fold response on the PR head.

Ready for implementation on current main. No dependency on #2724 or #2728: their geometry evidence explains the bug, but this fix promises only native panel geometry. Follow AGENTS.md and keep one issue per PR.

Lenguaje dominante
TypeScript
Estrellas
4.7k
Forks
304
Merge medio
12 h 42 min
PR fusionados (30 d)
463

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de callstack/agent-device

Todos los issues de callstack/agent-device

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.