Skip to content

Complete view cone clipping and optimize agent A* pathing#103

Merged
SunkenInTime merged 6 commits into
mainfrom
t3code/agent-page-pathing
Jul 18, 2026
Merged

Complete view cone clipping and optimize agent A* pathing#103
SunkenInTime merged 6 commits into
mainfrom
t3code/agent-page-pathing

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What changed

  • complete compound and closed-contour handling for view-cone collision geometry
  • load the runtime collision manifest through neutral authored-boundary names, with SVG fallback
  • route page-transition agents around collision geometry using A* and distance-based path sampling
  • reduce transition rebuild work and add focused regression/performance coverage

Why

View-cone obstacles assembled from split SVG paths could be admitted only partially, which allowed rays to leak through boxes and junctions. Agent page transitions also interpolated directly through walls and did unnecessary work during animation.

Impact

View cones now treat compound authored obstacles atomically across maps. Transitioning agents take smoothed collision-aware routes while other widgets retain their expected interpolation behavior.

Validation

  • fvm flutter test test/authored_vision_boundary_test.dart test/vision_geometry_test.dart test/page_transition_overlay_test.dart test/agent_transition_path_test.dart
  • fvm flutter analyze (one pre-existing onReorder deprecation warning in lib/widgets/pages_bar.dart)
  • case-insensitive tracked-content and tracked-path audit for the private source name: no matches

Improve transition routing, rendering, and view-cone previews; document the performance investigation.
@SunkenInTime
SunkenInTime marked this pull request as ready for review July 18, 2026 07:32
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR completes collision-aware view-cone and page-transition behavior. The main changes are:

  • Added authored collision reference data with SVG fallback.
  • Expanded compound and closed-contour handling for vision geometry.
  • Routed moving agents through collision-aware transition paths.
  • Reduced transition rebuild work when no agent route is needed.
  • Added focused coverage for boundary parsing, vision geometry, and transition previews.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
lib/providers/strategy_provider.dart Updates animated page transitions to load route geometry only for moved agents and re-snapshot target widgets after geometry loading.
lib/widgets/page_transition_overlay.dart Uses animated coordinate positions when previewing view-cone agents and free view-cone utilities during transitions.
lib/providers/view_cone_geometry_provider.dart Loads authored collision boundaries for runtime geometry and falls back to SVG-derived boundaries when the authored asset cannot be used.

Reviews (3): Last reviewed commit: "Refresh transition state after geometry ..." | Re-trigger Greptile

Comment thread lib/providers/strategy_provider.dart
@SunkenInTime SunkenInTime changed the title Optimize agent page pathing and transitions Complete view cone clipping and optimize agent A* pathing Jul 18, 2026
@SunkenInTime

Copy link
Copy Markdown
Owner Author

Consolidated the remaining view-cone collision work with the A* transition pathing at e472c45. The focused 52-test suite passes and the naming audit is clean. @greptileai

@SunkenInTime

Copy link
Copy Markdown
Owner Author

Addressed the stale transition snapshot feedback in b63cf85 by re-snapshotting target widgets and settings after geometry loading. Focused transition tests pass. @greptileai

Comment thread lib/providers/strategy_provider.dart Outdated
Comment on lines +1067 to +1068
if (entries.isEmpty) {
transitionNotifier.complete();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Stale entries persist These entries are still captured before the geometry load awaits. If a target-page agent is moved while viewConeGeometryProvider(...).future is still pending, the transition can remain in preparing with the same source and target page IDs, so the later guard passes and transitionNotifier.start(entries, ...) animates to positions from this stale snapshot. Rebuild the snapshot after the await, or validate a content generation that changes when target-page widgets mutate.

@SunkenInTime

Copy link
Copy Markdown
Owner Author

Made the stale-state guarantee structural in 535818d: preliminary entries are used only to decide whether geometry is needed, while a distinct final snapshot and entry list is always built after the await/guard and is the only list passed to start(). @greptileai

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

The approach in 535818d directly resolves the concern. Using a preliminary snapshot solely as a gate (is geometry even needed?) while always constructing a fresh snapshot + entry list after the await/guard ensures the data passed to start() is never stale — regardless of how long the geometry load takes. The structural separation makes the invariant self-evident rather than relying on the caller to reason about timing. This is a clean fix.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@SunkenInTime
SunkenInTime merged commit d7ba948 into main Jul 18, 2026
1 check failed
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