Feature Library

Field rules: when a person must check

0.47 CPU ms
A still of the Field rules: when a person must check demo
Still
The live demo starts when it’s in view.Edit any value on the receipt · break the total, the date or the receipt number · change this layout’s rules in the panel

Decides, for every value read from a document or a form, whether it can be written or a person must look, and says why in plain English.

What it costs a frame

0.47 ms
GPU
not used
CPU, median
0.47 ms
CPU, 95th pct
0.78 ms
Draw calls
0
Weight
Light

Measured 13 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 0.42–0.59 ms). What ran: Measured with the demo editing itself: every frame it types one character into the total (then takes it out again), so each frame runs the whole check (six fields, three lines, the sum and the date rules) and repaints the receipt’s marks and the step table. Nothing runs while nothing is typed. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed0.470.78
apple · Apple A19 Proin a browser tab · 16 November 2026not timed0.701.90
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed0.681.00

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Reading receipts, statements and forms into a table
  2. Deciding which imported rows need a person
  3. Checking that line items add up to a total
  4. Amounts and dates typed in any common format
  5. Rules per sender, supplier or layout over shared defaults
  6. Messages a person can act on, not error codes

Pitfalls, in brief

  1. “1,234” is read as 1.234 when the decimal mark is guessed, as in the source (a lone comma is a decimal comma).
  2. A table skips blank rows, but its messages count lines as given (“line 3” is the third row passed in).
  3. Dates come back as YYYY-MM-DD strings, never Date objects, so no time zone moves them a day.
  4. A pattern must match the whole text (it is wrapped in ^(?:…)$); an extract pattern needs only to be found, and returns its first capture group.
  5. Patterns are compiled from strings on every check.
3 more in brief
  1. The sum check is skipped while a part of it is missing or wrong, because that part is reported already; a record can be wrong twice and show one problem until the first is fixed.
  2. Overrides with an unknown key, an empty value or a value the rule doesn’t allow are ignored (resolveRules), so stale settings fall back to the default silently.
  3. Messages quote the text they saw.
8 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From My other apps. Fully custom code.

validationparsingregexnumbersdatesdecimal commacurrencytotalsline itemsrulesdefaults and overridesplain-English messagesreviewimportingestOCRpuretestedno dependencies

Near it in the frame