Dev.to
7/11/2026

Two weekends into a Chrome side panel: the four state bugs that took longer than the UI
Short summary
A developer shipped a Chrome side panel extension that forwards highlighted text or screenshots to AI tabs (ChatGPT/Claude/Gemini). The UI took six hours; four state bugs took two weekends. The bugs: tab identity vs window focus, stale screenshot bytes, prompt library storing pre-wrap text instead of resolved payloads, and stale destination tabs surviving panel reopen. The meta-lesson: state lives in more places than users expect, and every state field needs exactly one writer and one reader.
- •Four state bugs in a Chrome side panel extension took longer than the UI itself
- •Tab identity ≠ window focus; screenshot bytes can be stale; prompt libraries must store resolved payloads
- •Meta-fix: every state field should have exactly one writer and one reader
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



