Skip to content

feat: add Request Log tab for real-time request monitoring#124

Closed
custardcream98 wants to merge 3 commits into
mainfrom
feat/request-log
Closed

feat: add Request Log tab for real-time request monitoring#124
custardcream98 wants to merge 3 commits into
mainfrom
feat/request-log

Conversation

@custardcream98

Copy link
Copy Markdown
Owner

Summary

Add a 4th Log tab to MSW Devtools for real-time request/response monitoring.

Features

  • Real-time logging: Capture matched and unmatched MSW requests via worker events
  • Log entries: Timestamp, method pill, status badge, URL, response duration, matched/unmatched icon
  • Expandable detail: Click to inspect request/response body with CodeEditor
  • "Add Mock" shortcut: One-click mock creation from unmatched requests
  • Controls: Recording toggle, clear button, All/Matched/Unmatched filter
  • Unread badge: Red badge on Log tab when requests arrive while on other tabs
  • Early capture: Buffer events from worker start so first page-load requests are captured
  • Static asset filtering: Skip .js/.css/@vite/ requests automatically
  • Memory management: 200 entry FIFO cap, memory only (no localStorage)
  • i18n: Full EN/KO support

Changeset

@custardcream/msw-devtools minor version bump

Test plan

  • pnpm build success
  • pnpm type-check 7 workspaces pass
  • pnpm test 139 tests pass
  • Playground: Log tab visible, matched/unmatched requests logged, body displayed, "Add Mock" button works

🤖 Generated with Claude Code

custardcream98 and others added 3 commits March 21, 2026 12:33
- Add Tab.Log to constants.ts
- Add Log TabButton in TabBar (before Settings)
- Add LogTab placeholder component with empty state message
- Wire LogTab in TabBody conditional rendering
- Add i18n keys for tab label, controls, and log UI text in both EN and KO

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add LogTab with recording toggle, clear, matched/unmatched filter controls
- Add LogEntry with accordion: time, MethodPill, status, URL, duration, matched icon
- Add LogDetail with CodeEditor for request/response body (readOnly)
- Add "Add Mock for this URL" button on unmatched requests -> navigates to AddMock tab
- Add unread badge on Log tab button in TabBar
- Move RequestLogProvider to DevTools.tsx (wraps both TabBar and TabBody)
- Integrate fe's RequestLogContext with Tab.Log constant (replace TAB_LOG workaround)
- Auto-scroll to newest log entry, reset unread count on tab entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add RequestLogContext with MSW event subscription and early buffer
  for capturing requests before React tree mounts
- Filter out static assets (.js, .css, @vite/) from log entries
- Fix body display timing: create entries synchronously, parse body async
- Clean up early capture listeners after drain (prevent memory leak)
- Move shouldCaptureRequest to request-log.tsx (SRP: worker.ts stays pure)
- Add i18n key for "No body data available" (was hardcoded English)
- Convert all Korean comments to English across LogTab components
- Add changeset for minor version bump

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
msw-devtools Ignored Ignored Mar 21, 2026 6:16am
msw-devtools-docs Ignored Ignored Mar 21, 2026 6:16am
msw-devtools-vue Ignored Ignored Mar 21, 2026 6:16am

Request Review

@custardcream98

Copy link
Copy Markdown
Owner Author

Replaced with lint fix

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