microts: AOT views receive button press edges only, with no release, hold or touch position
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust, typescript
- Área
- embedded-iot, frontend
Línea de trabajo
Start at microts/compiler/aot-solid-frontend.ts:518, where ActionHandler props are lowered, and at engine/microts-runtime/src/ui.rs:42–49 with resolve_input (545–579), where held buttons and released edges already exist. Read microts-reference.md (Host elements and input), microts-pages.md (Input.target) and input-focus.md (Buttons) to understand the guest-side contract. Done means the onRelease/hold/touch-phase API is specified and wired through compiler and runtime, with a test showing an AOT app compiles and receives a release edge.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
PocketJS v0.17.0 (83c6cac9, current main). macOS 27.2 arm64, Bun 1.4.2.
Gap
In the AOT view subset, input reaches the application as:
ActionHandlerwithonPress: one event on the press edge, optionallylatched(microts/compiler/aot-solid-frontend.ts:518;microts-reference.md, "Host elements and input");AxisHandlerdeltas andMotionHandlerupdates;- a touch as the pressed node in
Input.target(microts-pages.md).
microts::Input already carries the held buttons and the released edges (engine/microts-runtime/src/ui.rs:42–49, resolve_input at 545–579), but no handler and no model API exposes them. A guest application reads the held bitmask every frame (input-focus.md, "Buttons") and touch positions through touches().
Devices with two or three buttons and no touch panel distinguish a click from a long press, repeat while a button is held, and use button combinations (A+B). A touch panel needs positions for drags and swipes. An AOT application cannot express these today.
Repro
pocket.host.json, pocket.host.config.ts, main.tsx
{
"format": "pocket-host/2",
"id": "repro-esp32s3",
"platform": "esp-idf",
"form": "takeover",
"cadences": [30],
"display": {
"logicalViewports": [[240, 240]],
"presentations": ["native"],
"rasterDensity": 1,
"animation": "repaint"
},
"panel": { "primary": [240, 240] },
"capabilities": ["input.buttons", "text.glyphs.baked"]
}
// pocket.host.config.ts
import { defineHostConfig } from "@pocketjs/framework/host-config";
export default defineHostConfig({
host: "./pocket.host.json",
app: {
id: "dev.example.repro",
title: "Repro",
version: "0.1.0",
entry: "main.tsx",
output: "repro",
framework: "solid",
viewport: { logical: [240, 240], presentation: "native" },
features: ["input.buttons", "text.glyphs.baked"],
aot: true,
model: "compiled",
},
});
// main.tsx
import { mount } from "@pocketjs/framework/solid";
import App from "./app.tsx";
mount(() => <App />);
// app.ts
import { createSignal } from "solid-js";
import type { i32 } from "@pocketjs/framework/solid/std";
export const [presses, setPresses] = createSignal<i32>(0);
export function down(): void {
setPresses(presses() + 1);
}
export function up(): void {
setPresses(presses() - 1);
}
// app.tsx
import { ActionHandler, Text, View } from "@pocketjs/framework/solid/components";
import { BTN } from "@pocketjs/framework/input";
import { down, presses, up } from "./app";
export default function App() {
return (
<View class="w-full h-full p-4 bg-slate-100">
<ActionHandler button={BTN.CROSS} onPress={() => down()} onRelease={() => up()} />
<Text class="text-lg text-slate-900">{presses()}</Text>
</View>
);
}
bun $POCKETJS/tools/pocket.ts compile --config pocket.host.config.ts --aot --out gen
Actual
PocketJS: app.tsx:8:64 TS2322: Type '{ button: 16384; onPress: () => void; onRelease: () => void; }' is not assignable to type 'ActionHandlerProps'.
Property 'onRelease' does not exist on type 'ActionHandlerProps'.
Requested
onReleaseonActionHandler, and either a hold event (after a duration, with an optional repeat interval) or the press duration inonRelease;- a way for compiled models to read the held button mask, so that combinations can be tested;
- for touch hosts, a handler or model input with the contact position and phase (down, move, up).
Workaround
The product's host code writes the raw button mask and pointer state into model fields every frame, and model code implements click, long press and drag on them. The rules then live outside the view subset, and each product writes them again.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.6k
- Forks
- 88
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pocket-stack/pocketjs
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
pocket-stack/pocketjs#729 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pocket-stack/pocketjs#725 ·
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
pocket-stack/pocketjs#724 ·
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
pocket-stack/pocketjs#728 ·
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
pocket-stack/pocketjs#726 ·
Todos los issues de pocket-stack/pocketjs
Issues similares
-
kind:defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
mux-labs/mux-frontend#1240 ·
Los mantenedores suelen responder en 1 día
-
area: agents-mcp priority: normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Wait for the IDS correction dialog to settle in the stale-audit testPosiblemente ocupada @louistrue la tomó hoy. Abiertoready
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathPosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cloudflare/chanfana#400 ·
Los mantenedores suelen responder en 1 día