a group
a description
#!/usr/bin/env python3 """ Can the reader scroll up in the chat, and does the panel sit still when nobody is touching it? `scroll_probe.py` answers "is the document taller than the window". This one mounts **the real `ChatPanel`** — the shipped module, not a model of it — in a browser, drives it the way a person does, and reports where the list ends up. It exists because the defect it was written for is invisible to every other kind of test here. `fit()` set the panel's height, read the document's overflow back and subtracted it, so the document alternately did and did not overflow the window; the page scrollbar appeared and vanished with it, `visualViewport` fired `resize` at each pass, and `fit()` is bound to that event. It therefore re-ran about 120 times a second for the life of the panel, re-pinning the list to the bottom every time — which undid each attempt to scroll up *inside the same frame*, before the `scroll` event that would have recorded it was delivered. The source reads as correct: every pin is guarded by "only if the reader is at the bottom", and the reader never got to stop being at the bottom. chat_scroll_probe.py Prints JSON: an `idle` block (viewport-resize firings on a page nobody touches) and a `steps` list (scroll position after each stage of a reading session). """ import http.server import json import socketserver import subprocess import sys import tempfile import threading import time from pathlib import Path STATIC = Path(__file__).resolve().parents[2] / "src" / "meshbay_hub" / "static" PORT = 8747 RECORDS = [] socketserver.TCPServer.allow_reuse_address = True # A bare document fires a couple of these while it settles. Anything above this # is the panel driving itself. IDLE_RESIZE_CEILING = 20 PAGE = r"""
a description