Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1c92435560c948d47e2ed6d78d9eb84e62aa199a5d6a738bc61ebd71d4476a44
Ticket: e16ad1d395752c1eb2ced0b324e096ffee618218
Rebuild diff rendering: structured model, syntax highlighting, word-level marking
User & Date: dmestas on 2026-08-19 21:57:37
Changes

  1. icomment:
    Built (cc6091b1), on the model this ticket specified.
    
    **internal/diff** — the Pierre-factored model in Go: FileDiff (change
    kind: change/new/deleted, /dev/null recognised), Hunk (starts +
    header), Line (kind + old/new numbers), and POSITIONAL tokens — one
    syntax class and one change state per span, the one idea worth taking
    above all others. Intra-line marking is an LCS over word tokens
    (letters/digits vs punctuation split separately, so a paren edit marks
    the paren, not the word beside it), with the rewrite guard: lines
    sharing under a third of their words mark NOTHING — a fully-marked
    pair says less than plain colour. The chroma splice tracks byte
    offsets and splits tokens at mark boundaries; a reassembly test pins
    that the splice never loses or duplicates a byte.
    
    **The op** — checkin.diff gains `structured` (files/hunks/lines/
    tokens); `unified` remains for scripts. Principle 5 held: the page
    renders the same shape the API serves.
    
    **The page** — per-file sections with change-kind headers and the file
    list doubling as anchor navigation; hunk headers with the @@ context;
    line numbers and the +/- marker in user-select:none gutters so copying
    a hunk copies clean code; syntax classes riding the chroma stylesheet
    already on every page; marks as tinted ranges inside add/del rows.
    
    **Verified on the ticket's own case** — pikchr a7f1c35b: `(including`
    is a marked span, everything else on that line is not; 13 marked
    ranges across the changeset; gutters number from 5220. A Go diff
    carries full syntax (1.4k identifier spans, keywords, strings).
    pikchr.y itself gets structure and marks but plain tokens — chroma has
    no yacc lexer; degrade-to-plain is the designed behavior.
    
    **Remainders, honestly:** context expansion (needs a new op serving
    file lines at a revision plus an expand affordance) and a unified/
    split toggle — both listed in the original gaps, neither in this
    pass. Line-level chroma also cannot see multi-line constructs (a
    string spanning lines tokenises per-line); the price of not fetching
    whole files, degrades to plain.
    
  2. mimetype: "text/x-markdown"
  3. status changed to: "Review"