The other side reviews a draft (phase 13, step 1)
CI / secret scan (push) Successful in 5s
CI / fmt, clippy, tests (push) Successful in 49s
CI / release (push) Skipped

A lawyer sends a contract version to one of its parties with a link. On
it the other side marks the text up in an editor that keeps every change
visible, as tracked changes do: deleting our text crosses it out in red,
typing is marked as added in green, and the highlighter marks a passage
in yellow with a comment. Restore and Undo take marks back. They send it
back once a round; each later version comes on the same link.

- Migration 0014: review_links (token kept as a SHA-256, one open link a
  party) and review_rounds (the reply written once: their pieces, text,
  SHA-256, name, message; a trigger refuses any other change and every
  delete). Journal entries "sent for review", "review returned" (with the
  fingerprint of their text) and "review link closed"; audit entity
  "review".
- The reply is a list of pieces (same, ins, del, mark). The server checks
  that the pieces without the added ones are exactly the version sent, so
  nothing changes unseen (reviews::check).
- Our review page: their message, the changes numbered with the words
  around them and a box each, the highlights with comments, a git-style
  diff (line numbers, - and + lines, the changed words marked, three lines
  of context per hunk) and their markup. "Take the ticked changes" opens
  the contract page with the version form filled with our text plus those
  changes.
- static/review-editor.js: edits work on the pieces and redraw, so our
  text cannot vanish; keyboard compositions and edits the browser will not
  cancel are compared with the text and taken as edits.
- Property tests (any markup is accepted and taken back exactly; markup
  that changes our text unseen is refused), the fuzz text target runs
  reviews::check, integration tests, and the demo has the label's review
  of the recording agreement.
- PLAN: phase 13.
This commit is contained in:
grabowski committed 2026-11-23 15:31:43 +07:00
1 parent ff716eb9d3
commit a4155548b8
24 files changed
+3004 -6

No files matched your search

+182
View File
@@ -2198,3 +2198,185 @@ details.move[open] .mini {
.form + .tblwrap {
margin-top: 18px;
}
/* ---- phase 13: the review by the other side */
.rvtext {
white-space: pre-wrap;
overflow-wrap: anywhere;
font-size: 15.5px;
line-height: 1.7;
padding: 14px 16px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--field);
}
.rvedit {
min-height: 240px;
max-height: 70vh;
overflow-y: auto;
outline: none;
caret-color: var(--fg);
}
.rvedit:focus {
border-color: var(--stroke);
box-shadow: 0 0 0 3px var(--accent-s);
}
.rvtext ins,
.rvchanges ins {
text-decoration: none;
color: var(--ok);
background: var(--ok-s);
border-bottom: 2px solid var(--ok);
}
.rvtext del,
.rvchanges del {
color: var(--bad);
background: var(--bad-s);
text-decoration: line-through;
text-decoration-thickness: 2px;
}
.rvtext mark,
.rvhl mark,
.rvtools mark {
color: inherit;
background: color-mix(in srgb, #f5c000 38%, transparent);
border-radius: 2px;
}
.rvtext mark[title] {
border-bottom: 2px dotted var(--label);
}
.rvtools mark,
.rvtools del {
padding: 0 2px;
}
.rvc {
font-size: 12.5px;
color: var(--label);
font-style: italic;
margin: 0 4px;
}
.rvc::before {
content: "\2190 ";
}
.rvn {
display: inline-block;
min-width: 1.5em;
padding: 0 4px;
margin-right: 2px;
font: 600 11px/1.5 var(--sans);
text-align: center;
color: var(--on-pri);
background: var(--pri);
border-radius: 8px;
vertical-align: 0.35em;
}
.rvtools {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
margin: 0 0 10px;
}
.rvtools .rvcomment {
flex: 1 1 220px;
min-width: 0;
width: auto;
padding-top: 5px;
padding-bottom: 5px;
}
.rvchanges {
list-style: none;
margin: 0 0 12px;
padding: 0;
}
.rvchanges li {
padding: 8px 0;
border-bottom: 1px dashed var(--line);
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.rvchanges label.check {
font-weight: 400;
cursor: pointer;
align-items: baseline;
}
.rvchanges label.check input {
margin-top: 0;
}
.rvchanges .rvn {
vertical-align: baseline;
flex: none;
}
.rvchange {
min-width: 0;
}
.rvhl {
margin: 0;
padding-left: 18px;
}
.rvhl li {
padding: 4px 0;
}
.rvrounds {
margin: 6px 0 0;
padding-left: 18px;
}
.rvrounds li {
padding: 2px 0;
}
.rvmsg {
border-left: 3px solid var(--label);
padding: 4px 0 4px 12px;
}
.gitdiff {
font: 13.5px/1.55 var(--mono);
border: 1px solid var(--line);
border-radius: var(--radius);
overflow: hidden;
}
.gitdiff .gl {
display: grid;
grid-template-columns: 3.2em 3.2em 1fr;
}
.gitdiff .gn {
padding: 0 6px;
text-align: right;
color: var(--mute);
border-right: 1px solid var(--line);
user-select: none;
}
.gitdiff .gt {
padding: 0 10px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.gitdiff .gs {
display: inline-block;
width: 1.2em;
color: var(--mute);
user-select: none;
}
.gitdiff .removed {
background: var(--bad-s);
}
.gitdiff .added {
background: var(--ok-s);
}
.gitdiff .removed b {
font-weight: inherit;
background: color-mix(in srgb, var(--bad) 30%, transparent);
text-decoration: line-through;
}
.gitdiff .added b {
font-weight: inherit;
background: color-mix(in srgb, var(--ok) 32%, transparent);
}
.gitdiff .hunk {
color: var(--label);
background: var(--accent-s);
}
@media (max-width: 760px) {
.gitdiff .gl {
grid-template-columns: 2.4em 2.4em 1fr;
}
}