Skip to content

M3-S5 — The render engines: web and mobile

Section titled “M3-S5 — The render engines: web and mobile”
ModuleM3 — The read side
After this session you canExplain how the web and mobile apps turn configuration into screens, predict where the phone differs from the browser, and audit a page for parity.
TimeFacilitated: 53 min · On your own: 53 min
Before you startM3-S1 (three runtimes) and M3-S3 (widgets as aggregations). Larkspur Dev in a browser as Rami Aziz and on the phone as maya.idris.
Go deeperFrontend architecture · Mobile architecture · Mobile and web parity notes

◆ Orientation (1 min) — The last engine before the eye

Section titled “◆ Orientation (1 min) — The last engine before the eye”

Everything in M2 and M3 ends on a screen. A builder never writes a screen: they configure a view, a page, a field’s control, and two applications, the web portal and the mobile app, draw it. ACP showed you the differences between them as a user (ACP’s web and mobile job aid). Here you see why they exist, which matters twice later in the course: when you decide whether a new capability can be drawn without code (M6-S4, and M8 for the source strand), and when Omar Haddad proves on his phone that he can still configure your extension (M7-S3, M8-S4).

▤ Concept (8 min) — From metadata to pixels, twice

Section titled “▤ Concept (8 min) — From metadata to pixels, twice”

The server never sends a screen. It sends metadata: a view’s definition (its source, its fields, its faces or display types: table, cards, calendar, board, timeline, tree, mini card), a page’s definition (a tree of widgets with their options and layout), and each field’s definition with its renderOptions, which name the edit component and the view component by a string such as "DateComponent" (M2-S3). Each client turns that metadata into its own widgets. The display types use the same numbers on web and mobile (table 0, cards 1, calendar 2, board 3, timeline 4, tree 5, mini card 6), another wire contract in the sense of M2-S3, which is how one view configuration means the same thing to both.

The web portal: a plugin and dynamic-component system

Section titled “The web portal: a plugin and dynamic-component system”

The web portal is an Angular application, and its defining idea is that no screen is written for a particular entity or page. Instead:

  1. Plugins expose components by name. A plugin is a bundle that lists the components it offers, each under a component name (the string stored in renderOptions), with a loader that fetches the component’s code only when it is first needed. It also publishes metadata for each component: which field types it handles, which options a builder may set, whether it can serve as a view’s title or category, how it can be queried, which view component it pairs with.
  2. A registry resolves names to code. At start-up each plugin registers its names. When a screen needs "DateComponent", the registry loads it (once) and returns the class.
  3. A metadata store feeds the designer. The designer’s palettes (which controls a field may use, which widgets a page may hold) are built from the registered metadata. A component marked as a custom plugin is offered to a tenant’s builders only if that tenant has it installed; built-in components are always offered. One web bundle, different capabilities per tenant.
  4. Host directives draw fields. Wherever a form shows a field, a small host element reads the field’s edit (or view) component name, asks the registry for it, creates it, and passes it the field, the record’s context and the builder’s options. It rebuilds only when the component name changes.
flowchart LR
  F["field definition<br/>renderOptions:<br/>editComponent = 'DateComponent'"] --> H["host directive<br/>in the form"]
  H -->|"name"| R["registry"]
  R -->|"lazy-load once"| P["plugin bundle"]
  P --> C["the component class"]
  C --> H
  M["component metadata<br/>(types, options, flags)"] --> D["designer palettes"]
  P --> M

What to notice: the same string links the stored field to the designer’s palette and to the code that draws it. Adding a component means adding a plugin entry and its metadata, not editing any screen.

Every edit control follows one contract: it is an Angular form control (the ControlValueAccessor agreement from M0-S1, with writeValue and the change callback) plus a validator, built on a shared base class from the platform’s plugin development kit. Widgets follow the same pattern: a view component and a configuration component registered as a pair, laid out on a twelve-column grid.

You will build in this system only on the source strand, in M8-S3, where you add a field control and see it offered in the designer. Everyone needs to know it exists, because it decides what can be drawn without code: anything the registered components can draw, a builder can configure; anything they cannot draw needs a new component.

