Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview/{pages,pulls}: redirect on pull create, dirty title+desc tracking

Lewis: May this revision serve well! <lewis@tangled.org>

author
Lewis
committer
Tangled
date (Jun 22, 2026, 12:58 PM +0300) commit af4d6fdf parent a63d05e2 change-id vwpyylrw
+21 -4
+2
appview/pages/pages.go
··· 1312 1312 Patch string 1313 1313 Title string 1314 1314 Body string 1315 + TitleDirty bool 1316 + BodyDirty bool 1315 1317 IsStacked bool 1316 1318 Comparison *types.RepoFormatPatchResponse 1317 1319 Diff *types.NiceDiff
+5
appview/pages/templates/repo/pulls/fragments/pullComposeHost.html
··· 63 63 {{ template "repo/pulls/fragments/pullStepDetails" . }} 64 64 </div> 65 65 </section> 66 + {{ else }} 67 + <input type="hidden" name="title" value="{{ .Title }}" /> 68 + <input type="hidden" name="body" value="{{ .Body }}" /> 69 + <input type="hidden" name="titleDirty" value="{{ if .TitleDirty }}1{{ end }}" /> 70 + <input type="hidden" name="bodyDirty" value="{{ if .BodyDirty }}1{{ end }}" /> 66 71 {{ end }} 67 72 </form> 68 73
+6
appview/pages/templates/repo/pulls/fragments/pullStepDetails.html
··· 23 23 {{ define "pullStepDetailsSingle" }} 24 24 {{ $root := .Root }} 25 25 {{ $previewUrl := .PreviewUrl }} 26 + <input type="hidden" name="titleDirty" id="titleDirty" value="{{ if $root.TitleDirty }}1{{ end }}" /> 27 + <input type="hidden" name="bodyDirty" id="bodyDirty" value="{{ if $root.BodyDirty }}1{{ end }}" /> 26 28 <div class="flex flex-col gap-1"> 27 29 <label for="title" class="text-xs tracking-wide text-gray-800 dark:text-gray-200">Title</label> 28 30 <input ··· 30 32 name="title" 31 33 id="title" 32 34 value="{{ $root.Title }}" 35 + oninput="document.getElementById('titleDirty').value='1'" 33 36 class="w-full dark:bg-gray-800 dark:text-white dark:border-gray-700" 34 37 placeholder="One-line summary of your change." 35 38 /> ··· 42 45 "Rows" 6 43 46 "Placeholder" "Describe your change. Markdown is supported." 44 47 "PreviewUrl" $previewUrl 48 + "DirtyFlag" "bodyDirty" 45 49 ) }} 46 50 {{ end }} 47 51 ··· 52 56 {{ $rows := .Rows }} 53 57 {{ $placeholder := .Placeholder }} 54 58 {{ $previewUrl := .PreviewUrl }} 59 + {{ $dirtyFlag := .DirtyFlag }} 55 60 <div class="flex flex-col gap-2" data-md-editor="{{ $id }}"> 56 61 <div class="btn-group self-start text-gray-600 dark:text-gray-300"> 57 62 <button type="button" data-md-mode="write" ··· 79 84 rows="{{ $rows }}" 80 85 class="w-full resize-y dark:bg-gray-800 dark:text-white dark:border-gray-700" 81 86 placeholder="{{ $placeholder }}" 87 + {{ if $dirtyFlag }}oninput="document.getElementById('{{ $dirtyFlag }}').value='1'"{{ end }} 82 88 >{{ $value }}</textarea> 83 89 </div> 84 90 <div data-md-panel="preview" class="hidden">
+6 -2
appview/pulls/compose.go
··· 289 289 290 290 title := r.FormValue("title") 291 291 body := r.FormValue("body") 292 + titleDirty := r.FormValue("titleDirty") == "1" 293 + bodyDirty := r.FormValue("bodyDirty") == "1" 292 294 if comparison != nil && len(comparison.FormatPatch) > 0 { 293 295 first := comparison.FormatPatch[0] 294 - if title == "" && first.PatchHeader != nil { 296 + if !titleDirty && first.PatchHeader != nil { 295 297 title = first.Title 296 298 } 297 - if body == "" && first.PatchHeader != nil { 299 + if !bodyDirty && first.PatchHeader != nil { 298 300 body = first.Body 299 301 } 300 302 } ··· 319 321 Patch: patch, 320 322 Title: title, 321 323 Body: body, 324 + TitleDirty: titleDirty, 325 + BodyDirty: bodyDirty, 322 326 IsStacked: isStacked, 323 327 Comparison: comparison, 324 328 Diff: diff,
+2 -2
appview/pulls/create.go
··· 335 335 s.applyCreationLabels(r.Context(), client, userDid, []*models.Pull{pull}, r.Form, repo) 336 336 337 337 ownerSlashRepo := reporesolver.GetBaseRepoPath(r, repo) 338 - http.Redirect(w, r, fmt.Sprintf("/%s/pulls/%d", ownerSlashRepo, pullId), http.StatusFound) 338 + s.pages.HxRedirect(w, fmt.Sprintf("/%s/pulls/%d", ownerSlashRepo, pullId)) 339 339 } 340 340 341 341 func (s *Pulls) createStackedPullRequest( ··· 452 452 s.applyCreationLabels(r.Context(), client, userDid, stack, r.Form, repo) 453 453 454 454 ownerSlashRepo := reporesolver.GetBaseRepoPath(r, repo) 455 - http.Redirect(w, r, fmt.Sprintf("/%s/pulls", ownerSlashRepo), http.StatusFound) 455 + s.pages.HxRedirect(w, fmt.Sprintf("/%s/pulls", ownerSlashRepo)) 456 456 } 457 457 458 458 func (s *Pulls) newStack(