Files
CatoandClaude Opus 5.5 3af2fec589 fix: what the Farmhouse end-to-end test broke — Live link, stuck Claude dialog, owner wording (#938)
* fix(sites): a site that goes live after registration is recorded, and its owner told

Registration wrote the live URL only if the site answered at that moment.
Farmhouse's first deploy failed, a later one succeeded, and nothing looked
again: no live URL, a Live link that opened the OrangeCat listing, and no word
to the owner. An hourly check (and the owner opening the project page) now
asks the same question registration asks and, the first time the answer is
yes, sends the owner their link that readies the widget.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(telemetry): six crons run hourly now that check-site-live does

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(runner): a Claude session showing a dialog is cleared before a prompt is sent into it

Farmhouse's parked session sat on Claude Code's "Teach auto mode about your
environment?" dialog. The owner's widget note was injected into the dialog,
nothing ran, and the run was NACKed 33s later while the widget said "On it".
Claude reports this itself ({status: waiting, waitingFor: "dialog open"}); the
runner now presses Escape and, if the dialog stays, starts a fresh session.

Also: on the box every live-session lookup used the dispatch's laptop path,
which no session has, so the generation check fell back to guessing from
screen activity. They now use the folder the agent really runs in, and the
reader accepts current CLIs' updatedAt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(widget): owner mode reads as the owner's, and the agent is told the owner asked

The widget no longer asks the owner for a name/email and says what happens
("Your site: what you say here gets built and goes live"). The agent's brief
now opens with "The owner of <project> asked for this change" instead of
"Fix this visitor feedback" — still fenced as text from a browser.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(desktop): 0.8.35 — ships the dialog-clearing runner fix to Fleet Runner too

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(changelog): Fleet Runner 0.8.35

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 04:27:44 -07:00
..

Loki feedback widget — embedding it

The bundle every site loads as <script src="https://loki.orangecat.ch/widget.js" data-fc-project="fcw_…" async></script>. Architecture, routes and history: docs/architecture/feedback-widget.md. This file is the part a HOST needs: where the launcher goes, and how to tell it.

Where the launcher sits

Nothing to configure for the common case. On load, on resize, after any scroll (including inner panels), on SPA navigation and on DOM changes (throttled to one pass a second) the launcher measures its candidate slots and takes the best:

  1. the configured corner (operator placement from boot; default bottom-right, 16px), climbing its edge up to 260px;
  2. the mirrored corner on the same edge, same band;
  3. the rest of each edge.

Each slot is hit-tested over the launcher plus a 12px gap and judged:

verdict what is under it used
free nothing of yours that matters (in-flow text, background) first one wins
surface a corner of a control ≥ 25% of the viewport — a pannable map, a canvas, a card-sized link only if no slot is free
layer a fixed/sticky bar, a bottom sheet, an inner scroll panel (anything < 60% of the viewport) only if no free or surface slot
blocked any control a visitor could click — links, buttons, inputs, [role=button], [tabindex], iframes, cursor:pointer — or anything marked data-fc-avoid never

If every slot is blocked the launcher hides until the page changes; a launcher that eats a click is worse than none. window.Loki.report() still works for a host that wires its own "Report" control.

The host contract — for what the heuristics cannot see

attribute where effect
data-fc-avoid any element never overlap it (checked by rectangle too, so it works on pointer-events:none overlays)
data-fc-place="left" / "right" <html> or any rendered page region keep the launcher on that side (it may still climb that edge)
data-fc-place="hidden" <html> or any rendered page region no launcher while that region is rendered — e.g. a checkout or a full-screen editor

<html> sets the site default; a rendered region overrides it (the last one in document order wins). A region that is display:none or unmounted says nothing, so a route can carry its own directive and the launcher returns when it leaves.

Legacy, still honoured: data-fc-bottom="N" on the script tag sets the base bottom offset. The operator's placement (corner, offsets, auto-avoid on/off) is set per token in Loki and served by /api/widget-boot; autoAvoid: false switches the measuring off but data-fc-place still applies.

Visitors can long-press / right-click the launcher to move it to another corner or hide it on that site; their choice outranks everything above, for them only.

Tests

  • scripts/test/widget-placement.ts — the pure slot order and chooser.
  • scripts/test/widget-host-avoid-browser.ts — real Chromium fixtures (bottom sheet under the launcher, composer Send, a host Ask button, map + sheet, data-fc-avoid, data-fc-place, late-mounted sheet, a wall of controls). Mutation-proven against the pre-fix bundle: WIDGET_JS=<old bundle> fails 7.