getobsrv 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/bin/obsrv-mcp.js +19 -0
- package/bin/obsrv.js +73 -0
- package/out/cli/args.js +204 -0
- package/out/main/cli.js +600 -0
- package/out/main/index.js +539 -0
- package/out/main/targetSource-w_vWw7zd.js +351 -0
- package/out/mcp/lib.js +175 -0
- package/out/mcp/server.js +301 -0
- package/out/preload/app.js +87 -0
- package/out/preload/sync.js +41 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/out/renderer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/out/renderer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/out/renderer/assets/index-BAEO9_6W.js +14460 -0
- package/out/renderer/assets/index-VleEBVgL.css +446 -0
- package/out/renderer/index.html +13 -0
- package/out/shared/calibration.js +41 -0
- package/out/shared/presets.js +47 -0
- package/out/shared/types.js +2 -0
- package/package.json +62 -0
- package/skills/obsrv-screens/SKILL.md +80 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: obsrv-screens
|
|
3
|
+
description: Check how a site or CSS change actually looks on the screens users own — 1080p desktops, 1366×768 laptops, Chromebooks, budget Android phones, cheap TN panels — before declaring frontend work done. Use for screen-size testing, low-DPI legibility, vanishing hairlines, weak thin fonts, grey-on-grey text, mobile rendering at true device DPR, or any "does this hold up on a normal screen?" question.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# obsrv-screens — see your pages the way 1x screens see them
|
|
7
|
+
|
|
8
|
+
Obsrv renders any URL in an offscreen Chromium surface at a *target screen's*
|
|
9
|
+
true raster density — a real 1x raster for monitor presets (not your HiDPI
|
|
10
|
+
monitor's pixels resampled), the device's real 2x/3x DPR plus mobile UA and
|
|
11
|
+
viewport semantics for phone presets — with optional cheap-panel simulation
|
|
12
|
+
(contrast floor, sRGB coverage, 6-bit + FRC dithering, brightness). Dev-tools
|
|
13
|
+
emulation only changes the viewport; Obsrv changes the rasterisation, which is
|
|
14
|
+
where thin fonts, 0.5px hairlines, and low-contrast grey text actually break.
|
|
15
|
+
|
|
16
|
+
## Commands
|
|
17
|
+
|
|
18
|
+
Prerequisite: `npm run build` must have been run in the Obsrv repo (the CLI
|
|
19
|
+
runs the built `out/`). If a snap fails with "out/main/cli.js is missing", run
|
|
20
|
+
`npm run build` in `/Users/opeyemiajagbe/Documents/Projects/Obsrv` first.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
OBSRV=/Users/opeyemiajagbe/Documents/Projects/Obsrv/bin/obsrv.js
|
|
24
|
+
|
|
25
|
+
# One screen, one PNG (+ JSON metadata on stdout, humans on stderr):
|
|
26
|
+
node $OBSRV snap http://localhost:5173 --preset laptop-768 --out shots/laptop.png
|
|
27
|
+
|
|
28
|
+
# The recommended matrix — small laptop, budget phone, 1080p desktop:
|
|
29
|
+
node $OBSRV snap http://localhost:5173 --matrix laptop-768,android-65,1080p-24 --out shots/
|
|
30
|
+
|
|
31
|
+
# Worst realistic panel (cheap TN) on the small laptop:
|
|
32
|
+
node $OBSRV snap http://localhost:5173 --preset laptop-768 --profile budget-tn --out shots/laptop-tn.png
|
|
33
|
+
|
|
34
|
+
# Whole page, not just the first viewport (device px cap 4096, warns if clamped):
|
|
35
|
+
node $OBSRV snap http://localhost:5173 --preset laptop-768 --full-page --out shots/full.png
|
|
36
|
+
|
|
37
|
+
# Numbers instead of eyeballs: 1x target vs a 2x-reference downsample, JSON to stdout:
|
|
38
|
+
node $OBSRV diff http://localhost:5173 --preset laptop-768 --out-dir shots/diff
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`node $OBSRV --help` lists every preset (`1080p-24`, `laptop-768`,
|
|
42
|
+
`android-65`, `iphone-61`, …), profile (`reference`, `office-ips`,
|
|
43
|
+
`budget-tn`, `old-laptop`), and flag (`--width/--height/--dsf`, `--wait`,
|
|
44
|
+
`--timeout`).
|
|
45
|
+
|
|
46
|
+
If the obsrv MCP tools are connected (`obsrv_snap` / `obsrv_diff` /
|
|
47
|
+
`obsrv_presets`), prefer them over shelling out — same pipeline, and the PNG
|
|
48
|
+
comes back inline.
|
|
49
|
+
|
|
50
|
+
## The loop that catches real regressions
|
|
51
|
+
|
|
52
|
+
1. Snap the dev URL across `--matrix laptop-768,android-65,1080p-24`, plus a
|
|
53
|
+
`--profile budget-tn` snap of the most text-heavy screen.
|
|
54
|
+
2. **Read each PNG and judge it like a user**: Is thin (300-weight) text still
|
|
55
|
+
readable or gone fuzzy-grey? Do 0.5px hairlines/dividers still separate
|
|
56
|
+
anything? Is grey-on-grey copy legible with the contrast floor? Do
|
|
57
|
+
gradients band? Did the mobile preset get the mobile layout?
|
|
58
|
+
3. Run `diff` on suspect pages for numeric confirmation: `inkCoverage.delta`
|
|
59
|
+
(negative = the 1x render is losing ink — strokes weakening), `rows.ratio`
|
|
60
|
+
(≈0.5 is normal glyph scaling; hairlines contribute 1 row at any density),
|
|
61
|
+
per-band deltas and humanised `findings`.
|
|
62
|
+
4. Fix the CSS (heavier weight, ≥1px borders, more contrast), re-snap the same
|
|
63
|
+
presets, compare.
|
|
64
|
+
|
|
65
|
+
Don't declare frontend work done on visual grounds until step 2 has actually
|
|
66
|
+
happened on the matrix snaps.
|
|
67
|
+
|
|
68
|
+
## Caveats
|
|
69
|
+
|
|
70
|
+
- Rasterisation truth is **macOS Chromium**: it exposes hairline/weight/
|
|
71
|
+
contrast problems faithfully, but Windows ClearType text will differ.
|
|
72
|
+
- Panel profiles are principled approximations (documented transfer curves),
|
|
73
|
+
not colorimetry of one specific panel.
|
|
74
|
+
- `diff` is 1x-only in v1: dsf>1 presets and CSS viewports over 2048px exit
|
|
75
|
+
with an error. Its findings are informational — apply your own thresholds.
|
|
76
|
+
- `diff` cannot say "the hairline vanished": a 0.5px hairline renders one
|
|
77
|
+
device row at 1x *and* 2x. It reports ink deltas and row ratios; vanishing
|
|
78
|
+
is judged by reading the PNG.
|
|
79
|
+
- Animating pages never go paint-quiet; the capture takes the frame at
|
|
80
|
+
`--timeout` with a warning. Use `--wait` for late-settling content.
|