Repository navigation
Read and write decisions blocks in documents and posts - #165
Merged
Merged
Conversation
A decisions block in a document or a post now reads as a marker line, <!-- minka:decisions tool="…" … -->, and the same line written in Markdown becomes Minka's <minka-decisions> element again, its attributes in one order. docs show and posts show keep the marker alone in the body and print each block's rows in a section after it, named by the block's position and attributes. --body prints the body alone, as the edit takes it back. --json passes decisionBlocks through. Minka stores only the query of a block and lists the rows afresh on every reading, so the rows must never travel back as text. Dropping them on the way back would fail silently both ways: a line joined to the quote would go with it, and rows away from their marker would be sent. The rows therefore stand outside the editable body, as a quote that opens with read-out words, and a text that holds such a quote is refused before anything is sent. The text view cannot be cut at the next heading either, as a body may have its own; --body is the one output that is exactly the editable body. A marker that cannot be a block, such as one with an unknown attribute, no tool, text after its end or a value that is no identifier, is refused before anything is sent. Sent on, it would stand in the document as visible source. Whether the identifiers name a tool, label, status, event or card of the project stays Minka's to say: decisionBlockInvalid keeps Minka's message and gets a hint naming the commands the identifiers come from. documentLocked gets a hint that the document is unlocked on the web, since the CLI has no command for it. An exported page carries the marker and right below it the rows, because an export is read as files and a hidden marker alone shows nothing. Such a page is read again on every run, as its rows change without the page. The fake mirrors the contract as Minka's code has it: decisionBlocks on every answer with a document or a post, the tool null where the reader cannot see it, the copies of a lock, at most 20 blocks, and only the five attributes kept. A write checks the length of the text first and the blocks only on a document that is not locked, where a block the stored text holds passes unchecked; a locked document answers documentLocked later, from the edit, and so does restoring one of its versions. Resolves: https://minka.flownative.com/go/card/MNK-VX
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.
A decisions block, Minka's stored query for a list of decisions, comes to the command line in documents and posts (Minka #1014).
Writing: a block is a marker on a line of its own, in the style of the markers for link tiles and variables:
toolis required and every filter is optional; the values are identifiers. A malformed marker is refused before anything is sent (exit 1), with a hint that shows the form and where the identifiers come from. Minka'sdecisionBlockInvalidexits 9 with its message, which names the attribute, and a hint todecisions tools,decisions statuses,labels list,eventsandcards.documentLocked, for an edit and now also for restoring a version, gets a hint to unlock the document on the web.Reading: the element turns back into the same marker, so a text read, edited and written back keeps its blocks unchanged. In
docs show,posts showand the document a 409 prints, the decisions a block shows are read out under## Decisions blocks (N)after the body, never inside it. A text sent as Markdown that contains these read-out rows is refused. The new flag--bodyondocs showandposts showprints exactly the editable body, which the skill uses for an edit with--expect.--jsonpassesdecisionBlocksthrough unchanged.Export: an exported page carries the marker and the rows. A page with a block is always fetched again, because its rows change without the page.
Register: C-197 to C-201; the rules are in
docs/stable/rich-text.md. Checked against Minka's code and tests and the fake, not live yet. Two review rounds, with every finding fixed; among them, the first design dropped the rows from a body sent back, which could silently swallow text written after them. Each safeguard has a test and a sabotage proof.Resolves: https://minka.flownative.com/go/card/MNK-VX