Module selection
Expand description
What a person has selected, carried to whoever is asked to act on it.
A person selects a sentence in a document, a range of cells or a row in a
list, and asks an agent about it. The agent must act at exactly that place
through the actions the resource publishes, so the selection travels in
the resource’s own terms: a SelectionPlace is the same value an action
takes as its place argument ({"item": id, "start": n, "end": n}, in
characters), an InteractionAnchor names selections that are not text
(cells, objects, rows), and a short excerpt lets a reader see what was
selected without opening the resource. None of it grants authority: the
agent still reaches the resource only through permission-filtered actions.
Structs§
- Selection
Anchor - What was selected: where (a place, an app-native anchor, or both) and a
short excerpt of it. Every part is optional; an empty anchor says
nothing and is dropped by
Self::non_empty. - Selection
Place - Where a selection is inside a resource: an item, a caret or a character
range inside one item. Its JSON form is exactly what an action’s place
parameter takes (
tilo_resource::Place), so an agent hands it back unchanged. - Selection
Subject - What a request is about: the resource a person had selected something in, and the selection. Only the subject of the request: it carries no authority, so a run about a selection may act anywhere its starter and its agent may (other resources, other apps), as any task may.
Constants§
- BOUND_
RESOURCE_ PREFIX - What a resource id starts with when a window publishes it under the
toolkit’s transport alias:
<prefix><host>:<publication>:<hex of the app's own id>. The window’s actions are addressed by the alias; the app names the resource by its own id (a selection’s subject does), so a reader matching the two decodes the alias (logical_resource_id). - MAX_
EXCERPT_ BYTES - The most bytes an excerpt may take at a trust boundary.
- MAX_
EXCERPT_ CHARS - The most characters an excerpt keeps. A selection is context for a
request, not its payload: a longer one is cut and ends in
…. - MAX_
PLACE_ ITEM_ BYTES - The most bytes a place’s item id may take.
- MAX_
SELECTED_ ITEMS - The most items a selection of several items (files, rows, cards) names one by one; the excerpt counts the rest.
- MAX_
SELECTION_ ANCHOR_ BYTES - The most bytes an interaction anchor may take, encoded.
Functions§
- excerpt_
of textas a selection excerpt: trimmed, at mostMAX_EXCERPT_CHARScharacters (a longer one is cut and ends in…), without control characters other than line breaks and tabs.Nonewhen nothing is left.- logical_
resource_ id - The app’s own id for the published resource
id: the id inside aBOUND_RESOURCE_PREFIXalias, oriditself when it is no alias (or a malformed one).