Skip to content

Let Vyse's Shear shorten like Cypher's Trapwire - #353

Merged
SunkenInTime merged 2 commits into
mainfrom
t3/vyse-shear-length
Oct 20, 2026
Merged

SunkenInTime merged 2 commits into
mainfrom
t3/vyse-shear-length

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Same drag on main and on this PR: main only turns Shear, this PR shortens it

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.

Placed, shortened, turned, dragged past max, reopened

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.

This branch vs main opening a shortened Shear

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.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 344f885e-0913-45a3-8976-6f4c8f3eaff9
📥 Commits

Reviewing files that changed from the base of the PR and between 9c5fdb7 and 1a063cc.

📒 Files selected for processing: 4
  • lib/const/agents.dart
  • lib/const/transition_data.dart
  • lib/widgets/draggable_widgets/ability/resizable_square_widget.dart
  • test/resizable_square_ability_test.dart

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.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 1a063

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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: Vyse's Shear can shorten like Cypher's Trapwire.
Docstring Coverage Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SunkenInTime
SunkenInTime merged commit fc887c6 into main Oct 20, 2026
14 checks passed
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.

1 participant