From 0fc04909a8b436386c9a998a27e2dada41a55bf0 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 26 Jul 2026 11:38:08 +0200 Subject: [PATCH] docs(plugin): spell out what blurBookingCodes does, and preview it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The context table listed the new field without saying what a plugin is meant to do with it. It is a display hint — booking codes still arrive in full over trek:invoke — and reading it as redaction is the one mistake worth preventing. The dev preview hardcoded it to false, so the blurred path was the only host flag an author could not try out; it gets a toggle like reduce motion and the rest. --- plugin-sdk/src/cli/dev.ts | 5 +++-- wiki/Plugin-Development.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin-sdk/src/cli/dev.ts b/plugin-sdk/src/cli/dev.ts index 2215869e..e9c4ff74 100644 --- a/plugin-sdk/src/cli/dev.ts +++ b/plugin-sdk/src/cli/dev.ts @@ -634,6 +634,7 @@ iframe{width:100%;border:0;background:transparent;min-height:120px;display:block +
@@ -658,7 +659,7 @@ function ctx(){ tripId: val("trip").checked?${tripId}:null, userId:"1", user:{name:"Dev User",avatar:null,isAdmin:true}, appearance:{scheme:accent,density:"comfortable",reducedMotion:val("rm").checked,noTransparency:val("nt").checked}, - formats:{locale:"en",currency:"EUR",timeFormat:"24h",distanceUnit:"metric",temperatureUnit:"celsius",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,blurBookingCodes:false}, + formats:{locale:"en",currency:"EUR",timeFormat:"24h",distanceUnit:"metric",temperatureUnit:"celsius",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,blurBookingCodes:val("blur").checked}, tokens:tokens}; } function postCtx(){ if(f.contentWindow) f.contentWindow.postMessage(ctx(),"*"); } @@ -698,7 +699,7 @@ window.addEventListener("message", function(ev){ } }); var geoTick=null; -["theme","accent","rm","nt","trip"].forEach(function(id){ val(id).addEventListener("change",postCtx); }); +["theme","accent","rm","nt","blur","trip"].forEach(function(id){ val(id).addEventListener("change",postCtx); }); f.addEventListener("load", function(){ f.style.height="120px"; postCtx(); }); var __v; setInterval(function(){ fetch("/__dev/version").then(function(r){return r.text();}).then(function(v){ if(__v&&v!==__v){ f.src=f.src; } __v=v; }).catch(function(){}); },1000); diff --git a/wiki/Plugin-Development.md b/wiki/Plugin-Development.md index be0e9224..3d3155bf 100644 --- a/wiki/Plugin-Development.md +++ b/wiki/Plugin-Development.md @@ -533,7 +533,7 @@ declared), no popups. | `locale` | e.g. `'en'` | | `hostOrigin` | the app origin | | `user` | `{ name, avatar, isAdmin } \| null` — **never** an email; role only as a boolean | -| `formats` | `{ locale, currency, timeFormat, distanceUnit, temperatureUnit, timezone, blurBookingCodes }` | +| `formats` | `{ locale, currency, timeFormat, distanceUnit, temperatureUnit, timezone, blurBookingCodes }` — `blurBookingCodes` mirrors the user's "blur booking codes" preference so your UI can hide confirmation numbers until they're revealed. It is a **display hint, not redaction**: the codes still reach your plugin in full over `trek:invoke`. | | `tokens` | TREK's resolved CSS design tokens for the current theme (see below) | | `appearance` | `{ scheme, density: 'comfortable'\|'compact', reducedMotion, noTransparency }` |