The mobile app: a page tree and exhaustive switches

Section titled “The mobile app: a page tree and exhaustive switches”

The mobile app is a Flutter application written in Dart, built in layers (data, domain, presentation), with a domain package that mirrors the platform’s enumerations by number. It draws a page as a tree of components: groups (sections and columns) holding items (headings, text, media, links, documents, timelines, embedded data views, statistic summaries, navigation, and a few more).

  • Reading the metadata. Each component’s type arrives as a string. The app maps it to its own enumeration; a string it does not know becomes unknown, and its options are read as empty.
  • Drawing it. Three factories, each an exhaustive switch over that enumeration (M0-S1’s Dart rule, used on purpose): one per component, one for items, one for groups. Because the switches have no default, adding a new value to the enumeration breaks the build until every factory handles it. But a value the app chooses to ignore, and every unknown, is drawn as nothing.
  • Hiding empty things. A data-backed component that resolves to nothing (an empty timeline, an empty group) removes itself from the page.

Fields follow the same idea: the app has its own set of field components, keyed by the field’s type and component name, covering the field types an end user meets. Expressions run in its own JavaScript runtime with a reduced scope (M3-S1).

Parity: why the phone differs, and how to know

Section titled “Parity: why the phone differs, and how to know”

The web portal is the reference for behaviour; the app mirrors it, by hand, in another language. So differences come in predictable kinds:

Kind of differenceExample on LarkspurWhy
Not built for the phoneReports: no report viewer, and report links vanish from the sidebar and pagesA product decision: reports are web-only
A display not implementedA view whose default face is mini card shows an empty areaThe app’s mini-card case returns nothing
A component the app ignoresA page widget from a plugin the app does not know draws nothingUnknown component strings become unknown
A field with no mobile controlA JSON field has no rendererNot every web control has a mobile twin
A runtime differenceA default of scope.today('+2d') is empty on the phoneThe mobile expression scope lacks the date and identity helpers (M3-S1)
An interaction that does not persistReordering a board’s columns on the phoneCard moves persist; column order does not
Device-only featuresPush notifications, camera QR scanning, locationNative capabilities the browser does not have

The rule for a master is that parity is a property of a design, checked, not assumed. A page or view that a field technician depends on is audited on the phone before it ships: each component either appears and works, or its absence is a known, accepted decision with a web alternative. In M7-S3 and M8-S4 this audit is part of the no-code proof.

▶ Guided demo (10 min) — One field, followed from metadata to screen

Section titled “▶ Guided demo (10 min) — One field, followed from metadata to screen”

In Larkspur Dev, browser and phone side by side.

  1. Read the Planned Date field’s render options on Work Orders through the API: curl -s -H "x-app-token: $TOKEN" "$BASE/api/v1/entities/work_orders" | jq '.result.fields[] | select(.normalizedName=="planned_date") | .renderOptions'. Note the edit and view component names.

  2. In the browser, open a work order and the developer tools’ Network tab, filtered to .js. Open Planned Date’s date picker: a component bundle is loaded on first use, not before.

  3. Open Administration › Applications › Modules › Asset Maintenance › Work Orders, add a temporary field, and open its control list: every entry is a registered component’s metadata. Cancel without saving.

  4. Open Operations Command in the browser, then on the phone. Count the widgets on each.

  5. On the phone, open the sidebar: the Monthly Maintenance Report link that the browser shows is not there.

  6. Open Asset Maintenance › Spare Parts on the phone: its default face is mini card, and the list area is empty. Switch to table: the parts appear.

    Screenshot pending The Spare Parts view on the phone with the mini card display selected and an empty list area, beside the same view in the browser showing mini cards What to notice: nothing is wrong with the data or the view; the phone simply has no drawing for that display type.

PracticeChoose one answer.

