Skip to content

Show inactive Viper utility states - #121

Merged
SunkenInTime merged 3 commits into
mainfrom
t3code/visualize-disabled-smokes
Aug 9, 2026
Merged

Show inactive Viper utility states#121
SunkenInTime merged 3 commits into
mainfrom
t3code/visualize-disabled-smokes

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Aug 7, 2026

Copy link
Copy Markdown
Owner

What

  • Adds a right-click Active toggle for Viper's Poison Cloud and Toxic Screen.
  • Crossfades active utility into a badge-free inactive trace: dashed cloud footprint with a solid center point, or a clean dashed full-length wall path.
  • Uses the exact regular Toxic Screen wall color and opacity for both inactive traces (Colors.greenAccent at alpha 100).
  • Keeps the placed icon and existing spatial footprint so inactive utility remains legible on the map.
  • Reuses the existing AbilityVisualState, preserving strategy saves, undo/redo, lineups, and .ica round-trips without a schema migration.

Why

An icon-only or faded state loses spatial truth. The dashed geometry keeps the planned placement visible while clearly separating inactive utility from active gas.

Deactivated state

Viper Poison Cloud and Toxic Screen in their deactivated state

Demo

▶ Watch the updated 13-second Viper inactive-state demo

The screenshot and recording use the production widgets and context menus in an isolated, non-persisting demo surface; no local strategy library data was read or written.

Checks

  • flutter test — all tests passed
  • flutter test test/ability_visibility_widgets_test.dart — 29 passed after the visual adjustments
  • flutter build windows --debug — passed
  • flutter analyze — only the pre-existing pages_bar.dart:534 onReorder deprecation remains

Summary by CodeRabbit

  • New Features

    • Added inactive-state visualization for supported abilities, including Viper’s Poison Cloud and Toxic Screen.
    • Added animated inactive traces for circular and wall abilities.
    • Added an Active visibility toggle for abilities that support inactive states.
    • Preserved wall paths and updated visual transitions when abilities are activated or hidden.
  • Bug Fixes

    • Improved ability visibility behavior and context-menu actions for inactive-state abilities.
  • Tests

    • Added coverage for inactive rendering, trace colors, visibility toggles, activation behavior, and rotation controls.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds inactive-state support for image and wall abilities. It adds inactive trace painters, animated widget rendering, Active context-menu controls, Viper configuration, and widget tests.

Changes

Inactive ability state

Layer / File(s) Summary
Ability contracts and configuration
lib/const/abilities.dart, lib/const/agents.dart
ImageAbility and SquareAbility expose inactive-state configuration. Viper’s Poison Cloud and Toxic Screen enable the feature.
Inactive trace primitives
lib/widgets/draggable_widgets/ability/inactive_ability_trace.dart
Circle and wall traces apply alpha-adjusted colors and render dashed paths with markers.
Ability widget state rendering
lib/widgets/draggable_widgets/ability/simple_image_ability_widget.dart, lib/widgets/draggable_widgets/ability/custom_square_widget.dart
Image abilities cross-fade active content and inactive traces. Supported walls animate range visibility and render inactive traces.
Visibility controls and validation
lib/widgets/draggable_widgets/ability/ability_visibility_context_menu.dart, test/ability_visibility_widgets_test.dart
Supported abilities expose an Active toggle. Tests cover inactive cloud and wall rendering and context-menu behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant VisibilityMenu
  participant AbilityWidget
  participant InactiveTrace
  User->>VisibilityMenu: Select Active
  VisibilityMenu->>AbilityWidget: Set showRangeFill false
  AbilityWidget->>InactiveTrace: Render inactive trace
  InactiveTrace-->>AbilityWidget: Paint alpha-adjusted trace
Loading

Possibly related PRs

🚥 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 main change: displaying inactive states for Viper utility abilities.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/visualize-disabled-smokes

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.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The inactive Poison Cloud presentation removes its placed icon, leaving only the dashed footprint.

T-Rex validation blocked

The focused Flutter widget test could not run because the required Flutter 3.44.4 tool is not installed in this environment (flutter: not found).

Confidence Score: 4/5

The inactive Poison Cloud state does not preserve the placed ability icon, so the change is not ready to merge as implemented.

One actionable non-security failure remains: disabling Poison Cloud hides its placed icon rather than displaying it with the inactive footprint.

Files Needing Attention: lib/widgets/draggable_widgets/ability/simple_image_ability_widget.dart

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex attempted to run the focused Flutter test for the Viper ability, but the Flutter tool was not found, exiting with code 127.
  • T-Rex produced a finding-proof for a posted P1 finding, as noted in the corresponding review comment.
  • T-Rex collected source-state evidence and the focused widget test source to support the validation of the isActive-to-opacity behavior.
  • T-Rex validated that the focused test asserts the expected opacities for active and inactive layers and references the InactiveCircleAbilityTrace.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Inactive Poison Cloud hides its Smoke.webp icon

    • Bug
      • The source path for an inactive Viper Poison Cloud sets the image layer's opacity to zero and displays only InactiveCircleAbilityTrace. The focused test encodes that same expectation. Runtime reproduction is blocked because Flutter is unavailable, so this remains a source-confirmed but runtime-unverified finding.
    • Cause
      • SimpleImageAbilityWidget uses visualState.showRangeFill as the active-state switch for both the placed Smoke.webp icon and the inactive trace; when false, the icon's AnimatedOpacity is zero.
    • Fix
      • Keep the Image.asset(imagePath) layer visible for image abilities when inactive, and independently render the dashed inactive trace; update the focused widget test to assert both layers remain visible if that is the intended UX.

    T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Remove inactive Toxic Screen endpoint do..." | Re-trigger Greptile

@SunkenInTime
SunkenInTime marked this pull request as ready for review August 9, 2026 01:12
@SunkenInTime
SunkenInTime merged commit 90facf0 into main Aug 9, 2026
2 checks passed
@SunkenInTime
SunkenInTime deleted the t3code/visualize-disabled-smokes branch August 9, 2026 01:12
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