Bento Spaces documentation
Decision log
Locked decisions are not re-argued. If something must change, add a revision with the date and the reason, and update the doc that describes the behaviour.
Grid and layout
| # | Decision | Why | Status |
|---|---|---|---|
| D1 | One horizontal shelf per space, grows right, no rows | Removes 2D collision and reflow entirely | Locked |
| D2 | Shelf height = 4 boxes (one square) | Matches the 16-box model; keeps patterns uniform | Locked |
| D3 | Whole boxes only, minimum container 1×1 | A 0.5-wide sliver can never host content | Revised 2026-11-24 (was 0.5) |
| D4 | Three levels: space → container → widget. No nesting | Ambiguous drag semantics otherwise | Locked |
| D5 | Free placement, no auto-packing; gaps are intentional | Bento Spaces is composition, not masonry | Locked |
| D6 | Deleting leaves a gap and gaps are never closed automatically or manually; unused space is intentional | Nothing moves under your hand; whitespace is part of the composition | Revised 2026-11-24 (Close gap removed) |
| D7 | Inserting shifts every container at or after the seam by the pattern width | Single-axis reflow is trivial and predictable | Locked |
| D8 | Patterns are data (rect templates), not CSS grid areas | Testable, exportable, filterable by fit | Locked |
| D9 | Plain HTML/CSS/ES-module JS; .NET hosts it | User: "everything js based, storage is json", no Blazor | Locked |
| D10 | Layout is a versioned JSON document, not DB rows | Documents, snapshots, portability | Locked |
| D11 | Undo/redo snapshot stack from the first milestone | Retrofitting it later touches every mutation | Locked |
| D12 | Pattern/gap pickers filter by fit | Showing everything explodes the UI | Locked |
| D13 | Zero third-party dependencies | html/css/js/.net only; ask before any package | Locked |
| D15 | Empty space is a first-class box; its + opens a grouped "Fill this space" popup that enumerates every composition (copies, whole, rows, columns, cells, half+quarters, leave-one-empty, half, one cell, patterns on full-height seams) | User wanted the empty box to be fillable, then wanted to choose what fills it | Locked 2026-11-24 |
| D16 | A container never leaves its own 16-box square. Enforced by the client (drag/resize clamp + validation) and the server (422) since 2026-11-24. | Makes mobile stacking exact, keeps patterns predictable, and stops a board that edits locally from failing to save | Revised 2026-11-24 (was: containers may straddle) |
| D17 | A container is locked while it holds a widget: no move, resize or delete. Empty it first | Like a physical tray; prevents geometry changing under content | Locked 2026-11-24 |
| D18 | Widget drag: body moves the widget between containers anywhere; illegal target dims to 50% with a red border and refuses; empty space snaps back; a filled target swaps when both fit | User's interaction model, tested against edge cases | Locked 2026-11-24 |
| D19 | Widget size contract: exact sizes + optional stretch | Developers draw real layouts; no guessing | Locked 2026-11-24 |
| D20 | View mode by default, edit mode behind a toggle beside the account avatar, remembered per device | The webtop is a daily surface, not a designer | Locked 2026-11-24 |
| D21 | layout.json holds positions only; widget files hold type/version/props; join by container id | Two revisions per space; drags never fight settings | Locked 2026-11-24 |
| D29 | Phone renders each 4×4 block as a screen, scrolled vertically | Consequence of D16; no heuristics | Locked 2026-11-24 |
| D30 | Panel profile: 32:9 side rails, unit from viewport height, kiosk route, idle lock default lock | The 14.5" 2560×720 touchscreen is a target surface | Locked 2026-11-24 |
Storage, accounts, sharing
| # | Decision | Why | Status |
|---|---|---|---|
| D14 | Repo: source/Bento.Api, top-level web/, tests/, published/ (IIS), archive/ (zip rollbacks), docs/ | User's layout; recovery from a bad upload is one unzip | Revised 2026-11-24 (was src/ + htdocs/) |
| D22 | Sharing is per space, not per person. No profiles, no credential intake. | Revised after review: simpler, and the board is the thing being shared | Revised 2026-11-25 (was profiles) |
| D23 | Share links: unguessable token → one space; stored hashed, revocable, read-only session, idle lock + owner-set PIN | Sharing without exposing accounts | Revised 2026-11-25 |
| D31 | Storage split: App_Data/private (accounts, secrets, sessions, tokens) never synced; App_Data/data safe to put in iCloud/Dropbox/OneDrive | Keeps cloud sync from publishing hashes and tokens | Locked 2026-11-24 |
| D26 | Installed widgets belong to a user, usable in all their spaces, invisible to others | User's scope choice | Locked 2026-11-24 |
| D28 | Anonymous PWA first; an account adds sync and sharing | Lowest friction, works offline, free funnel | Locked 2026-11-24 |
Widgets and marketplaces
| # | Decision | Why | Status |
|---|---|---|---|
| D24 | Federated registries; Official is the default source, any URL can be added | Users may prefer a specific marketplace | Locked 2026-11-24 |
| D25 | Hashes only (sha256 per version), no signatures or publisher vetting | "I don't need to check what he is calling for his own" | Locked 2026-11-24 |
| D27 | Declarative widgets first; code widgets later, sandboxed | Removes the session-theft class of risk while shipping | Locked 2026-11-24 |
| D31b | Module widgets run in an iframe without allow-same-origin + per-widget CSP | Sandbox is about not handing over the session, not about trust | Built in P5 |
Chrome and orientation
| # | Decision | Why | Status |
|---|---|---|---|
| D32 | **Orientation is per space per device**: horizontal (shelf grows right) or vertical (squares stack downwards). Device settings, keyed by space id; never stored on the server | A long panel may want vertical while a desktop wants horizontal for the same space; the vertical projection is also the phone layout | Revised 2026-11-24 (was server-side) |
| D33 | Two configurable docks, icon-only actions dock; spaces dock at top-centre / bottom-left / bottom-centre, actions at top-centre / top-right / bottom-right | User: every button in a dock, icons instead of text | Superseded by D56 2026-11-25 |
| D34 | Appearance auto / light / dark, device-local, default auto | User request; auto follows the OS | Locked 2026-11-24 |
| D35 | No separator lines under the top bar or above the dock | User: "lines we don't need" | Locked 2026-11-24 |
| D36 | Settings live in one dialog beside the docks; notifications will join it later | One place for preferences | Locked 2026-11-24 |
Module widgets
| # | Decision | Why | Status |
|---|---|---|---|
| D47 | Module widgets run in an iframe with sandbox="allow-scripts", no allow-same-origin | Isolation is not optional: code must never touch the session | Locked 2026-11-25 |
| D48 | The frame document is served by the host with its own CSP, authenticated by a short-lived frame token | Parent CSP blocks blob-document inline scripts, and opaque origins send no cookies | Locked 2026-11-25 |
| D49 | Modules have no network access (connect-src 'none') until the proxy exists | Data must flow through declared permissions, not straight from the frame | Revised by D59 2026-11-25 |
Widget data
| # | Decision | Why | Status |
|---|---|---|---|
| D59 | Widget data goes through a host proxy: installed manifest, declared origins, GET only, no cookies, no redirects, 8 s, 256 KB, public addresses only | A frame must never hold the session or reach arbitrary hosts, and a display must not leak its IP everywhere | Locked 2026-11-25 |
| D60 | The registry index is the consent: a manifest may narrow the advertised network/action permissions, never widen them | Otherwise a malicious registry could show a harmless prompt and ship a broader manifest | Locked 2026-11-25 |
| D61 | Declarative data uses a dot path and {{data}} / {{data:path}} / {{var:name}}; no JSONPath, headers or POST yet | Keeps the format reviewable and the proxy surface small | Locked 2026-11-25 |
| D62 | Module bridge gains request, open, refresh and gated setProps; open stays inside the declared origins | Modules need a capability surface, not raw network access | Locked 2026-11-25 |
| D63 | self may read static assets but never /api/* | Same-origin data should be the app's sample files, not an unauthenticated API surface | Locked 2026-11-25 |
| D84 | A declarative action requires permissions.connector, is refused at install without it, and posts through the connector proxy (path + JSON body only) | A dashboard should gain buttons without gaining a scripting surface; the consent list must name the capability before the install | Locked 2026-11-30 |
| D85 | OAuth is a provider config block, not per-provider code: authorization code + PKCE, single-use state, access/refresh tokens in the SecretStore, refresh inside the proxy before expiry | One flow for Google, Spotify and the mock; the client secret never leaves the server and a lapsed refresh is a visible oauth_reconnect | Locked 2026-11-30 |
| D86 | Declarative data.mode: "connector" reads through the connector proxy and needs the same permissions.connector as an action | Reading a device is as sensitive as switching it; one permission covers both, and the widget still cannot name a URL or a header | Locked 2026-11-30 |
Widget registries
| # | Decision | Why | Status |
|---|---|---|---|
| D42 | Installable widgets are declarative JSON interpreted by one runtime; no code executes | Safe by construction and reviewable in ten lines | Locked 2026-11-24 |
| D43 | Installs are hash-pinned and verified server-side; the index is fetched by the host | Hashes pin bytes without gatekeeping (D25); no CORS requirement on registries | Locked 2026-11-24 |
| D44 | A bundled example registry ships with the app | Lets the whole flow be tried and tested without hosting anything | Locked 2026-11-24 |
Space sharing
| # | Decision | Why | Status |
|---|---|---|---|
| D37 | A link shares one space, read-only, with no viewer accounts | User: "not profile sharing but Space sharing" | Revised 2026-11-25 |
| D38 | The owner sets the optional PIN when creating the link; there is no connect flow | Nothing to collect from other people | Revised 2026-11-25 |
| D39 | A link exchanges its token for a 12 h read-only session cookie; reads one space, never writes | Forwardable without exposing the account | Locked 2026-11-24 |
| D40 | Idle lock removes widgets from the DOM; PIN unlock is throttled | Opacity is not privacy | Locked 2026-11-24 |
| D45 | No guide-grid toggle. Edit mode draws a dashed outline per 4-box square with a round move handle (below in horizontal, left in vertical) that drags the square to reorder it | User: guides not needed; squares visible and movable | Revised 2026-11-25 |
| D46 | Undo/redo hide outside edit mode, and their shortcuts are ignored there | Editing tools leave with editing | Locked 2026-11-25 |
Surfaces
| # | Decision | Why | Status |
|---|---|---|---|
| D50 | The unit is the smaller of a density cap (clamp(80, width/18, 160)) and the viewport fill size, floored at 56 | A laptop keeps the 80 px design size; a short 32:9 panel fills its height; a phone fits its width | Revised 2026-11-25 |
| D51 | A narrow viewport (<720 px) stacks squares by default; an explicit per-device orientation still wins | The phone is the vertical case; no extra switch | Locked 2026-11-25 |
| D52 | A display pairing is a read-only shared view with Display = true at /display/{token}: no PIN, no idle lock, rails instead of top chrome | A kiosk must boot into content and never show a lock screen | Locked 2026-11-25 |
| D53 | Export is generated client-side as one HTML file with no JavaScript; module widgets become placeholders | A snapshot should be openable forever, not a second app | Locked 2026-11-25 |
Chrome and docks
| # | Decision | Why | Status |
|---|---|---|---|
| D56 | Two top docks split by ownership: the space's name and controls top-centre, settings and account top-right | Editing was hidden behind generic icons; space actions belong to the space | Locked 2026-11-25 |
| D57 | In view the space dock is name-only, expanding on hover, keyboard focus or a tap; edit mode pins it open | Keeps the viewing layout quiet without hiding the controls on touch | Locked 2026-11-25 |
| D58 | The space name moves out of the brand row into the space dock; pencil opens space details, grid/✓ toggles edit | Context and actions live together, and the name does not appear twice | Locked 2026-11-25 |
Modes
| # | Decision | Why | Status |
|---|---|---|---|
| D67 | A fresh browser opens in view; the last mode is remembered per device (bento.mode.v1) | Refreshing should not drop people into dashed outlines; editing is an explicit choice | Locked 2026-11-25 |
Connectors
| # | Decision | Why | Status |
|---|---|---|---|
| D68 | Connectors are account-scoped base URL + write-only bearer token; widgets reference a connector and a path | One place for URL/auth, no secrets in widgets or shares | Locked 2026-11-25 |
| D69 | Tokens use AES-256-GCM with the master key outside App_Data when configured | Reversible encryption is needed by the proxy, unlike hashed share tokens | Locked 2026-11-25 |
| D70 | The connector proxy allows only GET/POST, relative paths on the connector origin, no cookies or redirects, and refuses link-local/metadata | A user-configured URL must not become an SSRF surface | Locked 2026-11-25 |
| D71 | The first IoT widget is a built-in Gree AC using a connector, not a marketplace module | The bridge is local and needs the account session | Locked 2026-11-25 |
Bridge
| # | Decision | Why | Status |
|---|---|---|---|
| D72 | The multi-device bridge is a supervisor over one gree-ac child per AC, not a second Gree protocol implementation | Reuses the proven AES-ECB/GCM worker and keeps protocol risk low | Locked 2026-11-25 |
| D73 | One public bridge bearer token; each child has an internal token and no published port | Bento Spaces only needs one URL; the LAN surface stays one endpoint | Locked 2026-11-25 |
| D74 | The Gree widget reads /api/devices, stores deviceId, and falls back to /api/state for a legacy single bridge | One widget supports both bridge shapes without a migration | Locked 2026-11-25 |
| D75 | Automations run as a server-side tick in Bento.Api, not in a widget or browser timer | A thermostat has to work with no tab open and the phone asleep | Locked 2026-11-25 · built 2026-11-26 |
| D76 | A climate rule uses min/max hysteresis plus cooldown, never a single setpoint | Without the gap and cooldown the AC short-cycles the compressor | Locked 2026-11-25 · built 2026-11-26 |
| D77 | A manual change pauses the rule for an hour; the rule never instantly undoes the user | Being overridden by your own house is worse than being warm | Locked 2026-11-25 · built 2026-11-26 |
| D78 | Thresholds live in a profile, and rules select a profile; weather brackets are ordered, first match wins, with a fallback | Numbers stay in one place and the weather can pick behaviour without duplicating rules | Locked 2026-11-25 · built 2026-11-26 |
| D79 | A profile switch never sends a command; the next tick evaluates the new profile and cooldown still applies | A weather change is not a reason to toggle a compressor | Locked 2026-11-25 · built 2026-11-26 |
| D80 | v1 brackets use the AC's own outdoorTemp; an external forecast is opt-in later and needs a key in the secret store | No new provider, no key, no dependency until it is actually wanted | Locked 2026-11-25 · built 2026-11-26 |
| D81 | Built-ins are library entries: users may remove and reinstall them, and /manage sets the defaults for new accounts; existing accounts keep every built-in | No widget is permanent clutter, while nobody's board changes on upgrade | Locked 2026-11-26 · built 2026-11-26 |
| D82 | Publishers have a permanent handle and widgets have their own handle; install ids are publisher--widget. Releases are immutable and auto-publish after validation, with the publisher tier shown but not gating publishing | Separate namespaces let two developers own weather; versioned releases keep updates honest | Locked 2026-11-28 · built 2026-11-28 |
Live widgets
| # | Decision | Why | Status |
|---|---|---|---|
| D81 | Secret-free widgets may fetch directly from a small CSP allowlist (Open-Meteo, CoinGecko, Frankfurter) | A proxy for every poll adds load and latency for no security gain when the data is public | Locked 2026-11-25 |
| D82 | Feeds go through one API-hosted proxy (/api/live/feed), account-only, public hosts only | Feeds have no CORS; an arbitrary URL from a widget is an SSRF surface, so it needs a guard, not a browser fetch | Locked 2026-11-25 |
| D83 | Tier A widgets are shareable and exportable; connectors stay private | The split is data-based, not widget-based, so users can predict what a share link shows | Locked 2026-11-25 |
Space actions
| # | Decision | Why | Status |
|---|---|---|---|
| D64 | Share and export are space actions in the space dock, not Settings; export opens a popup | They act on one space; Settings is for the device/app | Locked 2026-11-25 |
| D65 | The export popup is the home for future export/viewer permissions | A static file is read-only today, but the place to choose who can open it should be beside the download | Locked 2026-11-25 |
| D66 | Share, export and space details are view-only; edit mode hides them | Editing should only show editing actions; the view row is for the composed space | Locked 2026-11-25 |
Zoom
| # | Decision | Why | Status |
|---|---|---|---|
| D54 | Zoom lives in the space dock (magnifier-minus · level · magnifier-plus), 60–160% in 10% steps, per space and per device in localStorage | People want to tune one busy space without changing every screen; it must be discoverable while composing and viewing | Revised 2026-11-25 |
| D55 | Zoom scales unit and gap together, applies in view mode and export, and hides outside edit | Proportions stay designed; the tuned board is what visitors and exports see | Locked 2026-11-25 |
Commercial
| # | Decision | Why | Status |
|---|---|---|---|
| C1 | Free = 3 spaces, presets, local only | Enough to spread, small enough to upgrade | Locked 2026-11-24 |
| C2 | Plus = €10/year incl. VAT: unlimited spaces, sync, wallpapers, push, share links | Cheap enough to be an impulse; user's choice | Revised 2026-11-25 |
| C3 | Revised 2026-11-25 | ||
| C4 | Publisher = €50/year, unlimited widgets + push | One decision for a serious developer | Locked 2026-11-24 |
| C5 | No enterprise tier (no SSO, no admin, no SLAs) | Keeps the product small and supportable | Locked 2026-11-24 |
| C6 | Merchant of record for payments | VAT/invoices handled; ~5% + €0.50 is worth it | Locked 2026-11-24 |
| C7 | Grandfathering: existing subscribers keep their price | Costs only go up | Locked 2026-11-24 |
| C8 | Licence: AGPL core + commercial hosted extras | Prevents a closed SaaS fork without contributing | Proposed — not locked |
Things we tried and undid
| Thing | Why it went |
|---|---|
| 0.5-box grid | Slivers under 1×1 could never host content (D3) |
| Containers crossing the 4-box line | Broke mobile stacking and made patterns unpredictable (D16) |
Per-container + buttons on hover | User: pluses at the start and end of everything only (D15) |
Gap + duplicating the neighbour immediately | Replaced by "Fill this space", which lists every composition (D15) |
| Resize while a widget is inside | Replaced by the lock rule (D17) |
| EF Core / SQLite in M1 | JSON files fit the reference host and cost no package (D10, D13) |
| Team tier at €15/display | Replaced by share links; no enterprise surface (C5) |
| Per-person profiles and connect links | Removed: sharing is per space (D22 revised) |
| Publisher fee per widget | Punished the developer with five widgets; €50 flat instead (C4) |
| Publisher signatures / key pinning | Hashes pin bytes; vouching for people was not wanted (D25) |
| Close gap | Removed: the user wants unused space to stay as part of the bento (D6 revised) |