Checking your work in the window
Errors of widgets and init files mostly show only in the user’s window, so check there. Each step is a method an
agent calls with omfp_call (workspaceId defaults to your workspace):
- Write the widget or the init file.
workspaces.check: type-checks the init files and every widget, window module and live widget (views.mountcode) with the files they import, against the declarations ofomfp/sdk,omfp/kitand React, reporting<file>(<line>,<column>): error …; loads the init files in a throwaway host (what fails, what they declare); and renders every widget the workspace declares, then every live widget (aviews.mountcode mount, namedmount <id>), out of sight in the most recently focused window showing it, with each one’s errors.windows.check_widget { widget }renders one widget; it also warns about native form controls. It resolves the name as the window does: the workspace’s widget first, then one the user’s init file declares. WithoutworkspaceIdit checks in the most recently focused window (orwindowId), with or without a workspace: that is how to check the user’s widgets, or a shell slot module of the user’s init file (the widgetshell.<slot>).workspaces.reload_initapplies the init files.windows.list, thenwindows.state { windowId }: each window showing the workspace (most recently focused first) — its thread, its views (where each comes from:manifest, the workspace’s declared or live views;user_initorworkspace_init, a window module;builtin, the core’s view while there is no valid manifest), their widgets, the active one, the commands window modules and widgets added with their keys, and its errors.windows.run { command: "view.switch", args: ["<view>"] }shows a view in that window (windowIdpicks one). Any registered command id or alias runs the same way, as:<command> <args>would. It never runs code: an unknown command, a disabled one or a failure comes back as the method’s error.windows.stateagain for the errors of what it shows now; fix and repeat.
Nothing of a check’s render appears on screen. Widgets and scripts call the same methods with workspaceId given.
Phones
Section titled “Phones”Every view, widget, window module view and card must also work in the narrow (frame under 1100 px) and mobile
(under 700 px, or a phone held sideways: one area at a time, the mode line at the top) layouts: read FRAME_LAYOUT
and give way (omfp://docs/widgets, Rules). The check renders in the focused window’s layout only: check the result at
a phone width too (a window under 700 px wide, or ask the user to look on their phone).