* feat(terminal): the feedback tool on the Terminal page — no floating button over the PTY
From the operator, on a phone: "I don't see the button that allows me to
give feedback on elements and on the site" on the Terminal (loki#1037).
/terminal was excluded from the widget because a floating button over live
terminal output covers what you are reading — and nothing replaced it, so
the page used most on a phone had no way to report anything.
- /terminal is no longer excluded (config/feedback-widget.ts). The page
carries data-fc-place="hidden", so the widget loads with no launcher.
- A Feedback button in the terminal header opens the panel (report a
problem, point at an element, attach a screenshot) via Loki.report().
- lib/open-feedback: one helper for opening the panel from a control,
shared with the account menu's "Report a problem". It now checks
Loki.ready — the widget publishes a report() stub even when it will
never render, so a bare "is a function" check could click into nothing;
not ready → /support.
- Tests: feedback-widget-reach asserts the new contract; the widget's
browser test gains the Terminal fixture — hidden launcher, report()
opens the panel, closing it keeps the launcher hidden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(phone-chrome): Report a problem opens through lib/open-feedback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Loki's own sign-in page at 390px: every slot on the bottom band is a
button, and the first slot up the edge that held no control was the
"or sign in" divider. The scan rated in-flow text as free, so the
launcher parked on the words (seen in a prod screenshot, 2026-09-29).
A new verdict, `text`, sits between free and surface: caret hit-testing
finds a non-blank text node whose own line box contains the probe point
(so the margin beside a paragraph is still free). The launcher prefers
an empty slot, still takes words over any control, and steps out of
hit-testing for the scan so it does not measure itself. README table
updated; a sign-in fixture in the browser test fails on the previous
bundle (launcher on the line) and passes now.
Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3
Co-authored-by: Claude <noreply@anthropic.com>
The launcher knew its corner, an offset, a global data-fc-bottom and one
foreign fixed launcher. Everything else it could miss: any layer wider than
90% of the viewport was ignored, so on substrata /atlas at 390px it parked on
the country bottom sheet; and it re-measured only on load, resize, window
scroll and URL change, so a sheet mounted later was never seen.
One engine now, for every width and obstacle:
- placement.slotOrder: preferred corner up its near band, the mirrored
corner, then the rest of each edge (pure, unit-tested).
- host-scan: hit-tests each slot (launcher + 12px gap) with
elementsFromPoint and judges free / surface / layer / blocked. Controls
(incl. [tabindex], iframes, cursor:pointer) block; fixed/sticky bars and
inner scroll panels are layers; a control >=25% of the viewport (a
pannable map) is a surface.
- placement.chooseSlot: first free, else least-bad, else HIDE - never sit
on a control.
- Re-measures on DOM mutation (throttled 1/s) and on inner-panel scroll.
- Host contract: data-fc-avoid (never overlap), data-fc-place=
left|right|hidden on <html> or a page region. Documented in
widget/README.md.
Also fixes a latent bug the browser test caught: clearing inline edges to ""
let the shadow stylesheet's right:16px survive a move to a LEFT corner, so
"Move to other corner" stretched the launcher across the page.
Tests: widget-placement.ts (pure) and widget-host-avoid-browser.ts (real
Chromium, 9 fixtures). Against the pre-fix bundle 7 assertions fail; each
new rule (layer, surface) fails its fixture when mutated out. CI installs
chromium-headless-shell so the browser test runs rather than skips.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>