Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Diffs showed a brief "Processing..." flash even on cache hits due to:

  • setChunks(null) being called on any cache miss
  • useState initializer only running on mount
  • Cache key changing on visibility toggle (enableHighlighting)

Fix: Generate plain-text chunks synchronously as immediate fallback, then upgrade to syntax-highlighted version when ready. The hook now never returns null, eliminating the loading state entirely.

Net -20 LoC


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

@ammar-agent ammar-agent force-pushed the fix/diff-processing-flash branch from bcdd179 to 5a21b06 Compare December 22, 2025 22:56
Diffs showed a brief "Processing..." flash even on cache hits due to:
- setChunks(null) being called on any cache miss
- useState initializer only running on mount
- Cache key changing on visibility toggle

Fix: Generate plain-text chunks synchronously as immediate fallback,
then upgrade to syntax-highlighted version when ready. The hook now
never returns null, eliminating the loading state entirely.

Net -20 LoC.
@ammar-agent ammar-agent force-pushed the fix/diff-processing-flash branch from 5a21b06 to 2eaad1f Compare December 22, 2025 23:31
@ammario ammario merged commit 70dc5cc into main Dec 22, 2025
19 checks passed
@ammario ammario deleted the fix/diff-processing-flash branch December 22, 2025 23:35
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