Skip to content

Add vision cones to directional abilities - #115

Merged
SunkenInTime merged 7 commits into
mainfrom
agent/vision-cones
Aug 9, 2026
Merged

Add vision cones to directional abilities#115
SunkenInTime merged 7 commits into
mainfrom
agent/vision-cones

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • add wall-aware, rotatable vision cones to Killjoy Turret (100°), Cypher Spycam (103°), Raze Boom Bot (40°), and Gekko Wingman (40°)
  • default Boom Bot and Wingman to a 15 m detection range while keeping Turret and Spycam length-adjustable
  • add a Vision Cone toggle to each supported placed ability's right-click menu
  • preserve cone visibility, rotation, and length through page transitions, side switching, Hive storage, and .ica export/import
  • add schema migration v95 and regenerated Hive/JSON adapters

Verification

  • dart run build_runner build --delete-conflicting-outputs
  • flutter test (357 passed, 1 skipped)
  • flutter analyze (only the pre-existing deprecated onReorder info in lib/widgets/pages_bar.dart)

Summary by CodeRabbit

  • New Features
    • Added directional vision cones for supported abilities, with ability-specific ranges and adjustable lengths.
    • Vision cones can be shown or hidden from the ability context menu.
    • Added interactive cone rotation and length adjustments.
    • Vision cones render correctly during dragging, zooming, duplication, and page transitions.
  • Bug Fixes
    • Existing strategies automatically preserve and migrate vision-cone settings.
    • Legacy saved data remains compatible, with vision cones enabled by default.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SunkenInTime, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c52a0a9-38b8-4dd2-a11b-e97f210a47a9

📥 Commits

Reviewing files that changed from the base of the PR and between d343eaa and 272fecd.

📒 Files selected for processing (9)
  • lib/const/placed_classes.dart
  • lib/hive/hive_adapters.g.dart
  • lib/hive/hive_adapters.g.yaml
  • lib/providers/strategy_provider.dart
  • lib/widgets/draggable_widgets/ability/ability_visibility_context_menu.dart
  • test/ability_visibility_widgets_test.dart
  • test/ability_vision_cone_migration_test.dart
  • test/ability_vision_cone_test.dart
  • test/strategy_integrity_test.dart
📝 Walkthrough

Walkthrough

Adds configurable vision cones for supported abilities. The change persists cone visibility, migrates existing strategies, renders cones during placement and transitions, supports rotation and length gestures, and adds coverage for specifications, migration, serialization, and widget behavior.

Changes

Ability vision cones

