Skip to content

feat: make Log label clickable to show session event log popup#237

Merged
StephaneDelcroix merged 2 commits intomainfrom
fix/theres-a-log-label-at-screens-bottom-its-20260227-0919
Feb 28, 2026
Merged

feat: make Log label clickable to show session event log popup#237
StephaneDelcroix merged 2 commits intomainfrom
fix/theres-a-log-label-at-screens-bottom-its-20260227-0919

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Collaborator

Summary

The 'Log' label in the ExpandedSessionView status bar was a static <span> with no click handler — clicking it did nothing. This PR makes it clickable to show a popup with the session's event log (parsed from events.jsonl).

Changes

  • CopilotService.Utilities.cs — Added ParseEventLogFile() (internal static, testable) and GetEventDetail() methods to read and summarize events.jsonl entries. Returns compact (timestamp, eventType, detail) tuples.
  • ExpandedSessionView.razor — Added @onclick="ShowLogPopup" and data-trigger="log" to the Log label. Added ShowLogPopup() method using the same JS popup pattern as skills/agents/prompts.
  • ExpandedSessionView.razor.css — Styled .log-label with cursor: pointer and accent color (same as .skills-trigger).
  • SessionEventLogTests.cs — 16 unit tests covering event parsing, truncation, malformed input handling, and razor markup verification.

What it looks like

Clicking 'Log' shows a compact event log popup with color-coded event types:

  • 🔵 User messages (blue)
  • 🟢 Assistant messages (green)
  • 🟡 Tool executions (yellow)
  • 🔴 Errors (red)
  • ⚫ Other events (gray)

The popup follows the same overlay pattern as skills/agents/prompts and auto-scrolls for long sessions.

StephaneDelcroix and others added 2 commits February 28, 2026 10:17
The 'Log' label in the ExpandedSessionView status bar was a static span
with no click handler. This makes it clickable to show a popup with the
session's event log (parsed from events.jsonl), following the same popup
pattern used by skills/agents/prompts triggers.

Changes:
- Add ParseEventLogFile() and GetEventDetail() to CopilotService.Utilities
  for reading and summarizing events.jsonl entries
- Add ShowLogPopup() click handler to ExpandedSessionView with JS popup
- Style .log-label with cursor:pointer and accent color (like .skills-trigger)
- Add 16 unit tests covering event parsing, truncation, malformed input,
  and razor markup verification

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Wrap file I/O in Task.Run for async execution (Issue A)
- Cap parsed events at 500 entries (Issue B)
- Fix event count mismatch: use filtered.Count not entries.Count (Issue C)
- Scope querySelector to session-unique data-trigger (Issue D)
- Escape Unicode line terminators in EscapeForJs (Issue E)
- Update test to match new session-scoped data-trigger pattern

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StephaneDelcroix StephaneDelcroix force-pushed the fix/theres-a-log-label-at-screens-bottom-its-20260227-0919 branch from 3d4a87e to 2b9ceb4 Compare February 28, 2026 09:21
@StephaneDelcroix
Copy link
Copy Markdown
Collaborator Author

✅ Multi-Model Review: Ready to Merge

Initial 5-model review found 5 issues. All fixed in follow-up commit 2b9ceb4:

Issue Severity Fix
Synchronous blocking I/O on UI thread 🔴 Critical Wrapped in await Task.Run(...)
No upper bound on parsed entries 🟡 Moderate Capped at 500 most-recent entries
Event count mismatch in header 🟡 Moderate Uses filtered.Count instead of entries.Count
querySelector not scoped to session 🟡 Moderate data-trigger now includes session GUID
EscapeForJs missing Unicode terminators 🟡 Moderate Added \u2028/\u2029 escaping

Post-fix re-review (5 models): All 5 issues confirmed fixed. No new consensus issues. Tests: 1569/1570 pass (1 pre-existing locale failure unrelated).

@StephaneDelcroix StephaneDelcroix merged commit 88ecd19 into main Feb 28, 2026
@StephaneDelcroix StephaneDelcroix deleted the fix/theres-a-log-label-at-screens-bottom-its-20260227-0919 branch February 28, 2026 09:44
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