Skip to content

fix(feed): sanitize multiline previews to prevent overlay layout corruption#5

Merged
nicobailon merged 1 commit into
nicobailon:mainfrom
monotykamary:fix/overlay-background-rendering
Mar 3, 2026
Merged

fix(feed): sanitize multiline previews to prevent overlay layout corruption#5
nicobailon merged 1 commit into
nicobailon:mainfrom
monotykamary:fix/overlay-background-rendering

Conversation

@monotykamary

@monotykamary monotykamary commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Before After
Screenshot 2026-02-23 at 19 03 25 Screenshot 2026-02-23 at 19 02 59

Fixes overlay layout corruption caused by multiline data in .pi/messenger/feed.jsonl.

The root cause was feed events with embedded newlines (for example, commit/message previews). Those newline characters were rendered into the TUI row pipeline and broke panel borders/section alignment.

What changed

  • feed.ts
    • Added feed event sanitization for inline text fields (agent, target, preview)
    • Applied sanitization when appending events, reading events, and formatting feed lines
  • overlay-render.ts
    • Sanitizes feed events before rendering message and non-message lines
  • overlay.ts
    • Hardened row rendering by stripping control whitespace (\n, \r, \t) and truncating to section width before drawing borders
  • Tests
    • Added regression coverage for multiline preview normalization and rendering safety:
      • tests/feed.test.ts
      • tests/crew/live-feed.test.ts

Validation

  • npm test passes (full suite)
  • Reproduced problematic .pi data now renders cleanly without layout breakage

@monotykamary monotykamary force-pushed the fix/overlay-background-rendering branch from 75bbf01 to 9619243 Compare February 23, 2026 09:06
@monotykamary monotykamary force-pushed the fix/overlay-background-rendering branch from a975e1e to d3fa74f Compare February 23, 2026 12:04
@monotykamary monotykamary changed the title fix(overlay): prevent rendering issues when overlay is hidden in background fix(feed): sanitize multiline previews to prevent overlay layout corruption Feb 23, 2026
@monotykamary monotykamary marked this pull request as ready for review February 23, 2026 12:05
@nicobailon nicobailon merged commit 217d067 into nicobailon:main Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants