Running Autopilot requires review access on this PR and push access to the source branch.
Latest runsuccess
### What was failing
- `Typecheck` failed in `apps/web/app/home/autopilot-trigger-demo.tsx:303` with `TS18048: 'entry' is possibly 'undefined'`.
- `Build web` compiled the application but failed during its TypeScript phase on the same error.
### Root cause
The `IntersectionObserver` callback destructured the first array item and accessed `entry.isIntersecting` directly. With the repository's strict TypeScript settings, the first observer entry is typed as potentially absent.
### Fix
- Updated `useOnScreen` in `apps/web/app/home/autopilot-trigger-demo.tsx` to use `entry?.isIntersecting ?? false`. This safely handles an empty observer-entry array while preserving behavior for normal callbacks.
- Verified the targeted check with `npx --yes pnpm@9.15.9 --filter web typecheck`; it passes.
- Re-ran the web build. Compilation and TypeScript now pass; local page-data collection proceeds until it reaches the unrelated environment requirement `DATABASE_URL is required` for `/api/campfire/refs`.
- Ran `git diff --check`; no whitespace errors were found, and only the intended source file remains modified.
Failing checks addressed: `Build web`, `Typecheck`
Verification passed and changes were pushed as `26269010166a`.
Changed files:
```text
apps/web/app/home/autopilot-trigger-demo.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
```
Diff preview:
```diff
diff --git a/apps/web/app/home/autopilot-trigger-demo.tsx b/apps/web/app/home/autopilot-trigger-demo.tsx
index 9c43ea7..da9092f 100644
--- a/apps/web/app/home/autopilot-trigger-demo.tsx
+++ b/apps/web/app/home/autopilot-trigger-demo.tsx
@@ -300,7 +300,7 @@ function useOnScreen(ref: RefObject<Element | null>) {
if (!node) return
const observer = new IntersectionObserver(
- ([entry]) => setVisible(entry.isIntersecting),
+ ([entry]) => setVisible(entry?.isIntersecting ?? false),
{ threshold: 0.35 }
)
observer.observe(node)
```