One shared draft a contract, locked when all agree (phase 13, step 2)
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 1m27s
CI / release (push) Skipped

Until a contract is set, it is one open text for every side, as Alex
asked: our team edits it in the app, each other party on its link. Edits
are tracked changes in the author's color (crossed out, added,
highlighted with a comment) until the other side accepts or rejects
them. When no change or highlight is open and Lanna Desk and every party
agree, the text becomes a contract version that never changes, and the
draft locks.

- One side edits at a time: Edit takes the draft for 45 seconds, which
  every save renews; Done editing, leaving the page or silence gives it
  up. The editor saves 0.7 s after the last keystroke; the other pages
  ask for news every 3 s, so each side sees edits, who edits, agreements
  and the lock without reloading.
- A save may only touch the saver's own marks (reviews::check_save);
  accept, reject (or withdraw) and resolve are their own steps, journaled
  with the text concerned. A later change voids the agreements given.
- Notices: the other side's edits (one a half hour of editing), settled
  changes, agreements, the lock. The bell in the top bar counts the
  unseen (every 15 s); Notices lists them and marks them seen.
- The draft as a diff: the standing text against every open change taken.
- Migration 0015: contract_drafts, draft_saves and draft_agreements (both
  kept unchanged by a trigger), notices, notice_reads; drops step 1's
  review_rounds (only the demo held any). The review links stay as each
  party's way in.
- Property tests for the save rule and settling, the fuzz text target
  runs the parser, the save check and settling; integration tests play
  both sides to the lock. The demo's recording agreement has an open
  draft with the label's changes and a notice.
- PLAN: phase 13 rewritten; step 3 is the PDF and signing.
This commit is contained in:
grabowski committed 2026-11-23 16:14:14 +07:00
1 parent a4155548b8
commit 3dd9ab60e8
36 files changed
+3812 -2161

No files matched your search

+225
View File
@@ -2380,3 +2380,228 @@ details.move[open] .mini {
grid-template-columns: 2.4em 2.4em 1fr;
}
}
/* ---- phase 13 step 2: the bell and the shared draft */
.topacts {
display: flex;
align-items: center;
gap: 8px;
}
.ib.bell {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
text-decoration: none;
}
.ib.bell.has {
border-color: var(--label);
}
.bellcount {
position: absolute;
top: -6px;
right: -7px;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 9px;
font: 700 11px/18px var(--sans);
text-align: center;
color: #fff;
background: var(--bad);
}
.notices {
list-style: none;
margin: 0;
padding: 0;
}
.notices li {
display: flex;
flex-wrap: wrap;
gap: 4px 10px;
align-items: baseline;
padding: 10px 16px;
border-bottom: 1px solid var(--line);
}
.notices li:last-child {
border-bottom: 0;
}
.notices li.new {
background: var(--accent-s);
}
.notices li a {
flex: 1 1 260px;
}
.minihead {
font-size: 13px;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--label);
margin: 14px 0 6px;
}
/* the sides' colors: Lanna Desk first */
.w0 { --who: #2563c9; }
.w1 { --who: #8b3fd9; }
.w2 { --who: #0e8a7e; }
.w3 { --who: #c2570c; }
.w4 { --who: #b3245f; }
.w5 { --who: #6b7280; }
:root[data-theme="dark"] .w0 { --who: #7aa7ff; }
:root[data-theme="dark"] .w1 { --who: #c39bff; }
:root[data-theme="dark"] .w2 { --who: #4fd1c0; }
:root[data-theme="dark"] .w3 { --who: #ffa55c; }
:root[data-theme="dark"] .w4 { --who: #ff7ab0; }
:root[data-theme="dark"] .w5 { --who: #a5adba; }
.dr ins {
text-decoration: none;
color: var(--who);
background: color-mix(in srgb, var(--who) 13%, transparent);
border-bottom: 2px solid var(--who);
}
.dr del {
color: color-mix(in srgb, var(--who) 80%, var(--fg));
background: color-mix(in srgb, var(--who) 9%, transparent);
text-decoration: line-through 2px var(--who);
}
.dr mark {
color: inherit;
background: color-mix(in srgb, #f5c000 38%, transparent);
border-bottom: 2px dotted var(--who);
}
.dr del + ins {
margin-left: 2px;
}
/* the party's page of the draft takes the width the editor needs */
.cmain:has(#draft-editor) {
max-width: 1240px;
}
.dr .flash {
outline: 3px solid var(--accent);
outline-offset: 2px;
}
.drwrap .rvedit:not(.on) {
cursor: default;
caret-color: transparent;
}
.drwrap .rvedit.on {
border-color: var(--label);
}
.drbar {
display: flex;
flex-wrap: wrap;
gap: 8px 14px;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
margin-bottom: 10px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel);
}
.drstate {
font-weight: 600;
}
.drbtns {
display: flex;
gap: 8px;
}
.drcols {
display: grid;
grid-template-columns: minmax(0, 1fr) 320px;
gap: 18px;
align-items: start;
}
.drside {
position: sticky;
top: calc(var(--toph) + 12px);
max-height: calc(100vh - var(--toph) - 24px);
overflow-y: auto;
}
.drside .minihead:first-child {
margin-top: 0;
}
.drlist,
.drsides,
.drlegend {
list-style: none;
margin: 0;
padding: 0;
}
.drlist li,
.drsides li {
display: flex;
gap: 8px;
align-items: baseline;
padding: 7px 0;
border-bottom: 1px dashed var(--line);
font-size: 14px;
}
.drwhat {
flex: 1;
min-width: 0;
cursor: pointer;
overflow-wrap: anywhere;
}
.drwhat del {
color: var(--bad);
margin-right: 4px;
}
.drwhat ins {
color: var(--ok);
text-decoration: none;
border-bottom: 1px solid var(--ok);
}
.drwhat mark {
color: inherit;
background: color-mix(in srgb, #f5c000 38%, transparent);
}
.drwhat .sub {
display: block;
}
.dracts {
display: flex;
gap: 4px;
flex: none;
}
.drdot {
flex: none;
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--who);
transform: translateY(1px);
}
.drsides li.ok {
color: var(--ok);
}
.drlegend {
display: flex;
flex-wrap: wrap;
gap: 6px 14px;
margin-top: 6px;
font-size: 13px;
color: var(--mute);
}
.drlegend li {
display: flex;
gap: 6px;
align-items: baseline;
}
.drname {
display: grid;
gap: 4px;
margin: 10px 0 8px;
font-size: 13px;
}
#dr-agree {
margin-top: 10px;
}
@media (max-width: 1000px) {
.drcols {
grid-template-columns: 1fr;
}
.drside {
position: static;
max-height: none;
}
}