Skip to content

perf: reduce layer paints and remove streaming cursor#4377

Merged
SivanCola merged 1 commit into
esengine:main-v2from
CVEngineer66:perf/reduce-layer-paints-and-remove-streaming-cursor
Jun 14, 2026
Merged

perf: reduce layer paints and remove streaming cursor#4377
SivanCola merged 1 commit into
esengine:main-v2from
CVEngineer66:perf/reduce-layer-paints-and-remove-streaming-cursor

Conversation

@CVEngineer66

Copy link
Copy Markdown
Contributor

Changes

  1. content-visibility: auto on .msg / .tool / .turn-collapse / .process-card

    • Off-screen elements skip paint → layer texture memory drops from ~97 MB to only the visible viewport
    • Paint count no longer grows linearly with session length
  2. Remove streaming cursor

    • Remove the blink-animated cursor injected by Markdown.tsx into streaming output
    • Each blink triggered a full document paint — root cause of frequent flicker and high layer memory

Files changed

  • desktop/frontend/src/styles.css — content-visibility rules + cursor/blink keyframe cleanup
  • desktop/frontend/src/components/Markdown.tsx — removed cursor injection/removal functions, showCursor prop, useLayoutEffect
  • desktop/frontend/src/components/Message.tsx — removed showCursor={item.streaming}

- Add content-visibility: auto on .msg / .tool / .turn-collapse / .process-card
  so off-screen elements are skipped during paint — reduces layer texture memory
  from ~97 MB down to only the visible viewport
- Remove the blinking <span class="cursor"> injected by Markdown.tsx into
  streaming markdown; each blink triggered a full document paint (paint count
  grew linearly with output), which was the root cause of frequent flicker and
  high layer memory
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 14, 2026

@SivanCola SivanCola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the small frontend perf patch. I did not find blocking issues in the Markdown cursor removal or the new content-visibility rules.

Local validation:

  • npm run check:css passed
  • npm run test passed
  • npm run typecheck / npm run build are blocked locally by missing generated Wails modules (src/lib/bridge.ts, src/lib/theme.ts, src/lib/windowState.ts), not by this diff

GitHub checks are green.

@SivanCola SivanCola merged commit a549f2f into esengine:main-v2 Jun 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants