You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let Vyse's Shear shorten like Cypher's Trapwire - #353
Vyse's Shear can now be shortened by dragging its handle toward Vyse, the same way Cypher's Trapwire already works. Pierwiastekzminusjeden asked for it on Discord on Oct 20. A full 12 m Shear often runs straight through the map's walls, and plans end up looking messy.
Until now Shear was a fixed 12 m square, so its handle could only turn it. It is now a resizable wall like Trapwire, anywhere from 1 m to 12 m.
Saved Shears don't change. Every Shear saved so far has length 0, and 0 resolves to full length. The box a Shear is placed in is the same size with the same anchor, so saved Shears land on the same spot. In release builds, a freshly placed Shear gives a pixel-identical app window on main and on this branch.
What changed
Shear becomes a ResizableSquareAbility with a 1 m minimum that starts at full length, in lib/const/agents.dart.
ResizableSquareWidget no longer clips its Stack. Shear is the first resizable range narrower than its own icon, and the clip was cutting the icon down to a thin strip. The fixed square widget never clipped. Cypher, Neon and Harbor draw inside their boxes, so they look the same.
Page transitions now tween the length that's drawn instead of the stored one, in transition_data.dart. A stored 0 means full length, so a Shear going from full length on one page to 5 m on the next tweened from 0 m up to 5 m. Trapwire and Neon's wall had the same bug.
Ground truth
I built Windows release builds of main and of this branch and drove both with a scratch in-app script that sends pointer events through the app's normal gesture handling.
On this branch, dragging the handle toward Vyse shortens Shear, dragging sideways turns it, and dragging past the end stops at 12 m. The length is still there after closing and reopening the app.
On main, the same drags only turn it and the length stays 0.
Older builds, meaning the shipped desktop app and any web tab still on the old build, draw a shortened Shear at the full 12 m. They keep its stored length, so it shows correctly again in a new build. Left is this branch, right is a main build opening the same library.
The library format, export and sync protocol don't change. length is the field Trapwire already uses.
Tests
All in test/resizable_square_ability_test.dart.
A saved Shear with length 0 renders the same RGBA bytes as the old fixed square, with Range shown and hidden. It fails with the clip fix removed.
A shortened Shear keeps its box and icon, and its range shrinks from the far end.
A page change from a saved Shear to a shortened one tweens from 12 m. It fails without the transition fix.
The full flutter test run passed except for page_screenshots_test.dart "only Stop ends a capture". That one is flaky on main as well. On my machine it failed twice in a row on main and passed twice in a row on this branch.
Astra reviewed it. Round 1 caught the icon clipping, the transition tween, and a test that compared rectangles instead of pixels. All three are fixed here.
Not covered
Replays still draw captured Shears at full length. The decoder reads each wall's real end point from WallEndLocation but doesn't hand it to the app yet. That belongs in its own PR.
I didn't run the web build. The change is shared Flutter code with no platform branch.
ci: analyze test web
Summary by CodeRabbit
New Features
Vyse’s Shear ability can now be resized from 1 m up to its full 12 m length.
Newly placed Shears default to their maximum length while retaining their existing width, icon, and color.
Bug Fixes
Existing fixed-length Shears preserve their appearance and geometry.
Shortened Shears now display correctly, including narrow-range content extending beyond the ability’s bounds.
Page transitions accurately reflect the ability’s displayed length.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
Vyse’s Shear now uses a resizable square ability with a 1 m minimum and maximum-length default. Transition data resolves its effective length, and the widget stack does not clip narrow-range content. Tests cover saved geometry, rendering, shortening, transition lengths, and defaults.
Changes: Resizable Vyse Shear
Layer / File(s)
Summary
Resizable Shear behavior and validation lib/const/agents.dart, lib/widgets/draggable_widgets/ability/resizable_square_widget.dart, lib/const/transition_data.dart, test/resizable_square_ability_test.dart
Vyse’s Shear uses a resizable square while retaining its dimensions and styling. The widget stack disables clipping, and transition data resolves resizable ability lengths. Tests check saved-placement geometry, rendering, shortened-body geometry, transition lengths, and default and minimum length behavior.
Vyse's Shear can now be shortened by dragging, and saved Shears should keep their previous appearance. No actionable merge-blocking risk is apparent from the supplied changes and tests.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly summarizes the main change: Vyse's Shear can shorten like Cypher's Trapwire.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Vyse's Shear can now be shortened by dragging its handle toward Vyse, the same way Cypher's Trapwire already works. Pierwiastekzminusjeden asked for it on Discord on Oct 20. A full 12 m Shear often runs straight through the map's walls, and plans end up looking messy.
Until now Shear was a fixed 12 m square, so its handle could only turn it. It is now a resizable wall like Trapwire, anywhere from 1 m to 12 m.
Saved Shears don't change. Every Shear saved so far has length 0, and 0 resolves to full length. The box a Shear is placed in is the same size with the same anchor, so saved Shears land on the same spot. In release builds, a freshly placed Shear gives a pixel-identical app window on main and on this branch.
What changed
ResizableSquareAbilitywith a 1 m minimum that starts at full length, inlib/const/agents.dart.ResizableSquareWidgetno longer clips itsStack. Shear is the first resizable range narrower than its own icon, and the clip was cutting the icon down to a thin strip. The fixed square widget never clipped. Cypher, Neon and Harbor draw inside their boxes, so they look the same.transition_data.dart. A stored 0 means full length, so a Shear going from full length on one page to 5 m on the next tweened from 0 m up to 5 m. Trapwire and Neon's wall had the same bug.Ground truth
I built Windows release builds of main and of this branch and drove both with a scratch in-app script that sends pointer events through the app's normal gesture handling.
Older builds, meaning the shipped desktop app and any web tab still on the old build, draw a shortened Shear at the full 12 m. They keep its stored length, so it shows correctly again in a new build. Left is this branch, right is a main build opening the same library.
The library format, export and sync protocol don't change.
lengthis the field Trapwire already uses.Tests
All in
test/resizable_square_ability_test.dart.The full
flutter testrun passed except forpage_screenshots_test.dart"only Stop ends a capture". That one is flaky on main as well. On my machine it failed twice in a row on main and passed twice in a row on this branch.Astra reviewed it. Round 1 caught the icon clipping, the transition tween, and a test that compared rectangles instead of pixels. All three are fixed here.
Not covered
WallEndLocationbut doesn't hand it to the app yet. That belongs in its own PR.ci: analyze test web
Summary by CodeRabbit
New Features
Bug Fixes