Skip to main content

Module action_proposal

Module action_proposal 

Expand description

ActionProposal: one model call’s answer, shown before it is written.

A one-shot action (rewrite, translate, summarise) is one model call over an explicit context — a selection or a whole resource, optionally what surrounds it — and an answer the person accepts or rejects. That answer is never a document and has no lifetime: accepting writes it once, rejecting drops it. This module is the shared contract and surface, so every place that offers such an action offers the same one.

PartIs
ProposalContextexactly what will be sent, part by part, each with the name the person reads
ProposalChangewhat the answer makes of what it was asked about: a text diff, or a value’s before and after
ModelPasswhich model answered and where it ran
ProposalAcceptthe single action accepting it runs
ProposalDecisionAccept or Reject, with the change the person agreed to

ActionProposal::accept_action is the one write-back: a single typed field edit on the resource the proposal was made of (tilo_resource::Edit), submitted as the record’s own field edit, so it lands as one action — one change, one undo step, one History row — and a peer replays it for what it was. A selection is named by its character range, and ProposalAccept::refusal_over says why it must not be written when the field no longer holds what the model was shown. A secret field never offers any of this (TextInput::set_sensitive).

ActionProposalView is the shared surface: what the person asked for, the change as a line diff (or a value’s before and after), which model answers and where it runs, and Accept and Reject — built from Column, Text and Button, painting no control of its own.

Structs§

ActionProposal
One model call’s answer, shown before it is written.
ActionProposalView
A proposal on screen: its title, the model’s note, the change as a diff (or a value’s before and after), which model answered and where it ran, exactly what is sent, and Accept and Reject.
ContextPart
One part of what will be sent: its name, and its exact text.
DiffLine
One line of a text diff.
ModelPass
The model that answered: what the person calls it, and where it ran.
ProposalAccept
Accepting one proposal: the field edit it writes, and the change it is.
ProposalContext
Exactly what a model call is sent, as the person can read it.
ProposalTarget
Where an accepted proposal writes: the field of the record R the answer belongs to, and the characters of it the answer replaces.

Enums§

DiffTag
How one line of a text diff stands against the original.
ModelPlace
Where a model runs, which is what a person weighing a send wants to know.
ProposalChange
What an answer makes of what it was asked about.
ProposalDecision
What the person decided, and the change they decided it about.

Constants§

MAX_CONTEXT_BYTES
Most bytes one part of a context may carry: past it the person is sending a whole document rather than a selection, and is told so before it goes.
MAX_CONTEXT_PARTS
Most parts a context may send.
MAX_DIFF_LINES
Most diff lines a proposal shows; past it it says how many it left out.

Functions§

line_diff
The lines of before and after: the ones both share once, and the ones only one of them has, in the order they stand — a removed line before the added one that took its place.
titled
The name a title or a part is read under; the key itself when the catalogue has nothing for it, so a missing entry never hides a part.