# Build an app or game that fits its display An interactive Hackemist build should behave like an application. Keep navigation, Back/Close, primary actions and game controls reachable inside the player's current viewport. Organize features as screens, workspaces and contextual panels rather than a stack of website sections. Do not make users scroll a long document to find a timer, finish a workout, pause a game or reach another feature. **Scrolling is normal app behavior.** Feeds, chats, collections, timelines, tables, editors, forms and reading views can scroll where that helps the task. The goal is an app feel, not a ban on scrolling or mandatory pagination. Keep the application shell stable while its content moves. This applies to manual Studio uploads and agent/MCP builds. The player displays your authored interface; it cannot reorganize an arbitrary website into an app. A screenshot or a responsive declaration alone does not prove all screens work. Use the [screen matrix and preview tools](/docs/layout-testing.md) to test 16:9, 20:9 and 21:9 phones, other custom aspect ratios, 1920 × 1080, QHD, ultrawide and 4K. Studio offers CSS viewport presets/rotation and an on-demand control-geometry report. `project_layout_plan` gives MCP creators the same target catalog and a credential-free local helper with mobile/touch/DPR emulation and explicit state assertions. Wider coverage runs on the creator's computer. Desktop publication includes 1920 × 1080 within the existing eight-target server bound. ## Choose the experience honestly Declare the experience on the HTML or body element: - `data-hackemist-experience="app"`: planners, editors, trackers, dashboards and other interactive tools. Use a bounded application shell, persistent navigation and contained panels. - `data-hackemist-experience="game"`: menus, gameplay, HUD, pause, settings and results must fit. A game world may move within a clipped scene; its required controls must remain accessible. - `data-hackemist-experience="document"`: an article, manual or reading-first report may scroll vertically. Do not use this to disguise an overflowing interactive app or game. Also declare `data-hackemist-layout="responsive"` for a reflowing layout or `adaptive` for implemented logical layouts. `data-hackemist-viewport="fit"` explicitly requires both-axis fit. Interactive responsive layouts now require both-axis fit by default; a genuine scrolling document opts into `document`. Existing published versions keep working; an updated build is checked against the current rules. Legacy fixed stages can retain the player's uniform Fit mode, but scaling alone does not make small controls usable. ## Adapt the interface before removing anything Design a deliberate composition for each supported form factor: mobile, tablet, desktop and any other advertised display. Customize the navigation, information hierarchy, panel arrangement and interactions to that space and input method. Reuse components and state, while allowing genuinely different interfaces for the same task. Each app should have its own product design; the starter's workspace appearance is not a platform-wide skin. Start by resizing and reflowing content to the available **width and height**. Use flexible tracks, wrapping toolbars, bounded spacing and typography, and a game renderer sized to its actual content area. Scale a game scene uniformly where appropriate; keep HUD text and touch controls readable. Do not shrink an entire desktop interface until its labels and controls become unusable. | Form factor | Application behavior | | --- | --- | | Large desktop / TV | Use the available space for a navigation rail, working area and optional detail/inspector panels. TV needs readable controls and keyboard/remote navigation. | | Tablet / small desktop | Resize panels, reduce spacing and use a compact rail. Move secondary panels to a drawer or dedicated screen only when they no longer fit usefully. | | Phone portrait | Use reachable bottom or compact navigation. Show the primary task; open secondary tools and details with a button and a clear Back/Close route. | | Short landscape / reduced height | Reflow HUD and controls beside the work area, reduce nonessential spacing and keep primary actions visible. Consider the phone keyboard as a height change. | Preserve selected items, entered text, focus, scroll position and game progress across resizing and navigation changes. Hidden desktop panels need a working alternative entry point; hiding a feature alone is not adaptation. Choose breakpoints from the content, not from device names. Do not intercept native touch scrolling or disable browser zoom to make a layout fit. ## The shared Studio and MCP starter New empty Studio and MCP projects both use the same [complete application starter source](/docs/app-shell.html). Save that source as UTF-8 `index.html`, or read `hackemist://examples/app-shell` through MCP. It has desktop navigation and an inspector, a compact tablet rail, phone bottom navigation, a mobile detail screen with Back, a naturally scrolling collection, working edits and an accessible settings dialog. Resize an active edit to try the transitions. Its inputs and controls remain usable instead of shrinking the whole desktop screen. The source is served as inert text on the documentation origin; preview uploaded builds through the isolated player. The starter holds demo data in the current session. Connect durable data to the [save SDK](/docs/save-sdk.md). A layout template does not implement account saving. Replace the workspace with your own app or game architecture; the starter is an example, not a required visual style. ## A smaller paging example This smaller alternative has working navigation, optional pagination, a named keyboard-accessible content panel and an Add button. Use paging when it helps the task; a naturally scrolling collection is equally valid. Save it as UTF-8 `index.html` and connect durable data to the save SDK. ```html My Hackemist app
My Hackemist app

