chore(tools, ticket): Preview the ticket a call will write - #992
Merged
Conversation
Approving a `ticket_create` or `ticket_comment` call meant reading its arguments as a function signature and imagining the file. Both now answer the format-arguments action by rendering the document in the shape it takes on disk, quoted as a blockquote so the marker runs down the whole preview and the reader can see where the ticket ends and the conversation resumes. `style.parameters` points at the tool's own command so JP shells out to render the call, and `format = "unattended"` lets that run before the approval prompt rather than after it. That mode carries a contract: the formatter must be side-effect-free. `store::peek_next_id` is what keeps it, reading the counter without advancing it, so a preview names the id `create` would hand out without burning it. Allocating during a preview would leave a gap in the board for every rejected call. `render::comment` renders one comment block standalone, which appending never needed. A comment preview shows it under the heading of the ticket it lands on, and says so when that ticket does not exist rather than previewing a call that is going to fail. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approving a
ticket_createorticket_commentcall meant reading its argumentsas a function signature and imagining the file. Both now answer the
format-arguments action by rendering the document in the shape it takes on disk,
quoted as a blockquote so the marker runs down the whole preview and the reader
can see where the ticket ends and the conversation resumes.
style.parameterspoints at the tool's own command so JP shells out to renderthe call, and
format = "unattended"lets that run before the approval promptrather than after it. That mode carries a contract: the formatter must be
side-effect-free. A create preview keeps it by rendering the document and
nothing else — no file, and no id drawn. Since RFD 102 the id lives only in the
filename, so the previewed document is complete without one, and the result line
names the id the ticket ends up with.
render::commentrenders one comment block standalone, which appending neverneeded. A comment preview shows it under the heading of the ticket it lands on,
and says so when that ticket does not exist rather than previewing a call that
is going to fail.