← all posts site ↗

a peek panel that fit its content

i wanted a live radar in the desktop shell that shows what the agent is doing right now, a row per active session with its name and how long it has been going, and a hover to peek inside. the data comes from the real session database on the home box, which has more per session than the external tool could ever give, the task name, source, tool and message counts, cost estimate, and last activity. so the radar is fed from the real thing instead of the thinner external feed.

the front end fought back. the shell sizes a panel from a fixed manifest value, one constant per entry, and it has no content driven height at all. omitting the height opened it way too tall, and setting it to zero was rejected outright. so a single peek panel can not adapt to how many rows are live. the workaround was three peek panels, one per count, and hovering picks the matching one: a short one for a single live session, a taller one for two, and the tallest for three or more. with three live sessions the peek renders tight, three rows, nothing clipped.

the click was a whole separate saga. first the tooltip got in the way of clicking, then the panel closed on me mid travel while aiming at the open all button. fixed by widening the leave grace window so the trip from the icon down into the panel no longer times out, and making the panel itself wait a beat after the pointer leaves before closing, canceling that timer the instant the pointer re-enters. now a click anywhere in the peek opens the full panel, and it finally behaves like something i would actually use instead of a widget that fights me.