Closed
Description
The problem
Today, our handling of positions is inconsistent. This problem manifests itself in multiple ways:
- We allow "end of" to appear in places that expect a position target, which means that
"paste end of air"
is a valid command, making it nearly impossible to get Talon to hear"take air past end of item bat"
. It instead hears two commands:"take air"
then"paste end of item bat"
- We need to have the
edit
action on regular targets, and position targets need all the methods from regular targets that they don't actually support - Targets have no strongly typed way of indicating that they expect a position
- Position targets are hacked to set delimiter to
""
when position is"end of"
or"start of"
The solution
We introduce a new type called a Destination
, both on the Talon and extension side. This type is distinct from a Target
, and will be used everywhere we expect a PositionTarget
today (eg "paste"
, second target of "bring"
, etc).
Destination
will be have the following interface:
type InsertionMode = "before" | "after" | "to";
interface Destination {
insertionMode: InsertionMode;
target: Target;
}
It will exist in the following places:
- As a capture Talon side
- As a new descriptor type, similar to today's
TargetDescriptor
- As a new post-processTargets type, like today's
Target
It will involve the following steps: