This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
Developers spend eight or more hours a day reading dense source code, logs, and technical specs, yet almost everyone leaves their editor at an arbitrary default font size and line width. When typography is slightly too cramped or lines stretch too wide, readers unconsciously drop their blink cadence, narrow their eyelids, tighten their brow, and lean closer to the monitor.
I built TypeGauge, a privacy-first Electron desktop optical ergonomics bench powered by @smartspectra/node-sdk@3.5.0. Instead of guessing whether 13.5px or 16px feels comfortable, TypeGauge runs a short, structured calibration session against your own seated neutral posture:
-
Setup and Neutral Baseline (
/setup): Grants explicit two-part camera consent, checks SmartSpectra camera readiness with outbound SDK telemetry off by default, and captures a 15-second neutral posture reference inside a vector-only Collimator Chamber. -
Optical Trial Bench (
/bench): Walks through three standardized typography presets across real TypeScript code, technical prose, or your own pasted text, with instant toggles across Daylight Paper (#F7F9FC), Muted Slate (#1E2733), and Night Editor (#10161F) surfaces and a livech/pxvernier measure ruler:-
Compact:
13.5px/1.42line-height /56ch -
Balanced:
15.5px/1.60line-height /66ch -
Open:
17.5px/1.72line-height /76ch
-
Compact:
-
Profile Comparison and Developer Export (
/profiles): Ranks each preset strictly against your personal neutral baseline with accessible SVG bullet and strain-delta charts, then exports ready-to-paste VS Codesettings.json, Browser User Stylesheet (.css), and a Markdown calibration report (.md). -
Calibrated Reading Room (
/reader): Applies your winning profile immediately to local.md,.txt, or source files, with an optional, default-disarmed peripheral posture and blink drift guard. -
Local Audit and Vault (
/privacy): Displays every local JSON file on disk, verifiesRaw video frames saved: 0, and offers one-click JSON archive export or complete vault deletion.
TypeGauge is strictly a workplace display and typography ergonomics tool and makes zero medical or optometry claims.
Demo
- Demo Video (YouTube): https://youtu.be/yiJLNlcKMvc
- Live Zero-Credit Web Preview: https://typegauge.vercel.app/ (runs deterministic Fixture Replay in any browser at 0 API credits so judges can inspect all 5 routes, charts, exporters, and reading room immediately without installing desktop binaries).
-
Full Desktop App: Runs live webcam capture with
@smartspectra/node-sdk@3.5.0via Electron (npm run devorlaunch-typegauge.baton Windows).
Code
Pizzylee001
/
TypeGauge
Desktop optical ergonomics bench that calibrates editor and browser typography from live Presage SmartSpectra eye and posture signals.
TypeGauge
A desktop optical ergonomics bench that calibrates your editor and browser typography from live eye and posture signals.
Ergonomics notice: TypeGauge evaluates display typography comfort relative to your own neutral desk baseline. It does not perform medical, clinical, or optometry screening, diagnosis, or treatment.
Contents
- The Problem
- How It Works
- Visual Tour (All Five Routes)
- Real Config Outputs
- SmartSpectra Signal Pipeline
- Project Architecture
- Setup and Running Locally
- Static Web Preview on Vercel
- Consent, Privacy, and Data Handling
- Credit-Respectful SDK Lifecycle
- Troubleshooting
- Verification
- License and Acknowledgments
The Problem
Developers, technical writers, and students choose editor font sizes, line heights, column widths, and dark or light themes by glancing at them for five seconds. Hours later, cramped 13.5px code or mismatched contrast quietly cuts their blink rate, narrows their eyelids, tightens their brow, and pulls their head closer to the display.
Break timers interrupt work without fixing the unreadable layout. Self-rating…
Repository: https://github.com/Pizzylee001/TypeGauge (MIT Licensed, 25/25 automated Vitest engine tests passing).
Full installation steps, .env setup, Windows x64 Visual C++ 2015-2022 Redistributable prerequisite, and Electron desktop launch instructions are documented in the repository README.md.
How It Responds to Human Signals
TypeGauge bridges @smartspectra/node-sdk@3.5.0 across Electron's main, preload, and renderer processes (bindSmartSpectraIpc from @smartspectra/node-sdk/main, exposeSmartSpectraPreload from @smartspectra/node-sdk/preload, and SmartSpectraRendererClient + protobuf decoders from @smartspectra/node-sdk/renderer and @smartspectra/node-sdk/messages). Decoded telemetry frames feed a pure, tested TypeScript signal engine (src/engine/) in real time:
-
Blink-Excluded Eye-Aperture Squint (
FACE_LANDMARKS+BLINKING): Computes bilateral Eye Aspect Ratio (EAR) from MediaPipe eye landmark indices ([33, 160, 158, 133, 153, 144]left and[362, 385, 387, 263, 373, 380]right), handling both integer pixel coordinates (1280x720) emitted by native Windows hardware capture and normalized0..1coordinates. Baseline EAR uses the robust median, and trial squint deltas explicitly exclude frames whereblinkingDetected === trueso healthy blinking never registers as squinting. -
Distance-Invariant Brow Compression (
FACE_LANDMARKS): Measures vertical brow-to-lid span ([105, 159]and[334, 386]) divided by outer-corner inter-pupillary distance ([33, 263]), isolating brow tension from head distance changes. -
Forward Head-Lean Drift (
FACE_LANDMARKS): Compares live inter-pupillary distance (IPD) againstbaselineIpdto compute percentage forward drift toward the screen. In/reader, when the user explicitly arms the drift guard, sustained forward lean (+10%) or blink suppression triggers a calm 2px peripheral amber header rule rather than an intrusive popup. -
Blink Cadence and Stare Intervals (
BLINKING): Counts rising edges ofblinkingDetectedto calculate rolling blinks per minute (blinkPerMin), delta vs. neutral baseline, and longest unblinked stare gap in seconds. -
Stability-Gated Pulse and Optional Breathing (
PULSE_RATE, optionalBREATHING_RATE): Numeric cardio and breathing figures stay masked (--,Stabilizing...) until SmartSpectra emitsstable === true(around 12s for pulse and 30s for breathing). Breathing defaults off for seated laptop webcams where the upper chest is cropped, and users can opt in from/setup. -
Network Resilience and Pre-Warm: Electron pre-warms DNS/TLS to Presage's API endpoints before session start, and if a high-latency link drops mid-block after
>= 10valid landmark frames arrive, the UI preserves the partial capture so users never lose calibration progress. -
Baseline-Relative Verdict Scoring:
synthesizeVerdict()scores every tested preset relative to the user's own neutral baseline across blink suppression, squint increase, brow compression, forward lean past5%, and stable pulse elevation, generating plain-language rationale and drop-in VS Codesettings.json/ Browser.cssconfigs.
Prize Categories
- Best Thoughtful Real-World Use (primary category): Translates non-invasive webcam physiological signals into concrete, everyday VS Code and browser typography configurations that developers actually paste into their workflow, with strict privacy and non-medical boundaries.
-
Most Creative or Delightful Use: Treats typography ergonomics like a precision Swiss optical instrument, replacing invasive webcam previews with a recessed 478-point vector Collimator Chamber, live
ch/pxvernier measure ruler, and baseline-relative Comfort Index bullet charts.
Consent and Data Handling
-
Explicit Two-Part Consent Before Capture: Live camera capture stays locked on
/setupuntil the user affirmatively checks two separate boxes acknowledging (1) RAM-only local landmark processing with zero video or image storage and (2) non-medical typography ergonomics scope, then clicks Grant Camera Consent. Consent can be revoked anytime on/setupor/privacy. -
Video-Only Electron Permissions:
session.defaultSession.setPermissionRequestHandlerpermitsmediaaccess strictly whenmediaTypesrequests video without audio from the localfile://bundle orhttp://localhostdev origin. Microphone/audio access is always denied. -
Zero Raw Video Frames Saved: Video frames travel through Electron's in-memory
MessagePortfor landmark extraction and are never written to disk or transmitted to any third-party storage. The UI displays vector landmarks only (Raw video frames saved: 0is audited live on/privacy). -
SDK Telemetry Disabled by Default:
enableTelemetrydefaults tofalseacross the entire application. Users can opt in or out on/setupor/privacy, with plain disclosure that enabling Presage SDK telemetry sends aggregate session summaries and device readiness context without raw video frames or measured vitals. -
Local JSON Storage, Export, and Full Wipe: Derived numeric summaries and saved typography profiles are stored locally under
app.getPath('userData')/typegauge-data/(consent.json,baseline.json,trials.json,profiles.json,documents.json) in Electron, or browserlocalStoragein the web preview./privacyshows exact record counts and byte sizes, exports the full archive as JSON, and deletes all local records and any saved runtime API key in one confirmed action. - Zero External AI Services: Every calculation (EAR, brow ratio, IPD head-lean, blink counting, verdict ranking, and VS Code/CSS/Markdown export) runs deterministically and locally in TypeScript. No external LLM or AI API is called at runtime.



Top comments (0)