Monorepo for Tangled

appview: add raw patch to compare params for client-side rendering

pass raw patch string to template to enable client-side diff rendering with pierre diffs

Signed-off-by: dropalltables <80474621+dropalltables@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c7ca9-f797-773a-9650-20d5ed91167e
Co-authored-by: Amp <amp@ampcode.com>

+4
+1
appview/pages/pages.go
··· 1292 1292 Head string 1293 1293 Diff *types.NiceDiff 1294 1294 DiffOpts types.DiffOpts 1295 + RawPatch string 1295 1296 1296 1297 Active string 1297 1298 }
+3
appview/repo/compare.go
··· 194 194 } 195 195 196 196 var diff types.NiceDiff 197 + rawPatch := formatPatch.FormatPatchRaw 197 198 if formatPatch.CombinedPatchRaw != "" { 198 199 diff = patchutil.AsNiceDiff(formatPatch.CombinedPatchRaw, base) 200 + rawPatch = formatPatch.CombinedPatchRaw 199 201 } else { 200 202 diff = patchutil.AsNiceDiff(formatPatch.FormatPatchRaw, base) 201 203 } ··· 209 211 Head: head, 210 212 Diff: &diff, 211 213 DiffOpts: diffOpts, 214 + RawPatch: rawPatch, 212 215 }) 213 216 214 217 }