Skip to content

feat(screenshot): Implement screenshot functionality#30

Open
rsthornton wants to merge 1 commit intomainfrom
feature/screenshots
Open

feat(screenshot): Implement screenshot functionality#30
rsthornton wants to merge 1 commit intomainfrom
feature/screenshots

Conversation

@rsthornton
Copy link

Description

This pull request introduces the initial implementation for a desktop screenshot feature, allowing users to capture the current view of the diagram by pressing Cmd+P (macOS) or Ctrl+P (Windows/Linux).

The implementation attempts to follow the established architectural patterns of the BERT application for handling user input and interacting with the Bevy engine.

Implementation Details

  • New System File: src/bevy_app/systems/screenshot.rs
  • Approach:
    • A take_screenshot system is triggered by a KeyCode input.
    • This system spawns Bevy's native Screenshot component.
    • A second system listens for the ScreenshotFinished event and saves the image to a timestamped PNG file.
  • Architectural Goal:
    • The intent was to use Bevy's native screenshot functionality, avoiding the WASM compilation issues encountered with tauri-plugin-screenshot. The direct keyboard input pattern was chosen to align with other working shortcuts in the app.

🔍 Current Status & Request for Review

The feature is currently blocked, and I would appreciate a second pair of eyes on the approach. While the implementation attempts to follow the correct patterns, it's very possible there is a more fundamental issue that I have missed.

Immediate Blocker: The most direct symptom is that the take_screenshot system is not being triggered when Cmd+P is pressed in the desktop application.

Debugging Performed:

  • Confirmed the application compiles and runs.
  • Verified the system is correctly registered in the CameraControlSet, alongside other working shortcuts like Cmd+R.

Request for Help:
I would appreciate a review of the overall approach in screenshot.rs to ensure it's sound. If the architecture seems correct, then assistance in debugging the keyboard input issue would be the next step. It's possible the issue is simple, but it's also possible it's pointing to a deeper misunderstanding of the event loop or system scheduling.

@rsthornton rsthornton linked an issue Jun 30, 2025 that may be closed by this pull request
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.

Add screenshot functionality

1 participant