Skip to content

Add remove view cone action - #127

Merged
SunkenInTime merged 1 commit into
agent/hide-view-cone-elevation-controlsfrom
agent/remove-view-cone
Aug 16, 2026
Merged

Add remove view cone action#127
SunkenInTime merged 1 commit into
agent/hide-view-cone-elevation-controlsfrom
agent/remove-view-cone

Conversation

@SunkenInTime

Copy link
Copy Markdown
Owner

What changed

  • add a Remove View Cone action to attached agents
  • convert the composite back to the existing plain-agent representation while preserving ID, position, agent, team, alive/dead state, and deletion state
  • make removal transactional so undo restores the exact cone preset, rotation, length, and elevation, and redo removes it again
  • add regression coverage for conversion, undo/redo, menu behavior, and page-transition identity mapping in both directions

Why

Attaching a view cone already converted a plain agent into a view-cone agent, but there was no inverse command. Users had to delete and recreate the agent or immediately undo the attachment.

User impact

An attached cone can now be removed from the agent context menu without disturbing the underlying tactical marker. Existing strategies and .ica files need no migration because both agent representations are already supported.

Page transitions

Pages pair placed widgets by stable ID. The regression test confirms that a view-cone agent and a plain agent with the same ID map as one move entry for both attachment and removal.

Validation

  • flutter test test/view_cone_agent_drag_feedback_test.dart
  • flutter test test/remove_view_cone_test.dart test/lineup_add_item_interaction_test.dart
  • dart analyze lib/providers/agent_provider.dart lib/widgets/draggable_widgets/agents/agent_widget.dart test/remove_view_cone_test.dart test/view_cone_agent_drag_feedback_test.dart
  • dart format --output=none --set-exit-if-changed on the four changed Dart files
  • git diff --check

Stacked on #125 so the context-menu changes remain isolated until that PR lands.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c66b480-502c-4f27-9d2a-0c738ceb8e90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This change adds a Remove View Cone action to attached-agent context menus. Selecting it returns the agent to its plain representation while preserving its identity, position, team, and state; undo restores the attached view cone and its geometry, while redo removes it again.

A focused Flutter widget test exercised the real secondary-click menu interaction, conversion, undo, and redo. It confirmed that view-cone metadata is restored on undo and that an unrelated agent remains unchanged. No defects were found.

Confidence Score: 5/5

Safe to merge based on the exercised context-menu conversion and history round trip.

The reviewed behavior was exercised through the actual attached-agent context menu, including conversion to a plain agent, restoration of view-cone geometry on undo, reconversion on redo, and preservation of unrelated state. No final review findings remain.

Files Needing Attention: No files need follow-up attention. The exercised implementation paths were lib/providers/agent_provider.dart and lib/widgets/draggable_widgets/agents/agent_widget.dart.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the pre-change widget test using the repository-local Flutter SDK to establish the existing attached-view-cone coverage.
  • Authored and ran a focused Flutter widget test that opens the attached agent’s real secondary-click menu, selects Remove View Cone, and verifies conversion, transactional undo, and redo.
  • The test run reported All tests passed and confirmed the expected state transitions: the target becomes a plain agent, undo restores its view-cone properties, and redo returns it to a plain agent, with an unrelated agent preserved.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "Add remove view cone action" | Re-trigger Greptile

@SunkenInTime
SunkenInTime marked this pull request as ready for review August 16, 2026 04:24
@SunkenInTime
SunkenInTime merged commit a3dec4d into agent/hide-view-cone-elevation-controls Aug 16, 2026
2 of 3 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