View on GitHub

Shell360

Shell360 is a cross-platform SSH and SFTP client.

ADR-0004: Route native back-press through the bridge capability layer

Status: Accepted.

Context

The native back-press key was the only frontend feature that reached the native host outside the JSB channel. Android, HarmonyOS, and iOS hosts ran window.dispatchEvent(new Event('shell360:back', { cancelable: true })) directly against the page, and mobile/src/app/layouts/AppLayout subscribed with window.addEventListener("shell360:back", ...). This bypassed the bridge facade and coupled business code to a private, untyped DOM event protocol that was duplicated across three hosts and the frontend.

Every other native-to-frontend signal (for example data.authedChange) already flowed through the JSB emit channel, so the back-press path created a second, parallel communication mechanism.

Decision

Back-press is now a first-class bridge capability, modeled as a one-way emit event plus an explicit invoke action:

The previous synchronous, cancelable dispatchEvent semantics are replaced by an asynchronous emit plus an explicit action. The shell360:back DOM event and its per-host BACK_REQUEST_SCRIPT are removed.

Changes

Consequences