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.
| Part | Is |
|---|---|
ProposalContext | exactly what will be sent, part by part, each with the name the person reads |
ProposalChange | what the answer makes of what it was asked about: a text diff, or a value’s before and after |
ModelPass | which model answered and where it ran |
ProposalAccept | the single action accepting it runs |
ProposalDecision | Accept 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§
- Action
Proposal - One model call’s answer, shown before it is written.
- Action
Proposal View - 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.
- Context
Part - One part of what will be sent: its name, and its exact text.
- Diff
Line - One line of a text diff.
- Model
Pass - The model that answered: what the person calls it, and where it ran.
- Proposal
Accept - Accepting one proposal: the field edit it writes, and the change it is.
- Proposal
Context - Exactly what a model call is sent, as the person can read it.
- Proposal
Target - Where an accepted proposal writes: the field of the record
Rthe answer belongs to, and the characters of it the answer replaces.
Enums§
- DiffTag
- How one line of a text diff stands against the original.
- Model
Place - Where a model runs, which is what a person weighing a send wants to know.
- Proposal
Change - What an answer makes of what it was asked about.
- Proposal
Decision - 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
beforeandafter: 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.