diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md index 1b7db5e1cd..84a512a14b 100644 --- a/docs/LIEN_DESK_ARCHITECTURE.md +++ b/docs/LIEN_DESK_ARCHITECTURE.md @@ -778,6 +778,11 @@ last_updated: 2026-12-03 > **v2.9239 (the run and Payoffs read fresh too, the rest of finding 819):** `keepReleaseFacts` reads every release it is handed in one read and builds `releaseFactsPatch` on the facts the database holds, a release voided in the meantime is held with `RELEASE_RUN_WORDS.gone`, and a row's own `fields` is no longer written. > **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261203043643` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`. > `isOneLiveReleaseRefusal` reads the index's refusal by its name, and `loadFilings` in `LienInstrumentsModal` keeps the records it holds when a reload fails. +> **v2.9255 (a release's line names its lien, finding 816's first half):** a `release_of_record` row under *Filings on this job* draws `releaseLineWords` (`lienReleaseLine.ts`, `data-lien-release-line`): the lien from `releaseLineLien`, read over every filing on the job with the voided ones, then *saved December 2, 2026 · not yet recorded* or *recorded December 4, 2026 · instrument M* from `releaseOwnInstrument`. +> **v2.9260 (the refused void, the rest of finding 816):** **Void** on a filing's line goes through `pressVoid`, which asks `affidavitVoidRefusal` (`lienVoidRefusal.ts`) whether the affidavit has a live release as `releaseForAffidavit` reads it. +> A saved release opens the confirm window *Void the release first*, and **Take me there ›** lights the release's own **Void** (`filingVoidPressSelector`, `data-lien-void-coach`), then the affidavit's once that release is voided (`data-lien-void-way-back`). +> A release the county recorded opens *The county recorded this lien's release*, and **Go to the release of record ›** calls `onGoToRelease`, on which `LienInstrumentsModal` picks the paper and lands on the county's stamp, voiding nothing. +> The void of a recorded release from its own line asks first (`releaseVoidTakesWords`, `recordedReleaseVoidWindow`): **Keep the release** is the safe press and **Void the release anyway** is red. > **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule. > The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`. > The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien. diff --git a/docs/recent-features/v2.9255.md b/docs/recent-features/v2.9255.md new file mode 100644 index 0000000000..5b88dd18bd --- /dev/null +++ b/docs/recent-features/v2.9255.md @@ -0,0 +1,29 @@ +# v2.9255 — Release of record: a release's line names its lien (2026-12-03) + +Step 7 of punch list #479 (the release road's faults), finding 816, the half the card says does not wait. Client only. No migration, no function change, nothing owed on prod. Cut on top of v2.9240 (step 8), which changes the same tab. + +## What was wrong + +- Under **Filings on this job** a `release_of_record` row drew its kind, *Release of record*, and no fact. An affidavit's line names its filed day, its number and its service. +- On a job with two liens the two releases could not be told apart. After an affidavit was voided, the release left behind looked like any other. + +## What changed + +- [`lienReleaseLine.ts`](../../src/lib/jobs/lienReleaseLine.ts), new: `releaseLineLien` reads the lien a release belongs to from every filing on the job, voided ones included. It reads `fields.releasesFilingId` first. A release saved before that key was kept goes to the job's one live filed lien, and to none on a job with two. `releaseLineWords` writes the line: *for instrument N · saved · not yet recorded*, then *recorded December 4, 2026 · instrument M* once the county's day is kept. A lien with no number is named by its filed day. A voided lien reads *which is voided*. A release that names no lien reads *names no lien on this job*. +- The release's own number is `fields.releaseInstrument` alone, never the lien's number, as `releaseOwnInstrument` reads it (finding 809). +- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): the release's row draws the line (`data-lien-release-line`), with the same day words as the affidavit's line. +- The help guide *release a filed lien after it is paid* says what the line reads. + +## Not in this change + +- The void of an affidavit with a live release still goes through. The window that refuses it is drawn on the card and is the step's other half. +- Voiding a release the county recorded still takes two presses and no words. + +## Tests + +- `lienReleaseLine.test.ts`: the named lien, a voided lien, a release with no key on a job with one lien and with two, a key that points at no row, the saved and the recorded line, a lien with no number, two releases on one job. +- `LienFilingTabs.release.render.test.tsx`: the line on a saved release and on a recorded one, two releases told apart, a voided lien, and no such line on an affidavit. + +## Look owed + +- Read only, on the live site: a job with a saved release shows its lien's instrument number and saved day on the release's line under **Filings on this job**. Nothing is pressed. diff --git a/docs/recent-features/v2.9260.md b/docs/recent-features/v2.9260.md new file mode 100644 index 0000000000..c58733d424 --- /dev/null +++ b/docs/recent-features/v2.9260.md @@ -0,0 +1,34 @@ +# v2.9260 — Lien window: a lien with a release is not voided out from under it (2026-12-03) + +The rest of step 7 of punch list #479 (the release road's faults), finding 816. Built as the card's `mockup.html` draws it, on the owner's *Yes, build it* of 2026-12-02 and *Every pick* of 2026-12-03. Client only. No migration, no function change, nothing owed on prod. Cut on top of v2.9255, the step's first half. + +## What was wrong + +- **Void**, then **Confirm void**, on a filed affidavit that had a live release went through. The release was left with no lien, and Payoffs, the Board and the tab then offered a second release. +- A release the county had recorded voided from its own line with the same two presses and no words. + +## What changed + +- [`lienVoidRefusal.ts`](../../src/lib/jobs/lienVoidRefusal.ts), new and pure. `affidavitVoidRefusal` answers whether a filed affidavit has a live release, read as every other surface reads it (`releaseForAffidavit`), and whether the county has recorded it. `affidavitVoidRefusalWindow` writes the confirm window for each case. `releaseVoidTakesWords` and `recordedReleaseVoidWindow` are the void of a recorded release from its own line. +- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): **Void** on a filing's line goes through `pressVoid`. + - **A saved release.** The window *Void the release first* opens and nothing is voided. **Take me there ›** lights **Void** on the release's line through `landOnWhenThere`, with the line *Press Void here, then Confirm void. Then void the affidavit.* Once that release is voided, the affidavit's **Void** is lit with *The release is voided. The affidavit can be voided now.* + - **A release the county recorded.** The window *The county recorded this lien's release* names the county's day and the release's own number. **Go to the release of record ›** stands beside **Close**. It picks that lien on the tab and calls `onGoToRelease`. + - **A recorded release's own Void.** A confirm window, *The county recorded this release*. **Keep the release** is the safe press and takes the focus. **Void the release anyway** is red. + - Every other record keeps **Void**, then **Confirm void**. +- [`LienInstrumentsModal.tsx`](../../src/components/jobs/LienInstrumentsModal.tsx): `onGoToRelease` picks the paper *Release of record* and lands on the county's stamp, the light **Go to the release of record ›** already uses. +- The guides *file a lien and never miss its deadlines* and *release a filed lien after it is paid* say what the windows do. + +## Not in this change + +- The database refuses nothing here. A void written outside the Lien window is not stopped. +- The window's own switch of paper has no render test of its own: the tab's test proves the call, and the look below proves the landing. + +## Tests + +- `lienVoidRefusal.test.ts`: no release, a saved one, a recorded one, a job with two liens, a release with no key, records that are not filed affidavits, each window's words, and the plain-words rules on every sentence. +- `LienFilingTabs.release.render.test.tsx`: the refused void and Cancel; **Take me there ›**, the lit **Void**, the release's void and the way back; the recorded window and its press; an affidavit with no release; a job with two liens; the recorded release's own void, kept and voided; a saved release's two presses. + +## Look owed + +- A ZZ Test lien, with the live-write slot: a ZZ Test job with a filed affidavit and a saved release. Press **Void** on the affidavit's line, read the window, press **Take me there ›**, void the release, then void the affidavit. Every row is voided before the look ends, the release before its affidavit. +- A real lien is read only. No walker presses **Void** on one. diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx index 72a859d6f9..fdaa08ad73 100644 --- a/src/components/jobs/LienFilingTabs.release.render.test.tsx +++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx @@ -5,7 +5,7 @@ * save, and a job with two filed liens picks which one. The rules are held by `lienReleaseOfRecord.test.ts`. * Wiring only: the writes go to a stub and are read back off it. */ -import { afterEach, describe, expect, it, vi } from 'vitest' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react' import { makeJob, renderWithProviders } from '../../test/renderSmokeMocks' import type { BankCheck } from '../../lib/jobs/checkCleared' @@ -796,3 +796,145 @@ describe('Release of record: one live release a lien (finding 817, v2.9240)', () expect(onChanged).toHaveBeenCalled() }) }) + +describe('Release of record: a release’s line names its lien, its day and where it stands (finding 816, punch list #479 step 7)', () => { + const line = (id: string) => document.querySelector(`[data-lien-release-line="${id}"]`)! + + it('names the lien and says the county has not recorded it', () => { + draw({ job: paid(), filings: [lien() as never, release() as never] }) + expect(line('r1').textContent).toBe('for instrument 2026-0412207 · saved November 21, 2026 · not yet recorded') + }) + + it('names the county’s day and the release’s own number, never the lien’s as its own', () => { + draw({ job: paid(), filings: [lien() as never, release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } }) as never] }) + expect(line('r1').textContent).toBe('for instrument 2026-0412207 · recorded November 23, 2026 · instrument 2026-0431955') + }) + + it('tells the two releases of a job with two liens apart', () => { + const second = lien({ id: 'a2', recording_number: '2026-0500001', filed_at: '2026-11-16' }) + draw({ job: paid(), filings: [lien() as never, second as never, release() as never, release({ id: 'r2', fields: { releasesFilingId: 'a2' } }) as never] }) + expect(line('r1').textContent).toContain('for instrument 2026-0412207') + expect(line('r2').textContent).toContain('for instrument 2026-0500001') + }) + + it('says its lien is voided when the affidavit under it was voided', () => { + draw({ job: paid(), filings: [lien({ voided_at: '2026-11-25T15:00:00Z' }) as never, release() as never] }) + expect(line('r1').textContent).toBe('for instrument 2026-0412207, which is voided · saved November 21, 2026 · not yet recorded') + }) + + it('draws no such line on an affidavit', () => { + draw({ job: paid(), filings: [lien() as never] }) + expect(document.querySelector('[data-lien-release-line]')).toBeNull() + }) +}) + +const voids = vi.hoisted(() => ({ ids: [] as string[] })) +vi.mock('../../lib/jobs/lienFilingVoidIo', () => ({ + voidLienFiling: vi.fn(async (f: { id: string }) => { + voids.ids.push(f.id) + return 'none' + }), +})) + +describe('Filings on this job: the void of an affidavit with a live release is refused (finding 816, punch list #479 step 7)', () => { + const row = (id: string) => document.querySelector(`[data-lien-filing-row="${id}"]`)! + const voidPress = (id: string) => row(id).querySelector('[data-lien-filing-void]')! + beforeEach(() => { + voids.ids = [] + }) + + it('opens a window, voids nothing, and Cancel leaves the line as it was', async () => { + draw({ job: paid(), filings: [lien() as never, release() as never] }) + fireEvent.click(voidPress('a1')) + const dialog = await screen.findByRole('alertdialog', { name: 'Void the release first' }) + expect(dialog.textContent).toContain('This lien has a release of record, saved November 21, 2026. A release needs its lien.') + expect(dialog.textContent).toContain('Void the release. Then void the affidavit.') + fireEvent.click(screen.getByRole('button', { name: 'Cancel' })) + await waitFor(() => expect(screen.queryByRole('alertdialog', { name: 'Void the release first' })).toBeNull()) + expect(voidPress('a1').textContent).toBe('Void') + expect(document.querySelector('[data-lien-void-coach]')).toBeNull() + expect(voids.ids).toEqual([]) + }) + + it('takes the person to the release’s Void, then back to the affidavit once the release is voided', async () => { + draw({ job: paid(), filings: [lien() as never, release() as never] }) + fireEvent.click(voidPress('a1')) + fireEvent.click(await screen.findByRole('button', { name: 'Take me there ›' })) + await waitFor(() => expect(row('r1').querySelector('[data-lien-void-coach]')!.textContent).toBe('Press Void here, then Confirm void. Then void the affidavit.')) + expect(voidPress('r1').getAttribute('data-landed')).toBe('yes') + expect(voids.ids).toEqual([]) + fireEvent.click(voidPress('r1')) + expect(voidPress('r1').textContent).toBe('Confirm void') + fireEvent.click(voidPress('r1')) + await waitFor(() => expect(voids.ids).toEqual(['r1'])) + await waitFor(() => expect(row('a1').querySelector('[data-lien-void-way-back]')!.textContent).toBe('The release is voided. The affidavit can be voided now.')) + expect(document.querySelector('[data-lien-void-coach]')).toBeNull() + expect(voidPress('a1').getAttribute('data-landed')).toBe('yes') + }) + + it('says the county’s record stands for a recorded release, and its press opens the release of record and voids nothing', async () => { + const onGoToRelease = vi.fn() + draw({ job: paid(), activeTab: 'affidavit', onGoToRelease, filings: [lien() as never, release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } }) as never] }) + fireEvent.click(voidPress('a1')) + const dialog = await screen.findByRole('alertdialog', { name: 'The county recorded this lien’s release' }) + expect(dialog.textContent).toContain('The release was recorded November 23, 2026 as 2026-0431955. The county’s record stands.') + expect(dialog.textContent).toContain('Ask counsel before either paper is voided.') + expect(screen.getByRole('button', { name: 'Close' })).toBeTruthy() + fireEvent.click(screen.getByRole('button', { name: 'Go to the release of record ›' })) + await waitFor(() => expect(onGoToRelease).toHaveBeenCalledWith('a1')) + expect(voids.ids).toEqual([]) + expect(document.querySelector('[data-lien-void-coach]')).toBeNull() + }) + + it('voids an affidavit with no release with the same two presses as before', async () => { + draw({ job: paid(), filings: [lien() as never] }) + fireEvent.click(voidPress('a1')) + expect(voidPress('a1').textContent).toBe('Confirm void') + expect(screen.queryByRole('alertdialog')).toBeNull() + fireEvent.click(voidPress('a1')) + await waitFor(() => expect(voids.ids).toEqual(['a1'])) + }) + + it('refuses only the lien the release names on a job with two', async () => { + const second = lien({ id: 'a2', recording_number: '2026-0500001', filed_at: '2026-11-16' }) + draw({ job: paid(), filings: [lien() as never, second as never, release() as never] }) + fireEvent.click(voidPress('a2')) + expect(voidPress('a2').textContent).toBe('Confirm void') + fireEvent.click(voidPress('a1')) + expect(await screen.findByRole('alertdialog', { name: 'Void the release first' })).toBeTruthy() + }) +}) + +describe('Filings on this job: voiding a release the county recorded takes words (finding 816)', () => { + const voidPress = (id: string) => document.querySelector(`[data-lien-filing-row="${id}"] [data-lien-filing-void]`)! + const recorded = () => release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } }) + beforeEach(() => { + voids.ids = [] + }) + + it('asks in a window, and Keep the release voids nothing', async () => { + draw({ job: paid(), filings: [lien() as never, recorded() as never] }) + fireEvent.click(voidPress('r1')) + const dialog = await screen.findByRole('alertdialog', { name: 'The county recorded this release' }) + expect(dialog.textContent).toContain('It was recorded November 23, 2026 as 2026-0431955. Voiding it here does not undo the county’s record.') + expect(dialog.textContent).toContain('Ask counsel first.') + fireEvent.click(screen.getByRole('button', { name: 'Keep the release' })) + await waitFor(() => expect(screen.queryByRole('alertdialog')).toBeNull()) + expect(voidPress('r1').textContent).toBe('Void') + expect(voids.ids).toEqual([]) + }) + + it('voids on the red press that names the act', async () => { + draw({ job: paid(), filings: [lien() as never, recorded() as never] }) + fireEvent.click(voidPress('r1')) + fireEvent.click(await screen.findByRole('button', { name: 'Void the release anyway' })) + await waitFor(() => expect(voids.ids).toEqual(['r1'])) + }) + + it('leaves a release that is only saved to the two presses', () => { + draw({ job: paid(), filings: [lien() as never, release() as never] }) + fireEvent.click(voidPress('r1')) + expect(voidPress('r1').textContent).toBe('Confirm void') + expect(screen.queryByRole('alertdialog')).toBeNull() + }) +}) diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx index 560c542212..23bebc0652 100644 --- a/src/components/jobs/LienFilingTabs.tsx +++ b/src/components/jobs/LienFilingTabs.tsx @@ -65,6 +65,7 @@ import { lienServeHasContractor } from '../../lib/jobs/lienServeNumbers' import { LienServeCopiesPress } from './LienServeCopiesPress' import { withSupabaseRetry, formatErrorMessage } from '../../utils/errorHandling' import { useToastContext } from '../../contexts/ToastContext' +import { useConfirmDialog } from '../../contexts/ConfirmDialogContext' import { useAuth } from '../../hooks/useAuth' import { LienVoidedByHandRecords } from './LienVoidedByHandRecords' import { LienVoidedRecords } from './LienVoidedRecords' @@ -89,6 +90,8 @@ import { MoneyText } from '../Money' import { ChangeableValue, ValueLine, ValueLines, ValueSentence, WorkedOutValue } from '../valuesInPlace/ValuesInPlace' import { plainSentence } from '../../lib/valuesInPlace' import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, isOneLiveReleaseRefusal, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord' +import { releaseLineWords } from '../../lib/jobs/lienReleaseLine' +import { VOID_REFUSAL_WORDS, affidavitVoidRefusal, affidavitVoidRefusalWindow, filingVoidPressSelector, recordedReleaseVoidWindow, releaseVoidTakesWords } from '../../lib/jobs/lienVoidRefusal' import { payoffNote } from '../../lib/jobs/lienPayoffFields' import { releaseByNow, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint } from '../../lib/jobs/lienReleaseFacts' import { countedLabel } from '../../lib/batchWords' @@ -156,6 +159,7 @@ export default function LienFilingTabs({ landRelease = null, landAffidavit = null, releaseLienId = null, + onGoToRelease, headSlotRef, onServePrinted, onClose, @@ -190,6 +194,8 @@ export default function LienFilingTabs({ landAffidavit?: { at: number } | null /** The filed lien the opener's press was made on (finding 808): the Release of record tab opens on that lien, not on the job's first. Absent, the tab picks. */ releaseLienId?: string | null + /** The window that refuses an affidavit's void sends the person to that lien's release of record (finding 816): the window picks the paper and lands on the county's stamp. */ + onGoToRelease?: (affidavitId: string) => void /** The Lien window's slot at the top of each paper's pane (Way 2 of finding 803): on a computer the window draws its steps' band and the papers' bar there, inside the paper's own scroll. */ headSlotRef?: (el: HTMLElement | null) => void /** The filed lien's copies went to the printer from this window's press. */ @@ -221,10 +227,14 @@ export default function LienFilingTabs({ const isMobile = useIsMobile() const { user: authUser, role: authRole, profileName } = useAuth() const { showToast } = useToastContext() + const confirmDialog = useConfirmDialog() const [pdfBusy, setPdfBusy] = useState(false) const [encloseInvoice, setEncloseInvoice] = useState(true) const enclosedDocs = useMemo(() => (encloseInvoice ? invoiceDocs : []), [encloseInvoice, invoiceDocs]) const [voidPendingId, setVoidPendingId] = useState(null) + // The refused void's way (finding 816, v2.9260): the release whose **Void** is lit for the affidavit that was pressed, then the affidavit once that release is voided. + const [voidCoach, setVoidCoach] = useState<{ releaseId: string; affidavitId: string } | null>(null) + const [voidWayBackId, setVoidWayBackId] = useState(null) const [recordStep, setRecordStep] = useState<'notice_sends' | 'notice_by_hand' | 'affidavit_filing' | 'affidavit_service' | null>(null) const [ownerSend, setOwnerSend] = useState({ method: 'certified_mail', tracking: '', sentOn: todayYmd(), receiptUrl: '' }) const [ocSend, setOcSend] = useState({ method: 'certified_mail', tracking: '', sentOn: todayYmd(), receiptUrl: '' }) @@ -1191,12 +1201,49 @@ export default function LienFilingTabs({ const outcome = await voidLienFiling({ id: f.id, kind: f.kind }) showToast(lienVoidPaperWords(outcome, f.kind), lienVoidPaperStuck(outcome) ? 'error' : 'success') setVoidPendingId(null) + // The release the refused void sent the person to is voided: the affidavit's line says so and its Void is lit. + if (voidCoach?.releaseId === f.id) { + const affidavitId = voidCoach.affidavitId + setVoidCoach(null) + setVoidWayBackId(affidavitId) + landUndo.current?.() + landUndo.current = landOnWhenThere(() => document.querySelector(filingVoidPressSelector(affidavitId))) + } + if (voidWayBackId === f.id) setVoidWayBackId(null) onChanged() } catch (e) { showToast(formatErrorMessage(e, 'Could not void the record.'), 'error') } } + /** + * **Void** on a filing's line (finding 816, v2.9260). An affidavit with a live release is not voided: a window + * refuses it and its blue press leads to the release (`lienVoidRefusal.ts`). A release the county recorded asks + * in a confirm window first. Every other record turns its press into **Confirm void**, as before. + */ + const pressVoid = async (f: JobLienFilingRow) => { + const refusal = affidavitVoidRefusal(f, live) + if (refusal) { + if (!(await confirmDialog(affidavitVoidRefusalWindow(refusal, demandDate)))) return + if (refusal.kind === 'saved') { + setVoidWayBackId(null) + setVoidCoach({ releaseId: refusal.releaseId, affidavitId: f.id }) + landUndo.current?.() + landUndo.current = landOnWhenThere(() => document.querySelector(filingVoidPressSelector(refusal.releaseId))) + } else { + // The county's record: the release's own paper, on this lien, with the stamp lit. Nothing is voided. + setReleaseTargetId(f.id) + onGoToRelease?.(f.id) + } + return + } + if (releaseVoidTakesWords(f)) { + if (await confirmDialog(recordedReleaseVoidWindow(f, demandDate))) await voidFiling(f) + return + } + setVoidPendingId(f.id) + } + // ---------- render helpers ---------- const kindLabel = (k: string) => @@ -1267,6 +1314,12 @@ export default function LienFilingTabs({ {f.kind === 'affidavit' && f.filed_at ? `filed ${demandDate(f.filed_at)} · #${f.recording_number || '—'} · ${f.served_at ? `served ${demandDate(f.served_at)}` : `serve by ${demandDate(f.serve_due ?? '')}`}` : ''} {f.kind === 'notice_53_056' || f.kind === 'retainage_53_057' ? : ''} + {/* A release names its lien, its day and where it stands (finding 816, v2.9255): two on one job are told apart, and one whose lien is voided says so. */} + {f.kind === 'release_of_record' ? ( + + {releaseLineWords({ fields: f.fields, created_at: f.created_at ?? '', filed_at: f.filed_at }, filings, demandDate)} + + ) : null} {isLienAppliedRow(f as unknown as LienAppliedRow) ? ( {lienAppliedRowWords(f as unknown as LienAppliedRow, calendarYmdInAppTzFromIso(f.created_at ?? ''))} @@ -1324,15 +1377,26 @@ export default function LienFilingTabs({ View {voidPendingId === f.id ? ( - ) : ( - )} + {/* The refused void's way (finding 816): what to press on the release's line, then the way back on the affidavit's. */} + {voidCoach?.releaseId === f.id ? ( +
+ {VOID_REFUSAL_WORDS.pressVoidHere} +
+ ) : null} + {voidWayBackId === f.id ? ( +
+ {VOID_REFUSAL_WORDS.wayBack} +
+ ) : null} {/* What went out (`lienMailProof.ts`): every mailed file with its own link, each envelope's number and receipt, and the receipt press. */}
{ + setActiveTab('release_record') + setLandRelease({ at: Date.now() }) + }} headSlotRef={setHeadSlot} // The copies went to the printer here: this window's card reads the next stage at once, and the opener reads again once the print is filed. onServePrinted={(id) => { diff --git a/src/content/help/file-a-lien-and-never-miss-its-deadlines.md b/src/content/help/file-a-lien-and-never-miss-its-deadlines.md index 7dfeba8729..a632112625 100644 --- a/src/content/help/file-a-lien-and-never-miss-its-deadlines.md +++ b/src/content/help/file-a-lien-and-never-miss-its-deadlines.md @@ -156,6 +156,8 @@ Was the lien filed without this tab, by counsel or on paper from elsewhere? The Was a filing recorded on the wrong job, or with the wrong day? Open that job's Lien window. Find the record under **Filings on this job**. Press **Void** on it, then **Confirm void**. The lien's paper goes back to the Lien desk by itself. A paper the leader approved is approved again, so nobody asks him twice. The Board shows it in **Ready to file**, or in **Held** when a fact holds it. A paper nobody had approved goes back to a draft. Then record the lien again with the right facts. +Does the lien have a release of record? The app does not void the affidavit. A window says *Void the release first*. Press {{button:blue|Take me there ›}}. The release's **Void** lights up on its line. Press it, then **Confirm void**. The affidavit's line then says it can be voided now. Has the county already recorded the release? The window says so instead. Press {{button:blue|Go to the release of record ›}} to read the county's day and number. Ask counsel before either paper is voided. + ### Several liens back from the clerk Did a stack of liens come back from the County Clerk together? Record them in one sitting. Open the Lien desk's To do. On the Board, find the bin **Ready to file**. Under its print a line reads *Back from the clerk?* Press {{button:outline|Enter document numbers · 3 ›}} beside it. The press counts the liens in the bin. One window opens. It is named **Back from the clerk: record the filings**. diff --git a/src/content/help/release-a-filed-lien-after-it-is-paid.md b/src/content/help/release-a-filed-lien-after-it-is-paid.md index 75a7e25ef2..d110fe21a3 100644 --- a/src/content/help/release-a-filed-lien-after-it-is-paid.md +++ b/src/content/help/release-a-filed-lien-after-it-is-paid.md @@ -131,6 +131,8 @@ Back on the Lien desk, press {{button:blue|Record the county’s stamp ›}} on Until that day is kept, nothing reads *Released*. The top of the Lien window says *The release was made* with its day. The job's row in Accounts Receivable reads *Release saved*. The lien stands on the county's record until the county records the release. +Under **Filings on this job** the release's line names its lien by instrument number. It shows the day the release was saved and says *not yet recorded*. After the county's day is kept it shows that day and the release's own instrument number. + The stamped copy goes on the release's line under **Filings on this job**. Press *link the saved copy* there. Then press {{button:outline|Upload the scanned PDF}} and pick the scan from this computer. The scan goes in the job's Drive folder and its link is kept on the line. A Drive link can be pasted there too. ## Print the releases in the run @@ -165,6 +167,14 @@ The office takes a returned check off its job in Accounts Receivable. The check' Accounts Receivable shows the liens too. The check's case has a box named **Liens on this money**. Read [the liens on a check that came back](/help/match-bank-deposits-to-bills#the-liens-on-a-check-that-came-back). +## Void a release + +A release is voided on its line under **Filings on this job**. Press **Void**, then **Confirm void**. You can then make the release again. + +Has the county already recorded the release? **Void** opens a window first. It says that voiding the release here does not undo the county's record. Press {{button:blue|Keep the release}} to leave it as it is. Press {{button:red|Void the release anyway}} only after you ask counsel. + +A lien that has a release is not voided first. The app sends you to the release. Read [file a lien and never miss its deadlines](/help/file-a-lien-and-never-miss-its-deadlines). + ## What the window does not do The window does not make the paper. The Lien window's **Release of record** tab does that. A single payment is recorded on the job's Bill tab. The window says which one to open and when. diff --git a/src/content/releaseNotes/v2.9255.ts b/src/content/releaseNotes/v2.9255.ts new file mode 100644 index 0000000000..b45998102b --- /dev/null +++ b/src/content/releaseNotes/v2.9255.ts @@ -0,0 +1,16 @@ +import type { ReleaseNote } from '../../lib/releaseNotes' + +const note: ReleaseNote = { + version: 'v2.9255', + date: '2026-12-03', + title: 'Release of record: a release’s line names its lien', + kind: 'fix', + highlights: [ + 'Under Filings on this job, a release’s line read Release of record and nothing else. Two releases on one job could not be told apart.', + 'The line now names the lien by its instrument number, the day the release was saved, and that the county has not recorded it yet.', + 'Once the county’s day is kept, the line shows that day and the release’s own instrument number.', + 'A release whose lien was voided says so on its line.', + ], +} + +export default note diff --git a/src/content/releaseNotes/v2.9260.ts b/src/content/releaseNotes/v2.9260.ts new file mode 100644 index 0000000000..8a5ec7691d --- /dev/null +++ b/src/content/releaseNotes/v2.9260.ts @@ -0,0 +1,16 @@ +import type { ReleaseNote } from '../../lib/releaseNotes' + +const note: ReleaseNote = { + version: 'v2.9260', + date: '2026-12-03', + title: 'Lien window: a lien with a release is not voided out from under it', + kind: 'fix', + highlights: [ + 'Void on a filed lien that has a release of record no longer goes through. A window says to void the release first.', + 'Take me there lights Void on the release’s own line. Once the release is voided, the lien’s line says it can be voided now.', + 'When the county has already recorded the release, the window says the county’s record stands. Go to the release of record shows the county’s day and number, and voids nothing.', + 'Void on a release the county recorded now asks first. Keep the release is the safe press.', + ], +} + +export default note diff --git a/src/lib/jobs/lienReleaseLine.test.ts b/src/lib/jobs/lienReleaseLine.test.ts new file mode 100644 index 0000000000..5e3b0edd23 --- /dev/null +++ b/src/lib/jobs/lienReleaseLine.test.ts @@ -0,0 +1,71 @@ +import { describe, expect, it } from 'vitest' +import { releaseLineLien, releaseLineWords, type ReleaseLineFiling } from './lienReleaseLine' + +// Every id, number and day here is made up. +const fmt = (ymd: string) => `<${ymd}>` +const lien = (id: string, over: Partial = {}): ReleaseLineFiling => ({ id, kind: 'affidavit', filed_at: '2026-11-09', recording_number: '2026-0000001', voided_at: null, ...over }) +const release = (fields: Record, filed_at: string | null = null) => ({ fields, created_at: '2026-12-02T18:00:00Z', filed_at }) + +describe('releaseLineLien', () => { + it('reads the lien the release names', () => { + const all = [lien('a1'), lien('a2', { recording_number: '2026-0000002', filed_at: '2026-11-20' })] + expect(releaseLineLien(release({ releasesFilingId: 'a2' }), all)).toEqual({ how: 'live', instrument: '2026-0000002', filedYmd: '2026-11-20' }) + }) + + it('says when the named lien is voided', () => { + const all = [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })] + expect(releaseLineLien(release({ releasesFilingId: 'a1' }), all)).toMatchObject({ how: 'voided', instrument: '2026-0000001' }) + }) + + it('gives a release with no key to the job’s one filed lien', () => { + expect(releaseLineLien(release({}), [lien('a1')])).toMatchObject({ how: 'live', instrument: '2026-0000001' }) + }) + + it('names no lien for a release with no key on a job with two filed liens', () => { + expect(releaseLineLien(release({}), [lien('a1'), lien('a2')])).toEqual({ how: 'none' }) + }) + + it('names no lien when the key points at no row, and never claims a voided or an unfiled lien by default', () => { + expect(releaseLineLien(release({ releasesFilingId: 'gone' }), [lien('a1')])).toEqual({ how: 'none' }) + expect(releaseLineLien(release({}), [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })])).toEqual({ how: 'none' }) + expect(releaseLineLien(release({}), [lien('a1', { filed_at: null })])).toEqual({ how: 'none' }) + }) + + it('reads only affidavits as liens', () => { + const all: ReleaseLineFiling[] = [{ id: 'n1', kind: 'notice_53_056', filed_at: '2026-10-01', recording_number: null }] + expect(releaseLineLien(release({ releasesFilingId: 'n1' }), all)).toEqual({ how: 'none' }) + }) +}) + +describe('releaseLineWords', () => { + it('names the lien, the saved day and that the county has not recorded it', () => { + expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · saved <2026-12-02> · not yet recorded') + }) + + it('names the county’s day and the release’s own number once they are kept', () => { + expect(releaseLineWords(release({ releasesFilingId: 'a1', releaseInstrument: '2026-0000099' }, '2026-12-04'), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · recorded <2026-12-04> · instrument 2026-0000099') + }) + + it('never shows the lien’s number as the release’s own', () => { + expect(releaseLineWords(release({ releasesFilingId: 'a1' }, '2026-12-04'), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · recorded <2026-12-04> · no instrument number kept') + }) + + it('names a lien with no number by its filed day', () => { + expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1', { recording_number: ' ' })], fmt)).toBe('for the lien filed <2026-11-09> · saved <2026-12-02> · not yet recorded') + }) + + it('says a voided lien is voided', () => { + expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })], fmt)).toBe('for instrument 2026-0000001, which is voided · saved <2026-12-02> · not yet recorded') + }) + + it('says a release names no lien', () => { + expect(releaseLineWords(release({}), [lien('a1'), lien('a2')], fmt)).toBe('names no lien on this job · saved <2026-12-02> · not yet recorded') + }) + + it('tells two releases on one job apart', () => { + const all = [lien('a1'), lien('a2', { recording_number: '2026-0000002' })] + const one = releaseLineWords(release({ releasesFilingId: 'a1' }), all, fmt) + const two = releaseLineWords(release({ releasesFilingId: 'a2' }), all, fmt) + expect(one).not.toBe(two) + }) +}) diff --git a/src/lib/jobs/lienReleaseLine.ts b/src/lib/jobs/lienReleaseLine.ts new file mode 100644 index 0000000000..86a7b2c368 --- /dev/null +++ b/src/lib/jobs/lienReleaseLine.ts @@ -0,0 +1,51 @@ +/** + * What a release of record's line says under **Filings on this job** (finding 816, punch list #479, step 7). + * + * The line read *Release of record* and nothing else. On a job with two liens the two releases could not be told + * apart, and a release whose lien was voided looked like any other. The line now names three things: + * + * - its lien: *for instrument N*, or *for the lien filed November 9, 2026* when the lien has no number yet; + * - its own day: *saved December 2, 2026* until the county’s day is kept, then *recorded December 4, 2026*; + * - where it stands: *not yet recorded*, or the number the county gave the release itself. + * + * A release names its lien in `fields.releasesFilingId`. One saved before that key was kept belongs to the job's + * one filed lien, as `releaseForAffidavit` reads it. A release whose lien is voided says so, and one that names no + * lien on a job with two says that. + * + * The app counts the days and does not judge the law. + */ +import { calendarYmdInAppTzFromIso } from '../../utils/dateUtils' +import { releaseAffidavitId, releaseOwnInstrument, type LienPayoffRelease } from './lienPayoff' + +/** A filing as the line needs it: any row of the job, voided ones included. */ +export type ReleaseLineFiling = { id: string; kind: string; filed_at: string | null; recording_number: string | null; voided_at?: string | null } + +/** The lien a release's line names: a live filed lien, a voided one, or none. */ +export type ReleaseLineLien = { how: 'live' | 'voided'; instrument: string; filedYmd: string } | { how: 'none' } + +/** The lien this release belongs to, read from every filing on the job (`all`), voided ones included. */ +export function releaseLineLien(release: Pick, all: ReadonlyArray): ReleaseLineLien { + const affidavits = all.filter((f) => f.kind === 'affidavit') + const named = releaseAffidavitId(release) + const liveFiled = affidavits.filter((a) => !a.voided_at && a.filed_at) + // A release saved before the key was kept belongs to the job's one filed lien, and to none on a job with two. + const lien = named ? affidavits.find((a) => a.id === named) : liveFiled.length === 1 ? liveFiled[0] : undefined + if (!lien) return { how: 'none' } + return { how: lien.voided_at ? 'voided' : 'live', instrument: (lien.recording_number ?? '').trim(), filedYmd: (lien.filed_at ?? '').slice(0, 10) } +} + +/** + * The line's words: *for instrument 2026-0412207 · saved December 2, 2026 · not yet recorded*. `fmt` writes a day + * ('YYYY-MM-DD') as the line's other rows do. + */ +export function releaseLineWords(release: Pick, all: ReadonlyArray, fmt: (ymd: string) => string): string { + const lien = releaseLineLien(release, all) + const forLien = + lien.how === 'none' + ? 'names no lien on this job' + : `${lien.instrument ? `for instrument ${lien.instrument}` : lien.filedYmd ? `for the lien filed ${fmt(lien.filedYmd)}` : 'for a lien not yet filed'}${lien.how === 'voided' ? ', which is voided' : ''}` + const recordedYmd = (release.filed_at ?? '').slice(0, 10) + if (!recordedYmd) return `${forLien} · saved ${fmt(calendarYmdInAppTzFromIso(release.created_at))} · not yet recorded` + const own = releaseOwnInstrument(release) + return `${forLien} · recorded ${fmt(recordedYmd)} · ${own ? `instrument ${own}` : 'no instrument number kept'}` +} diff --git a/src/lib/jobs/lienVoidRefusal.test.ts b/src/lib/jobs/lienVoidRefusal.test.ts new file mode 100644 index 0000000000..7c77f828be --- /dev/null +++ b/src/lib/jobs/lienVoidRefusal.test.ts @@ -0,0 +1,112 @@ +import { describe, expect, it } from 'vitest' +import { VOID_REFUSAL_WORDS, affidavitVoidRefusal, affidavitVoidRefusalWindow, filingVoidPressSelector, recordedReleaseVoidWindow, releaseVoidTakesWords } from './lienVoidRefusal' +import { plainWordsFailures } from '../plainWords' + +// Every id, number and day here is made up. +const fmt = (ymd: string) => `<${ymd}>` +const row = (over: Record) => ({ id: 'x', job_id: 'j1', kind: 'affidavit', amount: 100, county: 'Travis', recording_number: '2026-0000001', filed_at: '2026-11-09' as string | null, created_at: '2026-11-09T15:00:00Z', fields: {} as unknown, ...over }) +const lien = (id = 'a1', over: Record = {}) => row({ id, ...over }) +const release = (id = 'r1', over: Record = {}) => row({ id, kind: 'release_of_record', filed_at: null, created_at: '2026-12-02T18:00:00Z', fields: { releasesFilingId: 'a1' }, ...over }) + +describe('affidavitVoidRefusal', () => { + it('lets the void go on with no release', () => { + const a = lien() + expect(affidavitVoidRefusal(a, [a])).toBeNull() + }) + + it('refuses while a saved release names the lien', () => { + const a = lien() + expect(affidavitVoidRefusal(a, [a, release()])).toEqual({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' }) + }) + + it('refuses with the county’s day and the release’s own number once it is recorded', () => { + const a = lien() + const r = release('r1', { filed_at: '2026-12-04', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0000099' } }) + expect(affidavitVoidRefusal(a, [a, r])).toEqual({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' }) + }) + + it('reads each lien for itself on a job with two', () => { + const a = lien() + const b = lien('a2', { recording_number: '2026-0000002' }) + const all = [a, b, release('r2', { fields: { releasesFilingId: 'a2' } })] + expect(affidavitVoidRefusal(a, all)).toBeNull() + expect(affidavitVoidRefusal(b, all)).toMatchObject({ kind: 'saved', releaseId: 'r2' }) + }) + + it('reads a release saved before the key was kept as the one filed lien’s own', () => { + const a = lien() + expect(affidavitVoidRefusal(a, [a, release('r1', { fields: {} })])).toMatchObject({ kind: 'saved', releaseId: 'r1' }) + }) + + it('refuses nothing for a record that is not a filed affidavit', () => { + const draft = lien('a1', { filed_at: null }) + expect(affidavitVoidRefusal(draft, [draft, release()])).toBeNull() + const notice = row({ id: 'n1', kind: 'notice_53_056' }) + expect(affidavitVoidRefusal(notice, [notice, release()])).toBeNull() + const r = release() + expect(affidavitVoidRefusal(r, [lien(), r])).toBeNull() + }) +}) + +describe('affidavitVoidRefusalWindow', () => { + it('sends the person to the release, and names the press for the act', () => { + const w = affidavitVoidRefusalWindow({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' }, fmt) + expect(w).toEqual({ + title: 'Void the release first', + message: 'This lien has a release of record, saved <2026-12-02>. A release needs its lien.\n\nVoid the release. Then void the affidavit.', + confirmLabel: 'Take me there ›', + cancelLabel: 'Cancel', + }) + }) + + it('says the county’s record stands, and offers the release of record beside Close', () => { + const w = affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' }, fmt) + expect(w).toEqual({ + title: 'The county recorded this lien’s release', + message: 'The release was recorded <2026-12-04> as 2026-0000099. The county’s record stands.\n\nAsk counsel before either paper is voided.', + confirmLabel: 'Go to the release of record ›', + cancelLabel: 'Close', + }) + expect(w.danger).toBeUndefined() + }) + + it('leaves the number out when none is kept', () => { + const w = affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '' }, fmt) + expect(w.message.startsWith('The release was recorded <2026-12-04>. The county’s record stands.')).toBe(true) + }) +}) + +describe('the void of a release the county recorded', () => { + it('takes words only once the county’s day is kept', () => { + expect(releaseVoidTakesWords(release())).toBe(false) + expect(releaseVoidTakesWords(release('r1', { filed_at: '2026-12-04' }))).toBe(true) + expect(releaseVoidTakesWords(lien())).toBe(false) + }) + + it('opens on the safe press, with the act red and named', () => { + const w = recordedReleaseVoidWindow(release('r1', { filed_at: '2026-12-04', fields: { releaseInstrument: '2026-0000099' } }), fmt) + expect(w).toEqual({ + title: 'The county recorded this release', + message: 'It was recorded <2026-12-04> as 2026-0000099. Voiding it here does not undo the county’s record.\n\nAsk counsel first.', + confirmLabel: 'Void the release anyway', + cancelLabel: 'Keep the release', + danger: true, + cancelIsSafe: true, + }) + }) +}) + +describe('the words on the way', () => { + it('are plain words', () => { + const windows = [ + affidavitVoidRefusalWindow({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' }, () => 'December 2, 2026'), + affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' }, () => 'December 4, 2026'), + recordedReleaseVoidWindow(release('r1', { filed_at: '2026-12-04' }), () => 'December 4, 2026'), + ] + for (const text of [...windows.flatMap((w) => w.message.split('\n\n')), ...Object.values(VOID_REFUSAL_WORDS)]) expect(plainWordsFailures(text), text).toEqual([]) + }) + + it('finds a line’s Void press', () => { + expect(filingVoidPressSelector('r1')).toBe('[data-lien-filing-row="r1"] [data-lien-filing-void]') + }) +}) diff --git a/src/lib/jobs/lienVoidRefusal.ts b/src/lib/jobs/lienVoidRefusal.ts new file mode 100644 index 0000000000..7385c72998 --- /dev/null +++ b/src/lib/jobs/lienVoidRefusal.ts @@ -0,0 +1,97 @@ +/** + * The void that is refused, and the void that takes words (finding 816, punch list #479, step 7). + * + * Voiding a filed affidavit that has a live release left the release with no lien. Payoffs, the Board and the tab + * then offered a second release. The owner's answer (2026-12-02): the void is refused by a window, and its one blue + * press takes the person to the release and shows where to press. The drawing is `mockup.html` on the card. + * + * - **A saved release.** *Void the release first*, with **Take me there ›**. The press lights **Void** on the + * release's own line, with a line that says what to press. Once the release is voided, the affidavit's line + * says it can be voided now. + * - **A release the county recorded.** *The county recorded this lien's release*, with **Go to the release of + * record ›** beside Close. The press opens that lien's release on its paper and voids nothing. + * + * A release the county recorded voided from its own line with the same two presses as any record, and no words. + * Its **Void** now opens a confirm window (the owner's pick of 2026-12-03): the county's record stands whatever the + * app holds, the safe press keeps the release, and the red press names the act. A county day typed on the wrong + * release still has a way out. + * + * Nothing here voids anything. The app counts the days and does not judge the law. + */ +import type { ConfirmDialogOptions } from '../confirmDialogPress' +import { calendarYmdInAppTzFromIso } from '../../utils/dateUtils' +import { releaseForAffidavit, releaseOwnInstrument, type LienPayoffAffidavit, type LienPayoffRelease } from './lienPayoff' + +type FilingLike = LienPayoffAffidavit & LienPayoffRelease & { kind: string } + +/** Why an affidavit's void is refused: its release is saved, or the county has recorded it. */ +export type AffidavitVoidRefusal = { kind: 'saved'; releaseId: string; savedYmd: string } | { kind: 'recorded'; releaseId: string; recordedYmd: string; instrument: string } + +/** + * Whether the void of this affidavit is refused. `live` is the job's filings with the voided ones left out. The + * release is the affidavit's own as every other surface reads it (`releaseForAffidavit`): the one that names it, or + * on a job with one filed lien the one saved before the key was kept. Null lets the void go on. + */ +export function affidavitVoidRefusal(affidavit: F, live: ReadonlyArray): AffidavitVoidRefusal | null { + if (affidavit.kind !== 'affidavit' || !affidavit.filed_at) return null + const filed = live.filter((f) => f.kind === 'affidavit' && f.filed_at) + const release = releaseForAffidavit( + affidavit, + live.filter((f) => f.kind === 'release_of_record'), + filed.length, + ) + if (!release) return null + const recordedYmd = (release.filed_at ?? '').slice(0, 10) + if (recordedYmd) return { kind: 'recorded', releaseId: release.id, recordedYmd, instrument: releaseOwnInstrument(release) } + return { kind: 'saved', releaseId: release.id, savedYmd: calendarYmdInAppTzFromIso(release.created_at) } +} + +/** The window that refuses the void. Its blue press is the way on, so it is the plain confirm: Cancel or Close is quiet. */ +export function affidavitVoidRefusalWindow(refusal: AffidavitVoidRefusal, fmt: (ymd: string) => string): ConfirmDialogOptions { + if (refusal.kind === 'saved') { + return { + title: 'Void the release first', + message: `This lien has a release of record, saved ${fmt(refusal.savedYmd)}. A release needs its lien.\n\nVoid the release. Then void the affidavit.`, + confirmLabel: 'Take me there ›', + cancelLabel: 'Cancel', + } + } + return { + title: 'The county recorded this lien’s release', + message: `${recordedSentence('The release', refusal.recordedYmd, refusal.instrument, fmt)} The county’s record stands.\n\nAsk counsel before either paper is voided.`, + confirmLabel: 'Go to the release of record ›', + cancelLabel: 'Close', + } +} + +/** True for a release whose void takes words: the county's day is kept on it. */ +export function releaseVoidTakesWords(f: { kind: string; filed_at: string | null }): boolean { + return f.kind === 'release_of_record' && Boolean((f.filed_at ?? '').slice(0, 10)) +} + +/** The confirm window on the void of a release the county recorded. Keeping it is the safe press, and the act is red. */ +export function recordedReleaseVoidWindow(release: Pick, fmt: (ymd: string) => string): ConfirmDialogOptions { + return { + title: 'The county recorded this release', + message: `${recordedSentence('It', (release.filed_at ?? '').slice(0, 10), releaseOwnInstrument(release), fmt)} Voiding it here does not undo the county’s record.\n\nAsk counsel first.`, + confirmLabel: 'Void the release anyway', + cancelLabel: 'Keep the release', + danger: true, + cancelIsSafe: true, + } +} + +function recordedSentence(subject: string, ymd: string, instrument: string, fmt: (ymd: string) => string): string { + return instrument ? `${subject} was recorded ${fmt(ymd)} as ${instrument}.` : `${subject} was recorded ${fmt(ymd)}.` +} + +/** The lines the tab draws on the way: under the release's lit **Void**, and on the affidavit's line once the release is voided. */ +export const VOID_REFUSAL_WORDS = { + pressVoidHere: 'Press Void here, then Confirm void. Then void the affidavit.', + wayBack: 'The release is voided. The affidavit can be voided now.', +} as const + +/** The **Void** press of a filing's line, for the light. */ +export function filingVoidPressSelector(filingId: string): string { + return `[data-lien-filing-row="${filingId}"] [data-lien-filing-void]` +} diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md index e7c9afe70a..ef2c7ee6d8 100644 --- a/to-dos/lien-release-road-faults/README.md +++ b/to-dos/lien-release-road-faults/README.md @@ -2,7 +2,7 @@ name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend" number: 479 group: ready -status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · step 14 is measured · steps 7 and 9 are left, and the word on step 14 +status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · step 7 is built (v2.9255, v2.9260) · step 14 is measured and closed with no build · step 9 is left summary: > The owner asked for help releasing a paid lien and printing its release, and for every bug on the way. One thread read the road in the code and found fourteen faults, findings 808 to 821. @@ -12,11 +12,11 @@ summary: > the most serious first. Two can mislead on a real lien today. On a job with two liens the county's stamp can land on the wrong release. And a release that is only saved already reads Released. -next: Step 7, finding 816. A release's line names its lien, its number and its day. The void of an affidavit with a live release is refused by the window as drawn. -ask: owner · look · A look at the refused void on a ZZ Test lien once step 7 is built: the window, its Take me there press, and the way back to the affidavit. -size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 7 and 9 -blocker: Step 7 has none: the owner said *Yes, build it* on its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477. Step 14 is measured, and the measure found nothing of this door's to mend. -opinion: build — step 7 next. A voided affidavit that leaves its release behind makes the desk offer a second release on the same lien. +next: Step 9, finding 818, after card #477 is built. The desk's path knows the wait on a check, and the Board keeps one chip a lien. +ask: owner · look · A look at the refused void on a ZZ Test lien: the window, its Take me there press, and the way back to the affidavit. +size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: step 9 +blocker: Step 9 is built after card #477. Step 8 owes one push after its merge. Nothing else is left. +opinion: build — card #477 next, then step 9, which closes this card. mockup: mockup.html — the window that refuses the void of an affidavit with a live release, and where Take me there lands (call 2, step 7). Every other step mends a press, a line or a guard on a screen that is already drawn. --- @@ -62,7 +62,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC. | 813 | A job has two liens. Keeping **Recorded on** throws the tab onto the other lien before **Instrument number** is typed. | read | Built in step 1, v2.9190. The tab holds the lien it stands on. | | 814 | A release is saved and the county has not recorded it. The job's bills owe again. The tab still says *Sign it before a notary. Then record it at the county.* Its print is live. Payoffs and the day's run hold the same release. | read | Mended by v2.9222, step 5: the tab reads the same hold, its two presses wait and the reason stands under them. | | 815 | **Download PDF** files no copy. Neither press marks the release as printed for the notary. When a check then comes back, the app says no release has left the office. The day's run prints it again. | read | Mended by v2.9224, step 6: a download files a copy, and the tab's print or download marks a saved release as printed for the notary. | -| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Not started. Step 7. | +| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Built in step 7, v2.9255 and v2.9260. A release's line names its lien, its day and where it stands. The void of an affidavit with a live release is refused by a window that leads to the release. The void of a recorded release asks first. | | 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Built, v2.9240, step 8. The save asks the database first, and a partial unique index holds the rule. It owes one push after its merge. | | 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. | | 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. | @@ -79,7 +79,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC. | 824 | The bin *Paid awaiting release* counts liens. Its press leaves no To do row for a paid lien that owes its release. | seen | Mended, v2.9163 (PR #10623), on `main`. It is step 6 of card #472. | | 825 | On a job with no property facts, the paper's owner and property description are blank lines. The tab says nothing before **Save release record** takes it. | seen | Built, v2.9234. A line above the presses names each blank and where it is fixed. Step 13. | | 826 | A lien was filed and then released. It never had a To do row, while the Board and Payoffs showed it. | seen | v2.9163 (PR #10623) added the rows, on `main`. This case is still to check on the live site. | -| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Measured on 2026-12-02. The door costs about a second on a warm load. Step 14. | +| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Measured on 2026-12-02: the door costs about a second on a warm load. Closed with no build on the owner's word of 2026-12-03. Step 14. | Findings 822 and 823 are faults of the desk's Board and To do, not of the road. They are in the Lien desk lane's note of run 17 and are not on this card. @@ -126,13 +126,15 @@ Lien desk lane's note of run 17 and are not on this card. the run, and says why. 6. **Built, v2.9224. A download is a copy, and a print is marked (S). 815.** **Download PDF** files a copy as the print does. Either press marks the release as out for the notary. -7. **Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release +7. **Built, v2.9255 and v2.9260. Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release is refused by a window with a **Take me there** press, which brings the person to the release and shows where to press (call 2). The window and its flow are drawn in [`mockup.html`](mockup.html), *Now* beside the suggestion. The owner said *Yes, build it* on - the drawing on 2026-12-02. Neither half is built yet. The other half: a release's line - under **Filings on this job** names its lien, its number and its day, and voiding a release - the county recorded takes words. + the drawing on 2026-12-02 and again on 2026-12-03 (*Every pick*). It is built as drawn, v2.9260. + Built, v2.9255: a release's line under **Filings on this job** names its lien, its number and + its day. Voiding a release the county recorded takes words: **Void** on its own line opens a + confirm window, *The county recorded this release*, with **Keep the release** and a red + **Void the release anyway** (the owner's pick of 2026-12-03, v2.9260). 8. **Built, v2.9240. One release a lien (M). 817.** The save is guarded in the client. A rule in the database ties one live release to one lien. This step is a migration and owes a push after its merge. 9. **The desk's path knows the wait, and one chip a lien (S). 818.** Built after card #477, since @@ -145,12 +147,12 @@ Lien desk lane's note of run 17 and are not on this card. **Upload the scanned PDF**. The scan is named as a release in the job's folder. 13. **Built, v2.9234. Missing property facts are named before the save (S). 825.** A line above the presses names each fact the paper would print blank. It names and does not hold. -14. **Measured, 2026-12-02. The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the +14. **Closed with no build, 2026-12-03. The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the measure shows. Two warm loads of the link on a ZZ Test job drew the window 2.5 and 1.5 seconds after the load began. The one job's read took between half a second and a second and a half. The window was up at once after it. So the door costs about a second. The nine seconds was a cold load of the Jobs page's scripts, which is the app's own start. The measure shows nothing - of this door's to mend. Whether the step closes with no build is asked of the owner. + of this door's to mend. The owner closed the step with no build on 2026-12-03 (*Every pick*). ## The calls, each answered @@ -170,6 +172,8 @@ The owner answered on 2026-12-02 (UTC), relayed by the managing session of run 1 **Answered on the drawing, 2026-12-02.** Asked *Card #479: is the release of record the right place for the press to lead?*, the owner pressed *Yes, build it*. So the window for a release the county has already recorded carries **Go to the release of record ›** beside Close, it leads where the drawing's step 4 shows, and it voids nothing. The whole drawing is the build: the refused void, **Take me there ›**, the lit **Void**, the way back, and this window. +**Three more calls, answered 2026-12-03 (UTC).** They were put with their picks, and the owner said: *Every pick, both*. The refused void is built as drawn. The void of a release the county has recorded opens a confirm window, with **Keep the release** as the safe press and a red **Void the release anyway**: a county day typed on the wrong release still has a way out. Step 14 closes with no build, on the measure written under it. + ## Where each lives Files and lines are `main`'s at `c7cdafa95c`. Read them again before a step: five PRs on these @@ -205,9 +209,7 @@ files have landed since, and the lines have moved. ## Where it stands -Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, eleven -are built: 1 to 6, 8, 10, 11, 12 and 13. Step 8 owes one push after its merge. Step 14 is -measured, and the measure found nothing of this door's to mend. Two steps are left. Step 7 is -next, both halves: the release's line that names its lien, and the refused void as drawn. Step 9 -is built after card #477. Finding 810 is decided on card #477 and is built with it. The looks on -the live site are owed for every step. +Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, twelve +are built: 1 to 8 and 10 to 13. Step 8 owes one push after its merge. Step 14 was measured and +the owner closed it with no build. One step is left. Step 9 is built after card #477, and +finding 810 is built with that card. The looks on the live site are owed for every step.