Today

Your main task belongs here. Use Items to browse the collection.

``` ## Keep features reachable Use a grid or flex shell whose content track is `minmax(0, 1fr)`. Set `min-height: 0` and `min-width: 0` on shrinking children. Use `100dvh` with a `100%` fallback and respect safe-area insets. Header, navigation and action bars reserve their own space; the content panel receives the remainder. A large fixed `min-height` or a `100vh` canvas plus extra HUD usually overflows short landscape screens. Use tabs, Previous/Next, paging, search, collapsible navigation or a dedicated detail screen to split many features. For a workout, keep Finish, Pause and the timer reachable while paging through exercises. For a game, reserve space for HUD/touch controls and provide reachable Pause/Back actions on every state. Keep touch targets around 44 CSS pixels and support keyboard navigation and visible focus. A feed, chat, list, log, table, editor, form or reading view may scroll **inside a contained content panel**. Mark it `data-hackemist-scroll-region`, give it `tabindex="0"`, an accessible name with `aria-label` or an `aria-labelledby` reference to actual text, and real `overflow: auto` or `scroll`. Its viewport must fit the app and every outer clipping wrapper. This lets keyboard and touch users reach content while app navigation stays visible. Do not simply put `overflow: hidden` on the body and cut off features. `data-hackemist-required-ui` identifies fixed headers, primary action bars or HUD that must remain visible. Keep these and app navigation **outside** scrolling content, or correctly pinned in view; marking the entire app as a named panel cannot exempt them. For dialogs, keep Close/Back and important actions in fixed dialog chrome; scroll only the dialog's named content panel. Do not hide a feature to pass a size check. Preserve focused values when rotating, resizing or opening a phone keyboard. Test those transitions with entered data, not just an empty screen. ## Verify before publishing Test at least 320 × 568, 390 × 844, 740 × 320, 844 × 390, 768 × 1024, 1024 × 768 and 1440 × 900, plus a large desktop. Exercise every navigation destination, active edit/game state, dialog, pause and results screen. Confirm the document's scroll width/height do not exceed the viewport for apps/games, navigation and primary actions remain reachable, paging exposes every record, and focus/entered values survive resizing. Test touch and keyboard as applicable. Also test 360 × 640 / 640 × 360 (16:9), 360 × 800 / 800 × 360 (20:9), 360 × 840 / 840 × 360 (21:9), 1920 × 1080, 2560 × 1440 and 3840 × 2160, plus actual advertised sizes. DPR and touch capabilities are separate from CSS size: a desktop window resized to phone width may hide `pointer:coarse` controls. Verify touch layouts, held/multi-finger actions, safe-area insets and the reduced height of an open phone keyboard. A fixed 16:9 game world may use letterboxing; its HUD must still reserve enough space and reflow for wider/taller displays. Never stretch game geometry to fill an unrelated aspect ratio. Mark persistent HUD/action bars `data-hackemist-required-ui`. The shared checker now rejects positively overlapping actions inside the same declared bar even if the document itself fits. Covered/other overlapping/small controls are reported for review; intentional overlays are not automatically called defects. Canvas-drawn touch targets need app-owned hit-area tests and real interaction. Resize the renderer and its camera projection from the scene's content rectangle; use a deliberate on-device pixel/quality budget instead of multiplying every physical resolution by DPR without considering memory. The shared publishing checker rejects root vertical scrolling for interactive responsive apps, root horizontal overflow, required controls clipped outside accessible panels, and navigation/required UI that scrolls away inside content containers. Correctly pinned fixed or direct-child sticky navigation remains supported. Scrolling content remains supported. Named panels are checked by geometry, real labels and actual scroll styles, including outer clipping wrappers; a declaration cannot grant access or prove semantic completeness. A scrolling document must opt into the document experience. Phone publication targets now automatically include 320 × 568 portrait and 740 × 320 short landscape when those orientations are advertised. Desktop, tablet and TV targets retain their corresponding checks, up to eight loads. The checker still cannot infer every hidden feature or automatically play an arbitrary game. Run your own meaningful screen and interaction tests. Emulated sizes do not establish physical-device performance, Safari support, phone-keyboard behavior or authenticated saves. Manual Studio and MCP use the same source checks, browser measurements and findings. Complete MCP release requires current passing browser evidence. Studio and explicit basic release retain the administrator's configurable publishing gate; when browser checks are required, the same mobile responsive contract applies. Existing live versions are not rewritten or unpublished by this upgrade. Manual builders: use Studio → Files & preview → Run draft, open every screen at the target sizes, then run Publishing checks and fix each finding. Agent builders: read this resource through `hackemist://docs/app-layout`, test locally, upload the saved static bundle, inspect `project_release_checklist`, then publish. Do not label a startup-only check as full application or game verification.