You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A segment is scissors: it isolates a piece of a single source element. Today a rule can grab one contiguous piece (one from/to). This issue lets a rule grab several pieces from the same element — e.g. "first three words" and "last three words" from one messy chunk.
The point is human flexibility: look at any element and cut out the bits you can see, without pre-deciding use cases.
Progressive disclosure (the key UX rule)
One segment → no brackets. Add segment + boundary conditions, as today. Implicitly one segment for the whole rule. Nothing gets more verbose. Existing single-segment rules are unchanged (backwards compatible — Tailored Travel already relies on this).
Multiple segments → explicit segmentStart / segmentEnd brackets. Only when you want more than one piece from an element do you demarcate where each begins and ends.
Current model (for reference)
segment is effectively a verb today — a mode-switch marker meaning "conditions after me are boundaries, not matchers." It resolves to a single from/to (SegmentEvaluator.cs). Supported piece conditions: textFollows (from), textPrecedes (to), number (to end of numeric run). One from, one to, one piece.
Proposed model
segment becomes a noun: a bounded, named piece. A rule may contain one implicit segment or several explicit ones.
Explicit (multiple): repeated segmentStart … conditions … segmentEnd groups, each producing a piece.
Detection signal: no explicit segmentStart = one implicit segment; one or more segmentStart = explicit multi-segment mode.
Open questions (for the spec, not decided here)
Output of multiple pieces: combined into one string, or kept distinct? Deferred — "what happens to the pieces" is a separate downstream concern from the cutting. Cutting is the feature.
Data shape: conditions are a flat list today. Explicit segments need grouping/bracketing in the data model. Needs design.
The idea
A segment is scissors: it isolates a piece of a single source element. Today a rule can grab one contiguous piece (one from/to). This issue lets a rule grab several pieces from the same element — e.g. "first three words" and "last three words" from one messy chunk.
The point is human flexibility: look at any element and cut out the bits you can see, without pre-deciding use cases.
Progressive disclosure (the key UX rule)
segment+ boundary conditions, as today. Implicitly one segment for the whole rule. Nothing gets more verbose. Existing single-segment rules are unchanged (backwards compatible — Tailored Travel already relies on this).segmentStart/segmentEndbrackets. Only when you want more than one piece from an element do you demarcate where each begins and ends.Current model (for reference)
segmentis effectively a verb today — a mode-switch marker meaning "conditions after me are boundaries, not matchers." It resolves to a single from/to (SegmentEvaluator.cs). Supported piece conditions:textFollows(from),textPrecedes(to),number(to end of numeric run). One from, one to, one piece.Proposed model
segmentbecomes a noun: a bounded, named piece. A rule may contain one implicit segment or several explicit ones.segment+ piece conditions → one piece (today's behaviour).segmentStart … conditions … segmentEndgroups, each producing a piece.Detection signal: no explicit
segmentStart= one implicit segment; one or moresegmentStart= explicit multi-segment mode.Open questions (for the spec, not decided here)
Not in scope
Prerequisite / relation