Skip to content

Conversation

@interim17
Copy link
Contributor

Time Estimate or Size

Closes #364

Problem

What is the problem this work solves, including
Link to story or ticket

Solution

What I/we did to solve this problem

with @pairperson1

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change requires updated or new tests

Change summary:

  • Tidy, well formulated commit message
  • Another great commit message
  • Something else I/we did

Steps to Verify:

  1. A setup step / beginning state
  2. What to do next
  3. Any other instructions
  4. Expected behavior
  5. Suggestions for testing

Screenshots (optional):

Show-n-tell images/animations here

Keyfiles (delete if not relevant):

  1. main file/entry point
  2. other important file

Thanks for contributing!

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.14% 2583 / 11665
🔵 Statements 22.14% 2583 / 11665
🔵 Functions 25% 149 / 596
🔵 Branches 80.41% 349 / 434
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visGeometry/index.ts 7.94% 100% 0% 7.94% 116-124, 202-295, 298-299, 302-315, 323-332, 336-351, 354-363, 365-380, 383-504, 507-512, 516-532, 535-544, 547-548, 551-552, 556-567, 571-574, 578-598, 601-603, 606-609, 613-645, 648-650, 653-655, 658-675, 678-679, 682-683, 686-695, 698-699, 702-725, 728-729, 732-734, 737-739, 742-743, 746-749, 752-780, 783-807, 812-819, 823-833, 836-866, 869-902, 905-931, 934-939, 942-943, 946-947, 951-991, 994-1106, 1110-1117, 1120-1136, 1139-1144, 1147-1153, 1156-1167, 1173-1177, 1180-1186, 1189-1191, 1194-1257, 1260-1263, 1266-1400, 1403-1413, 1416-1440, 1443-1445, 1448-1456, 1460-1464, 1467-1487, 1490-1527, 1530-1559, 1565-1707, 1710-1788, 1791-1796, 1800-1830, 1833-1844, 1847-1851, 1854-1885, 1888-1891, 1894-1902, 1905-1906, 1909-1913, 1918-1928, 1931-1952, 1955-1956
Generated in workflow #625 for commit 1df4790 by the Vitest Coverage Report Action

@interim17 interim17 changed the title remove lines from agentPathGroup when removing paths fix: agent paths bug Dec 2, 2025
);
return;
}
this.agentPathGroup.remove(path.line);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the difference between agentPathGroup and agentPaths?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like the agentPaths are the line data and the group paths are the threeJS objects associated with that data?

Copy link
Contributor

Choose a reason for hiding this comment

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

agentPathGroup is a threejs Group object which is just a parent node for all the paths to belong to. agentPaths is a mapping of agent id to path, for all current agents that are drawing paths.

Copy link
Contributor

@toloudis toloudis left a comment

Choose a reason for hiding this comment

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

LGTM! the paths were never being removed from their Group!

@interim17 interim17 marked this pull request as ready for review December 2, 2025 18:28
@interim17 interim17 requested a review from a team as a code owner December 2, 2025 18:28
@interim17 interim17 requested review from ShrimpCryptid, Copilot and meganrm and removed request for a team, ShrimpCryptid and meganrm December 2, 2025 18:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a bug in agent path removal where paths were being deleted from the data structure without properly removing their visual representations from the scene graph.

  • Adds explicit removal of path lines from the agent path group before deleting path data
  • Ensures proper cleanup in both single path removal and bulk path removal operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1847 to +1849
this.agentPaths.forEach((path) => {
this.agentPathGroup.remove(path.line);
});
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider iterating with for...of instead of forEach for better performance when removing multiple paths, as it avoids function call overhead for each iteration.

Suggested change
this.agentPaths.forEach((path) => {
this.agentPathGroup.remove(path.line);
});
for (const path of this.agentPaths.values()) {
this.agentPathGroup.remove(path.line);
}

Copilot uses AI. Check for mistakes.
@interim17 interim17 merged commit a91a793 into main Dec 3, 2025
6 checks passed
@interim17 interim17 deleted the fix/path-bug branch December 3, 2025 17:27
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.

Agent trails don't disappear and reappear when looping

4 participants