Skip to content
opsinjs
Edit this page

Patterns

Daily logging

Repeated entry designed for the ninetieth entry rather than the first, where every saved second compounds and every extra field costs adherence

The same person records the same thing for months, such as a blood pressure reading each morning or a dose taken. The target is three taps from the screen they are on: open, enter, save.

When to use it

Use it when the reader knows what the fields mean, most entries resemble the last one, and a missed day is expected rather than an error. Use something else for:

How it works

  1. Start where the person is. The log action sits on the metric's tile or detail screen as one target, at least 44pt, in the lower third.
  2. Open a sheet, not a screen. The field is focused with the right keyboard (inputmode="decimal" for a number), and the context stays visible behind it.
  3. Default the time, unit and metric. The time is now and editable, and the unit is the last one used. Never pre-fill the measurement, because that is how a log fills with numbers nobody measured.
  4. Warn, never block. A surprising value gets a question and still saves, because a real reading outside your expected span matters most.
  5. Confirm in place. The entry appears where it will live, with undo. No "Saved!" dialog, no detour to a trends screen, and no streak or praise for a body reading.
  6. Draw gaps as gaps. A missed day is never interpolated, carried forward or styled as a status.

Decide per metric whether a second entry for one slot replaces the first, sits beside it or is refused. Say which before the person types.

StateBehaviour
DraftKept through an interruption and restored with "you had started this"
Queued offlineVisible, marked as not yet synced, with the time it was made
ConflictEntries from two devices are both kept and shown, never silently merged
FailedThe value is never lost. The reader is told, and the retry is automatic

NOT IMPLEMENTED. This component does not exist in any released version of opsinjs. There is no package to install, no module to import and no props interface to generate code against. Everything on this page is a specification of intended behaviour and may change without notice. Do not write code against it.

This component is not built yet

There is nothing to render because there is nothing to install. What you can read on this page is the specification the implementation will have to satisfy.

PlannedRoadmapWhat “planned” means

Components

Build a log entry

import { LogSheet } from "@/components/ui/log-sheet"
import { ReadingInput } from "@/components/ui/reading-input"

<LogSheet
  open={open}
  onOpenChange={setOpen}
  title="An example entry"
  values={{ reading }}
  saveLabel="Save the example entry"
  onSave={(entry) => store(entry)}
>
  <ReadingInput
    label="Example measurement"
    unit={unit}
    units={["kg", "lb", "st"]}
    precision={1}
    value={reading}
    warning={warning}
    onChange={(next) => {
      setReading(next.value)
      setUnit(next.unit)
    }}
  />
</LogSheet>
  • LogSheet never reads its children. onSave receives your values verbatim, so an empty entry still arrives and the emptiness check is yours.
  • warning is a sentence you write from bounds you own. It never marks the field invalid or blocks the save.
  • A unit switch can convert or clear the number without anybody typing, and ReadingInput mounts no live region. Announce next.effectText politely whenever it is not null.

Example

Viewport width
Theme
Accent theme
Accent

NOT IMPLEMENTED. The opsinjs component `daily-log-screen` does not exist in any released version of opsinjs. There is no package to install, no module to import and no props interface to generate code against. Everything on this page is a specification of intended behaviour and may change without notice. Do not write code against it.

daily-log-screen is not built yet

This frame will embed /view/base/base-lyra/screen/daily-log-screen?mode=light, which renders under the product theme rather than the documentation chrome. There is nothing at that address yet.

PlannedRoadmapWhat “planned” means

Phone · 390px · /view/base/base-lyra/screen/daily-log-screen?mode=light

The daily log screen is still a specification, so its frame shows the not-built notice. Its one lifted surface holds today's reading or an honest empty state.

Accessibility

  • Focus moves into the sheet on open and is trapped while it is modal. Escape dismisses it, and focus returns to the control that opened it.
  • The unit is part of the field's accessible name, as in "Systolic, in millimetres of mercury".
  • The save is announced politely, and undo stays reachable by keyboard while it is offered.
  • The keyboard never covers the save, and typed input survives rotation and backgrounding.
  • Every gesture has a labelled control, and a stepper is never the only way to enter a number.