Layer / File(s) Summary
Vision cone contracts and persisted state
lib/const/ability_vision.dart, lib/const/placed_classes.dart, lib/const/placed_classes.g.dart, lib/hive/*, lib/const/settings.dart, lib/const/folder_icons.dart
Defines ability-specific cone angles and ranges. Adds showVisionCone to visual state, JSON, and Hive persistence. Updates version constants and side-switching behavior.
Vision cone strategy migration
lib/migrations/ability_vision_cone_migration.dart, lib/providers/strategy_provider.dart
Enables vision cones for existing map and lineup abilities. Integrates the migration into bulk, current-version, and legacy strategy migration paths.
Vision cone rendering and interaction
lib/widgets/draggable_widgets/ability/*, lib/widgets/draggable_widgets/placed_widget_builder.dart, lib/widgets/page_transition_overlay.dart
Adds composite cone rendering, zoom-aware positioning, rotation and length gestures, context-menu visibility control, drag handling, and transition previews.
Vision cone validation
test/ability_vision_cone_test.dart, test/ability_vision_cone_migration_test.dart, test/ability_visibility_widgets_test.dart, test/page_transition_overlay_test.dart, test/ability_visual_state_test.dart, test/strategy_integrity_test.dart
Tests cone specifications, migration behavior, widget visibility, transition rendering, legacy defaults, and export/import preservation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant PlacedAbilityWidget
  participant AbilityVisionConeComposite
  participant StrategyProvider
  User->>PlacedAbilityWidget: Toggle or adjust the vision cone
  PlacedAbilityWidget->>AbilityVisionConeComposite: Render cone with resolved length and rotation
  PlacedAbilityWidget->>StrategyProvider: Persist visual state, rotation, and length
  StrategyProvider-->>PlacedAbilityWidget: Return updated strategy data
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the pull request's primary change: adding vision cones to directional abilities.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/vision-cones

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

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This change adds persisted directional vision cones for supported abilities, including range handling, visibility controls, migration of existing strategies, drag placement, and page-transition rendering.

T-Rex validation blocked

The focused command flutter test test/ability_vision_cone_test.dart could not run because the Flutter tool is not installed in the environment. The command exited with code 127 before tests could execute.

Confidence Score: 5/5

No blocking failure remains.

No accepted blocking findings remain.

T-Rex T-Rex Logs

What T-Rex did

  • Tried to run the Flutter test test/ability_vision_cone_test.dart from the repository root twice; both attempts exited with code 127 because the Flutter executable is unavailable.
  • No repository source files were modified during these attempts.
  • Captured the focused cross-map-scale test and the conversion and rendering call sites for execution once Flutter is available, to guide a future run.
  • Validated consistency: both before and after scope-matched captures used the exact Flutter test command and observed the same SDK-missing blocker.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "test: verify cone lengths across map sca..." | Re-trigger Greptile

Comment thread lib/widgets/draggable_widgets/placed_widget_builder.dart
Comment thread lib/const/placed_classes.g.dart
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/const/ability_vision.dart`:
- Line 58: Update resolveLength so the requested.clamp(minimum, maximum) result
is explicitly converted to double before returning, matching the method’s
declared return type.

In `@lib/widgets/draggable_widgets/ability/placed_ability_widget.dart`:
- Around line 529-537: Update the drag handling around visionSpec.resolveLength
and localLength so the measured rendered distance is converted back to the
stored unit before persistence. Ensure localLength receives the stored cone
length expected by the later resolveLength calls in the surrounding widget and
AbilityVisionConeComposite, rather than the rendered value affected by mapScale.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f06290fb-739d-4d67-90c8-23a7cdc987d5

📥 Commits

Reviewing files that changed from the base of the PR and between 18ce8b2 and c17a463.

📒 Files selected for processing (20)
  • lib/const/ability_vision.dart
  • lib/const/folder_icons.dart
  • lib/const/placed_classes.dart
  • lib/const/placed_classes.g.dart
  • lib/const/settings.dart
  • lib/hive/hive_adapters.g.dart
  • lib/hive/hive_adapters.g.yaml
  • lib/migrations/ability_vision_cone_migration.dart
  • lib/providers/strategy_provider.dart
  • lib/widgets/draggable_widgets/ability/ability_visibility_context_menu.dart
  • lib/widgets/draggable_widgets/ability/ability_vision_cone_composite.dart
  • lib/widgets/draggable_widgets/ability/placed_ability_widget.dart
  • lib/widgets/draggable_widgets/placed_widget_builder.dart
  • lib/widgets/page_transition_overlay.dart
  • test/ability_visibility_widgets_test.dart
  • test/ability_vision_cone_migration_test.dart
  • test/ability_vision_cone_test.dart
  • test/ability_visual_state_test.dart
  • test/page_transition_overlay_test.dart
  • test/strategy_integrity_test.dart

Comment thread lib/const/ability_vision.dart Outdated
Comment thread lib/widgets/draggable_widgets/ability/placed_ability_widget.dart Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 6, 2026 18:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/ability_vision_cone_test.dart`:
- Around line 56-71: Update the test fixed-range cones persist map-independent
lengths around AbilityVisionConeSpec.storedLengthFromRendered and resolveLength
to store the rendered maximum using one map scale, then resolve that stored
value using a different map scale and compare it with the second scale’s
maximumLength. Keep the assertion verifying the stored map-independent length
consistent with the original scale.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b324f9fa-74c1-41e5-90fa-6b60ea0c432f

📥 Commits

Reviewing files that changed from the base of the PR and between c17a463 and d343eaa.

📒 Files selected for processing (4)
  • lib/const/ability_vision.dart
  • lib/widgets/draggable_widgets/ability/ability_vision_cone_composite.dart
  • lib/widgets/draggable_widgets/ability/placed_ability_widget.dart
  • test/ability_vision_cone_test.dart
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/const/ability_vision.dart
  • lib/widgets/draggable_widgets/ability/placed_ability_widget.dart

Comment thread test/ability_vision_cone_test.dart
@SunkenInTime
SunkenInTime merged commit aeefc69 into main Aug 9, 2026
2 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