feat(editor): insert cut bands and reveal saved captures - #116
Open
tobi wants to merge 2 commits into
Open
Conversation
With Cut armed, hold Ctrl (or press Ctrl+X) to insert space instead of collapsing it. The toolbar icon swaps to a split-plus, the live band shows a plus, and annotations past the seam shift out. Undo is the same Cut op with insert set.
There was a problem hiding this comment.
🟡 Changes recommended
Cropped-region annotations shift incorrectly during insertion, and unbounded image growth can exhaust memory or crash.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds undoable transparent-band insertion to the Cut tool and optional reveal-in-Nautilus behavior for saved captures.
Changes:
- Adds Ctrl-based insert-band editing, replay, persistence, visuals, and tests.
- Adds Shift-save reveal gestures and safe argv-based notification actions.
- Updates user and architecture documentation.
File summaries
| File | Description |
|---|---|
src/cut.cpp |
Implements band insertion and replay. |
src/cut.hpp |
Extends the cut operation API. |
src/editor.cpp |
Integrates insertion and reveal gestures. |
src/editor.hpp |
Updates editor interfaces and test hooks. |
src/capture.cpp |
Persists insertion and launches reveal actions. |
src/capture.hpp |
Exposes file-reveal functionality. |
src/icons.cpp |
Adds the insert-band icon. |
tests/cut-smoke.cpp |
Tests insertion primitives and bounds. |
tests/cut-mapping-smoke.cpp |
Tests Ctrl-drag insertion. |
tests/editor-smoke.cpp |
Tests reveal gestures and notification arguments. |
README.md |
Documents new controls and dependencies. |
docs/editing-model.md |
Documents insertion replay behavior. |
docs/dependencies.md |
Records reveal command dependencies. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+50
to
+54
| const int extent = | ||
| orientation == Qt::Horizontal ? source.height() : source.width(); | ||
| start = std::clamp(start, 0, extent); | ||
| end = std::clamp(end, start, extent); | ||
| const int band = end - start; |
Comment on lines
+2732
to
+2738
| if (op.cut.insert) { | ||
| if (horizontal) | ||
| point.setY(shiftForInsert(point.y(), lo, band)); | ||
| else | ||
| point.setX(shiftForInsert(point.x(), lo, band)); | ||
| return; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates #114 and #115 onto current main.
Validation:
make checkandmake install.