Skip to content

feat: Add desktop screenshot export with Ctrl/Cmd+P shortcut#6

Closed
NehharShah wants to merge 1 commit intohalcyonic-systems:mainfrom
NehharShah:main
Closed

feat: Add desktop screenshot export with Ctrl/Cmd+P shortcut#6
NehharShah wants to merge 1 commit intohalcyonic-systems:mainfrom
NehharShah:main

Conversation

@NehharShah
Copy link
Contributor

Description

Adds screenshot export functionality for BERT diagrams on desktop builds, allowing users to capture and save system diagrams for documentation, presentations, and sharing.

Closes #1

Changes

Core Implementation

  • New System: src/bevy_app/systems/screenshot.rs
    • Desktop-only screenshot capture using Bevy 0.15's observer pattern
    • Timestamped PNG files: bert_screenshot_YYYY-MM-DD_HH-MM-SS.png
    • Saves to current working directory
    • Integrated with existing SaveSuccessEvent for toast notifications

Keyboard Shortcut

  • Ctrl+P (Windows/Linux) or Cmd+P (Mac)
  • Desktop-only, properly gated with #[cfg(not(target_arch = "wasm32"))]
  • Note: Using Ctrl/Cmd+P instead of Ctrl/Cmd+Shift+S to avoid conflict with "Save As"

Dependencies

  • Added chrono = "0.4" as desktop-only dependency for timestamp generation

rsthornton pushed a commit that referenced this pull request Dec 8, 2025
Implements screenshot capture functionality that works across all BERT
deployment contexts (web browser and Tauri desktop).

Key implementation details:
- Uses web APIs (Blob + anchor download) instead of native file I/O
- Works in WASM since BERT's Tauri desktop build uses a webview
- Timestamps via js_sys::Date for WASM compatibility
- PNG encoding via image crate
- Integrates with existing SaveSuccessEvent for toast notifications

This implementation builds on the approach proposed in PR #6 by
@NehharShah, adapted for BERT's Tauri+WASM architecture where
target_arch is always wasm32 even on desktop.

Closes #1
rsthornton pushed a commit that referenced this pull request Dec 8, 2025
Implements screenshot capture functionality that works across all BERT
deployment contexts (web browser and Tauri desktop).

Key implementation details:
- Uses web APIs (Blob + anchor download) instead of native file I/O
- Works in WASM since BERT's Tauri desktop build uses a webview
- Timestamps via js_sys::Date for WASM compatibility
- PNG encoding via image crate
- Integrates with existing SaveSuccessEvent for toast notifications

This implementation builds on the approach proposed in PR #6 by
@NehharShah, adapted for BERT's Tauri+WASM architecture where
target_arch is always wasm32 even on desktop.

Closes #1
rsthornton pushed a commit that referenced this pull request Dec 26, 2025
Implements screenshot capture functionality that works across all BERT
deployment contexts (web browser and Tauri desktop).

Key implementation details:
- Uses web APIs (Blob + anchor download) instead of native file I/O
- Works in WASM since BERT's Tauri desktop build uses a webview
- Timestamps via js_sys::Date for WASM compatibility
- PNG encoding via image crate
- Integrates with existing SaveSuccessEvent for toast notifications

This implementation builds on the approach proposed in PR #6 by
@NehharShah, adapted for BERT's Tauri+WASM architecture where
target_arch is always wasm32 even on desktop.

Closes #1
rsthornton added a commit that referenced this pull request Dec 26, 2025
Implements screenshot capture functionality that works across all BERT
deployment contexts (web browser and Tauri desktop).

Key implementation details:
- Uses web APIs (Blob + anchor download) instead of native file I/O
- Works in WASM since BERT's Tauri desktop build uses a webview
- Timestamps via js_sys::Date for WASM compatibility
- PNG encoding via image crate
- Integrates with existing SaveSuccessEvent for toast notifications

This implementation builds on the approach proposed in PR #6 by
@NehharShah, adapted for BERT's Tauri+WASM architecture where
target_arch is always wasm32 even on desktop.

Closes #1

Co-Authored-By: NehharShah <nehharshah@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
@rsthornton
Copy link
Contributor

@NehharShah

@rsthornton
Copy link
Contributor

@NehharShah

Superseded by #7 - thanks for getting this started!

@rsthornton rsthornton closed this Dec 26, 2025
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 Export Functionality

2 participants