# Session Resume Notes - 2025-11-13

## Where We Left Off

Building msger for Raspberry Pi (ARM64) - encountered GLib version incompatibility.

## Work Completed This Session

### 1. ✅ Added Auto-Title Support
- Window title automatically updates from document.title in URL mode
- Uses MutationObserver + periodic polling
- **Files Modified:** `msger-native/src/main.rs` (lines 470-505)

### 2. ✅ Added -dev Flag Support
- Automatically opens DevTools on startup
- Simulates F12 keypress via JavaScript
- **Files Modified:** `msger-native/src/main.rs` (lines 507-532)

### 3. ✅ Updated Documentation
- README.md updated with auto-title and -dev examples
- **Files Modified:** `README.md`

### 4. ✅ Improved Pi Build Script
- Auto-detects and installs missing dependencies (gcc, rust, pkg-config, glib, gtk, webkit)
- Smart build detection (skips if binary is up-to-date)
- Pi availability check with red error banner if unavailable
- Fixed cargo environment sourcing
- **Files Modified:** `msger-native/build-pi.ts`

### 5. ✅ Created Pi Diagnostics Tool
- TypeScript script that runs on Pi to check all requirements
- Identifies exact version mismatches
- **Files Created:** `msger-native/pi-diagnostics.ts`

## Current Issue: GLib Version Incompatibility

### Problem Identified
```
Raspberry Pi: Debian 11 (Bullseye)
  └─ GLib version: 2.66.8

msger (wry 0.47):
  └─ Requires: GLib >= 2.70
```

### Root Cause
- wry 0.47 → gtk-rs crates → require glib 2.70+
- Debian 11 only has glib 2.66
- Debian 12 (Bookworm) has glib 2.74 ✓

## Next Steps (User Chose Option 1: Upgrade Pi OS)

### Step 1: Upgrade Pi to Debian 12
```bash
# SSH to Pi
ssh pi4c

# Backup important data first!
sudo apt update
sudo apt full-upgrade -y

# This will take 30-60 minutes
# May require reboot
```

### Step 2: Verify GLib Version After Upgrade
```bash
# Run diagnostics again
cd Y:\dev\utils\msger\msger-native
scp pi-diagnostics.ts pi4c:/tmp/
ssh pi4c "node /tmp/pi-diagnostics.ts"

# Should show: GLib 2.74+ ✓
```

### Step 3: Build for Pi
```bash
cd Y:\dev\utils\msger
npm run build:native:pi
```

Should succeed after OS upgrade!

## Alternative (Not Chosen)

If upgrade doesn't work, can downgrade wry:
```toml
# In msger-native/Cargo.toml
[dependencies]
wry = "0.24"  # Down from 0.47
tao = "0.16"  # Down from 0.30
```

## Files Modified This Session

1. `msger-native/src/main.rs` - Auto-title + dev flag
2. `README.md` - Documentation updates
3. `msger-native/build-pi.ts` - Improved build script
4. `msger-native/pi-diagnostics.ts` - NEW diagnostic tool
5. `tests/test-title-change.html` - NEW test file
6. `.claude/settings.local.json` - Note about experimental-strip-types

## Build Status

- ✅ Windows x64: Working (v0.1.107)
- ✅ Linux x64 (WSL): Working
- ⏳ Linux ARM64 (Pi): Blocked by GLib version (upgrade Pi OS to fix)

## Commands Ready to Run After Pi Upgrade

```bash
# 1. Verify Pi is upgraded
ssh pi4c "cat /etc/os-release"  # Should show Debian 12

# 2. Check GLib version
ssh pi4c "pkg-config --modversion glib-2.0"  # Should show 2.74+

# 3. Build
npm run build:native:pi

# 4. Test
scp msger-native/bin/msgernative-arm64 pi4c:~/
ssh pi4c "echo '{\"message\":\"Hello ARM64!\"}' | ./msgernative-arm64"
```

## Background Processes to Clean Up

Several test processes may still be running:
- Bash 6cefc7 - MSGER_DEBUG test with wikipedia
- Bash 75121d - MSGER_DEBUG test with example.com
- Bash 939f7a - Pi build attempt

Can kill after reboot if needed.

---

## Summary

Ready to continue with Pi OS upgrade when you return. All code changes for auto-title and -dev flag are complete and working on Windows/WSL.