A custom plugin’s field control is installed for one Larkspur space’s tenant but not for another tenant that shares the same web portal build. What do the two tenants’ builders see?

  1. Explanation for A

    ✓ Correct

    Correct: custom components are filtered by the tenant’s installed plugins; built-ins are always offered. See The web portal.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the designer offers a custom plugin’s components only where it is installed. See The web portal.

  3. Explanation for C

    ✗ Incorrect

    Not this one: one bundle serves every tenant; installation decides what is offered. See The web portal.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticeChoose one answer.

A new release adds a widget type to pages. The mobile app in people’s hands is older and does not know the new type’s string. What happens when a page with that widget opens on the phone?

  1. Explanation for A

    ✗ Incorrect

    Not this one: unknown strings are mapped to an unknown component on purpose. See The mobile app.

  2. Explanation for B

    ✓ Correct

    Correct: an unknown type becomes unknown, with empty options, and draws nothing. See The mobile app.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the app draws only the components compiled into it. See The mobile app.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

Why does a view configured once show the same display type on the web and the phone?

  1. Explanation for A

    ✗ Incorrect

    Not this one: the server sends metadata; each client draws it. See What the server sends.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the phone draws with its own Flutter components. See The mobile app.

  3. Explanation for C

    ✓ Correct

    Correct: the display type is stored as a number that both clients map identically. See What the server sends.

Check your answer

The correct answer is C. Open the explanation under each option to see why.

⛏ Lab (24 min) — Parity audit: Operations Command and the Work Orders board

Section titled “⛏ Lab (24 min) — Parity audit: Operations Command and the Work Orders board”

Goal. A parity audit of two things field people depend on, with each difference explained by its engine and given a decision: fix, accept with a web alternative, or redesign.

Before you start. Larkspur Dev in the browser as Rami Aziz and on the phone as maya.idris. A file m3-s5-parity.md with a table: item, web, phone, kind of difference, cause, decision.

Operations Command

  1. Open Operations Command in the browser. List every widget, top to bottom, with its type (counter, chart, data view, link, heading…).
  2. Open it on the phone. For each widget in your list, record: same, different, or missing.
  3. For each difference, decide its kind from the Concept’s table and write its cause.
  4. Open the sidebar on both, and compare the links under Asset Maintenance.

The Work Orders board

  1. In the browser, open Asset Maintenance › Work Orders and switch to the board (Kanban) face. Note its columns (the workflow steps) and each card’s title.

  2. On the phone, open the same view’s board.

    Screenshot pending The Work Orders board on the phone, with columns for the workflow steps and a card per work order showing its title What to notice: the columns are the workflow’s steps, as in the browser; dragging a card persists, reordering columns does not.

  3. On the phone, drag Inspect bearing noise on C-201 to the next column; refresh in the browser.

  4. On the phone, reorder two columns; refresh both.

  5. On the phone, start a new work order from the board and compare its form with the browser’s, field by field (including Target Finish from M3-S1).

Decide

  1. For each difference, write a decision: fix (how, in configuration), accept (and the web alternative a technician uses), or redesign.
  2. Pick the one difference most likely to cause a mistake in the field, and say why.
  3. Write a three-line parity checklist Larkspur’s builders should run before publishing anything a technician uses.
  4. Note anything that differed that the Concept’s table does not explain, and keep it for the facilitator’s Q&A or your report.

Check.

  • Every widget of Operations Command is listed with its web and phone state.
  • Every difference has a kind and a cause from the Concept.
  • Steps 7 and 8 record which board change persisted and which did not.
  • Every difference has a decision; the riskiest is named with a reason.
  • The builders’ checklist has three concrete checks.

Pass condition. All five checks hold, and the audit found at least the report link, the mini-card display and the board’s column order.

If something goes wrong

What you seeWhat to do
Operations Command is not on the phone’s homeOpen it from the sidebar; pages are listed under their module, or ask whether it is pinned for Maya’s groups.
The board face is not offeredThe view needs the board display enabled and a Main title set for cards; check the view’s settings in the browser (a builder’s fix, already done in the seed).
The phone shows a different set of work ordersMaya sees only what her access allows; compare with Rami’s view in the browser carefully, or sign in as Maya in a private browser window too.
A widget differs in a way you cannot explainRecord it exactly (screenshot on both) for the facilitator’s Q&A; it may be a product discrepancy worth reporting.
Model answer

