Skip to content

Add AddWaypoint Options To Context Menus #85

Description

@AlexKempen

Waypoints should be addable via context menus. In particular:

  • The OnFieldContextMenu should have the ability to create a waypoint on the field.
  • The WaypointContextMenu should allow the creation of a new waypoint immediately before or after it.
    There's a couple caveats to these behaviors:
  • Creating a waypoint on the field will require figuring out which path the waypoint should be added to (in the event there's multiple). I like the idea of adding it to the last active path with non-hidden waypoints, falling back to the last path if everything is hidden.
  • Creating waypoints will also need to behave properly with folders. Adding a waypoint before or after should insert into the folder of the targeted waypoint, if such a folder exists. This can be done using selectOwnerFolder followed by findIndex in the folders slice. slice can be used to insert things into an array.

I've added TODOs to waypointsSlice, pathsSlice, and foldersSlice in the branch associated with this issue. Implement the relevant logic, then add buttons which call the appropriate actions to ContextMenu.tsx. Don't forget to add conditional visibility logic so that, for example, the option to add before/after only appears if only a single waypoint is selected.

Metadata

Metadata

Assignees

Labels

5This issue is good for people with a decent to strong familiarity of the code base

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions