Skip to content

feat: major architecture overhaul, in-place editing, and memory optimization#2

Merged
azeveco merged 12 commits into
mainfrom
feat/restructure-and-performance
Jul 9, 2026
Merged

feat: major architecture overhaul, in-place editing, and memory optimization#2
azeveco merged 12 commits into
mainfrom
feat/restructure-and-performance

Conversation

@azeveco

@azeveco azeveco commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Context

We've observed the need for a major restructure of the application's UX and architecture. Previously, taking a capture would spawn a completely separate editor window, which disrupted the user's workflow. We needed a seamless, in-place editing experience where users could manipulate annotations right on the screen immediately after selecting a region.

Alongside the UX issues, we identified severe memory inefficiencies. The application was keeping multiple hidden windows running in the background at all times (Control Panel, Settings, Editor, and the Fullscreen Overlay). Additionally, the heavy image buffer of the last capture was kept in memory indefinitely because the old editor relied on it.

This massive refactoring gives users the power to edit annotations freely from a floating toolbar, automates the scrolling capture, introduces new tools and shortcuts, and drastically optimizes the application's lifecycle and RAM usage under the hood.

Proposed resolution

  • In-Place Seamless Editing: Removed the secondary editor window entirely. Upon selecting a capture region, a floating, draggable toolbar immediately appears on-screen, allowing the user to annotate and edit the screenshot in-place without any context switching.
  • Automated Scrolling Capture: Refactored the scrolling capture flow to be fully automated. When the user initiates a scrolling capture and selects an area, Specture will automatically scroll and stitch the images seamlessly.
  • Editable Annotations & Properties: Added a "Select" tool that wraps existing annotations in a selection layer. Users can now move elements by dragging their bodies or resize them using the border and corner handles. Additionally, users can dynamically change the properties (color, line thickness, font size, and font family) of any selected annotation using the toolbar or hotkeys.
  • Shift Modifiers: Enabled proportional resizing (perfect squares/circles) and 45-degree angle snapping for arrows both during the initial creation and while editing/resizing an annotation when holding the Shift key.
  • Advanced Text Editing: Text annotations can now be repositioned and retroactively edited via double-click. The textarea overlay automatically resizes to match the text dimensions without clipping.
  • New Shortcuts & Tools: Added new Select and Eraser tools to the suite, expanding the hotkeys to 1-9. Changed size and thickness modifiers to [ and ] (and Cmd + [ / Cmd + ] for font sizing while typing). Added Backspace and Delete support to instantly remove selected annotations. Updated the settings Cheat Sheet and the repository's README to reflect these changes.
  • Aggressive Memory Management (Buffer Clearing): The image buffer is no longer kept in memory indefinitely. As soon as the user finishes their workflow (by saving, copying to clipboard, or cancelling the capture), the buffer is immediately cleared.
  • On-Demand Window Lifecycle: Optimized window management. The Capture Menu (formerly Control Panel) and Settings windows are now spawned exclusively on demand. The only window kept in the background is the fullscreen selection overlay.
  • Undo/Redo Architecture Fixes: Refactored the historySnapshot capturing mechanism to fix asynchronous React closure bugs. Actions such as moving, erasing, deleting, or editing properties now correctly push their states to the undoStack without clearing the screen or grouping unrelated actions.
  • Eraser Algorithm Update: The eraser logic was updated to calculate distances against mathematical line segments instead of just individual points, making it effectively erase continuous drawings like the Blur or Highlighter strokes.
  • Refactoring & UI Fixes: Renamed control_panel to capture_menu across the project. Added a vertical separator in the toolbar to distinct tools from actions. Addressed bugs causing scrolling capture and the menu icon to freeze the screen.

Impact

This PR completely overhauls the user experience and application performance.

UX Impact: The workflow is now incredibly fast and immersive. Users have absolute freedom to tweak their visual tutorials post-creation in-place, without having to undo and redraw to fix a slightly misaligned rectangle, a typo, or a wrong color. The automated scrolling capture makes long document saving effortless.

Performance Impact: Massive reduction in RAM consumption. By eliminating the background Editor window, transitioning Settings and Capture Menu to on-demand spawning, and aggressively clearing the image buffer upon completion, the application runs significantly lighter and more efficiently.

Screenshots (if applicable)

image

Impacted resources

  • Global Capture & Editor Architecture (App.tsx)
  • Application Memory footprint (Image Buffer lifecycle)
  • Tauri Window Management (On-demand spawning)
  • Automated Scrolling Capture Flow (stitcher.rs / lib.rs)
  • Annotation State Management and History Stack
  • Capture Toolbar (now floating and draggable) / Capture Menu
  • Mouse and Pointer Event Listeners
  • Text Overlay Component (textarea)
  • Settings Window (Cheat Sheet & Keybindings)
  • Repository README.md

Testing/validation

  1. Check system RAM usage.
  2. Open the Capture Menu and take a Region Capture. Verify that Settings and Capture Menu are spawned on demand.
  3. Select an area on the screen. Verify that the floating toolbar appears directly beneath the selection and that no new editor window is spawned.
  4. Drag the toolbar around to ensure it is movable.
  5. Draw a rectangle, a circle, an arrow, and a blur stroke.
  6. Switch to the Select tool and click on the elements. Verify that the bounding boxes and resize handles appear.
  7. Try resizing holding Shift to test proportions.
  8. With an element selected, change its color, thickness, and font (if applicable) using the toolbar and shortcuts.
  9. Press Backspace or Delete to verify the selected annotation is removed.
  10. Add a Text annotation. Double-click it to edit the wording, then drag it to move it around. Test changing the font size with Cmd + [ and Cmd + ] while typing.
  11. Use the Eraser on the blur stroke and verify it removes the entire stroke.
  12. Spam Undo (Cmd+Z) and Redo (Cmd+Shift+Z) to ensure each state (including property changes and deletions) is restored perfectly.
  13. Save or cancel the capture, and verify that RAM usage drops as the image buffer is properly cleared.
  14. Initiate a Scrolling Capture, select a region, and leave the mouse completely still. Verify that it automatically scrolls, stitches the images, and returns the full result without freezing the screen.

Rollback plan

If major regressions are found in the history stack, rendering logic, or window management:

  • Revert this PR entirely.
  • Delete the associated release build if already distributed.

References

N/A

@azeveco azeveco self-assigned this Jul 9, 2026
@azeveco azeveco added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jul 9, 2026
@azeveco azeveco changed the title Feat/restructure and performance feat: major architecture overhaul, in-place editing, and memory optimization Jul 9, 2026
@azeveco
azeveco marked this pull request as ready for review July 9, 2026 03:51
@azeveco
azeveco merged commit 74c579f into main Jul 9, 2026
@azeveco
azeveco deleted the feat/restructure-and-performance branch July 9, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant