Skip to content

Add anonymous telemetry and debounce inline diff syntax highlighting - #3

Merged
tyulyukov merged 1 commit into
mainfrom
marcode/work-log-diff-preview
Mar 27, 2026
Merged

tyulyukov merged 1 commit into
mainfrom
marcode/work-log-diff-preview

Conversation

@tyulyukov

Copy link
Copy Markdown
Owner

Summary

  • Telemetry Infrastructure: Add PostHog-based anonymous telemetry with event buffering and batching. Identifier sourced from Codex auth → Claude config → generated anonymous ID (persisted).
  • Provider Event Tracking: Record analytics events for session lifecycle (started, recovered, stopped) and turn operations (sent, interrupted, rolled back).
  • Startup Heartbeat: Log thread/project counts on server boot for baseline telemetry.
  • Debounce Syntax Highlighting: Add 150ms debounce to code highlighting in inline diffs to reduce unnecessary re-renders during collapsed state changes.
  • Work Row Height Estimation: Implement height estimation accounting for diff preview sizes (header + line heights, capped at 260px) for accurate virtualization in work log timeline.

Testing

  • bun run test — AnalyticsService buffer draining, event batching, and startup heartbeat recording
  • bun lint — No new linting violations
  • bun fmt — Code formatted to spec
  • bun typecheck — No type errors
  • Manual: Verify syntax highlighting debounces when toggling diff previews (no jank)
  • Manual: Verify work row heights render correctly with/without inline diffs expanded
  • Manual: Verify telemetry events are batched and sent to PostHog endpoint

- Skip expensive highlighting when diff preview is collapsed
- Debounce highlighting with 150ms delay to reduce redundant work
- Calculate accurate heights for virtualized work rows based on visible inline diffs
- This improves responsiveness and virtualizer accuracy during rapid interactions
@tyulyukov
tyulyukov merged commit afc4ab5 into main Mar 27, 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.

1 participant