Skip to content

fix: recording mode improvements#135

Merged
mcollina merged 15 commits intomainfrom
fix/recording-mode-improvements
Dec 8, 2025
Merged

fix: recording mode improvements#135
mcollina merged 15 commits intomainfrom
fix/recording-mode-improvements

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented Dec 6, 2025

Summary

  • Record API creates a new timestamped file instead of modifying index.html
  • Flamegraph button is now disabled (not hidden) when no profile data is available
  • Hide OpenAPI service click in offline mode (services are not clickable, arrow icon hidden)
  • Various bug fixes for recording mode functionality

Test plan

  • E2E tests pass
  • Verify recording creates new HTML file in working directory
  • Verify flamegraph button is visible but disabled in live mode
  • Verify flamegraph button is enabled in offline mode with profile data
  • Verify services are not clickable in offline mode

🤖 Generated with Claude Code

mcollina and others added 10 commits December 6, 2025 22:39
The record endpoint now creates a standalone HTML file with embedded
metrics data instead of modifying the frontend's index.html. This ensures
the original bundle is never altered and allows multiple recordings.

Changes:
- Add optional outputPath parameter to specify output directory or file
- Default output is cwd with auto-generated filename (watt-admin-DATE-TIME.html)
- Never overwrites existing files (appends -1, -2, etc. if needed)
- Extract output utilities to web/backend/utils/output.ts
- Add comprehensive tests for new functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adds a test that verifies the record endpoint actually creates an HTML
file with embedded JSON at the specified outputPath. This test currently
fails and needs investigation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
The flamegraph feature is only relevant when viewing recorded/offline data,
so we now conditionally hide it when the app is in live mode.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mcollina and others added 2 commits December 7, 2025 12:58
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
anyOf: [
{
additionalProperties: false,
additionalProperties: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we revert this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, because we can't guarantee it. The underlining data is coming straight from the management API... and it might have additional properties. Adding properties is a semver minor change, but with this it treats as a semver-major, breaking the client.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As an example, this broke because we added one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah okay, it makes sense

mcollina and others added 3 commits December 8, 2025 17:01
- Fix circular JSON error when stringifying window object in api.ts
- Add modal popup showing file path when recording stops
- Auto-open recording in browser when stop recording (skip during CI/tests)
- Remove Load button from UI (no longer needed)
- Update E2E tests to expect Recording Saved modal instead of Load button

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
Co-authored-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@mcollina mcollina merged commit 2181bc0 into main Dec 8, 2025
1 check passed
@mcollina mcollina deleted the fix/recording-mode-improvements branch December 8, 2025 16:21
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