Operations Command (typical result).

ItemWebPhoneKindCauseDecision
Counters (open, urgent, overdue work orders; open non-conformances)shownshownsameStatistic summaries are drawn by bothnone
Spend by Supplier chartshownshownsameDrawn by bothnone
Data view of today’s work orderstabletablesameData-view widget drawn by bothnone
Monthly Maintenance Report linkshownmissingnot built for the phoneReports are web-onlyAccept; technicians do not need it; leads use the web
Sidebar report link under Asset Maintenanceshownmissingnot built for the phoneReport links are filtered out on mobileAccept

Work Orders board. Card move persisted (the step changed, the browser shows it after a refresh); column reorder did not persist. The new work order’s form: same fields, but Target Finish empty on the phone (runtime difference, M3-S1).

Elsewhere (from the demo): Spare Parts defaults to mini card, empty on the phone: fix in configuration by making table the view’s default face, keeping mini card as an option for the web.

Riskiest: Target Finish empty on the phone, because a work order created in the field silently gets no target date and drops out of overdue reporting. Fix: compute it on save on the server (a locked calculated field with an On save trigger and New entries scope), not as a form default.

Checklist. (1) Open every page and view a technician uses on the phone, with a technician’s account, and compare it with the browser. (2) No default face that the phone cannot draw (mini card); no report as the only route to information a technician needs. (3) No form default that uses scope date or identity helpers unless the server recomputes the field on save.

✓ Practice (5 min) — Predict the phone

Section titled “✓ Practice (5 min) — Predict the phone”
PracticeChoose one answer.

A builder puts the only link to the Shift Handover report on the technicians’ landing page. What do technicians see on their phones?

  1. Explanation for A

    ✓ Correct

    Correct: reports are web-only and their links are filtered out on mobile. See Parity.

  2. Explanation for B

    ✗ Incorrect

    Not this one: there is no report viewer on mobile. See Parity.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the app maps report links to an unsupported placeholder and hides them. See Parity.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticeChoose one answer.

A builder asks why a page widget is laid out “in twelfths”. What is the reason?

  1. Explanation for A

    ✗ Incorrect

    Not this one: the grid belongs to the web’s widget system; the phone stacks components. See The web portal.

  2. Explanation for B

    ✓ Correct

    Correct: the widget system lays out pages on a twelve-column grid. See The web portal.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the twelve is a width grid, not a count of widgets. See The web portal.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

The mobile team adds a new display type to the app’s enumeration but forgets one of the three render factories. What happens?

  1. Explanation for A

    ✗ Incorrect

    Not this one: that would happen with a default case; the factories have none. See The mobile app.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the problem is caught before the app runs. See The mobile app.

  3. Explanation for C

    ✓ Correct

    Correct: exhaustive switches with no default turn a missing case into a build error. See The mobile app.

Check your answer

The correct answer is C. Open the explanation under each option to see why.

PracticeChoose one answer.

A repeatable block Checklist on Maintenance Plans renders on both clients. Which is the reliable way to know that a new kind of block field will work on the phone before release?

  1. Explanation for A

    ✓ Correct

    Correct: parity is checked, not assumed; an unsupported control would show nothing. See Parity.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the phone has its own field components, mirrored by hand. See The mobile app.

  3. Explanation for C

    ✗ Incorrect

    Not this one: storage is shared; drawing is each client’s own work. See What the server sends.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

↺ Recap (1 min) — After Module 3 you can

Section titled “↺ Recap (1 min) — After Module 3 you can”

After this module you can predict how expressions, queries, statistics, composite read models and search behave, diagnose each from a symptom to its cause with evidence, and explain how the web portal and the mobile app draw them, auditing a page for parity before it reaches the field.

Next. In M4 you open the process engines: the scheduler, reactions, workflows, owners and time limits, the engines that act on these records without anyone opening a screen.