forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: commits: ensure overflow-x on filenames

anirudh.fi 2a1555ba e37f688d

verified
Changed files
+17 -13
appview
pages
templates
fragments
repo
+7 -5
appview/pages/templates/fragments/diff.html
···
<details open>
<summary class="list-none cursor-pointer sticky top-0">
<div id="diff-file-header" class="rounded cursor-pointer bg-white dark:bg-gray-800 flex justify-between">
-
<div id="left-side-items" class="p-2 flex gap-2 items-center">
+
<div id="left-side-items" class="p-2 flex gap-2 items-center overflow-x-auto" style="direction: rtl;">
{{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }}
+
<div class="flex gap-2 items-center" style="direction: ltr;">
{{ if .IsNew }}
<span class="bg-green-100 text-green-700 dark:bg-green-800/50 dark:text-green-400 {{ $markerstyle }}">ADDED</span>
{{ else if .IsDelete }}
···
{{ end }}
{{ if .IsDelete }}
-
<a class="dark:text-white" {{if $this }}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}"{{end}}>
+
<a class="dark:text-white whitespace-nowrap overflow-x-auto" {{if $this }}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}"{{end}}>
{{ .Name.Old }}
</a>
{{ else if (or .IsCopy .IsRename) }}
-
<a class="dark:text-white" {{if $parent}}href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}"{{end}}>
+
<a class="dark:text-white whitespace-nowrap overflow-x-auto" {{if $parent}}href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}"{{end}}>
{{ .Name.Old }}
</a>
{{ i "arrow-right" "w-4 h-4" }}
-
<a class="dark:text-white" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
+
<a class="dark:text-white whitespace-nowrap overflow-x-auto" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
{{ .Name.New }}
</a>
{{ else }}
-
<a class="dark:text-white" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
+
<a class="dark:text-white whitespace-nowrap overflow-x-auto" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
{{ .Name.New }}
</a>
{{ end }}
+
</div>
</div>
{{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" }}
+10 -8
appview/pages/templates/repo/commit.html
···
<div class="diff-stat">
<br>
<strong class="text-sm uppercase mb-4 dark:text-gray-200">Changed files</strong>
-
{{ range $diff }}
-
<ul class="dark:text-gray-200">
-
{{ if .IsDelete }}
-
<li><a href="#file-{{ .Name.Old }}" class="dark:hover:text-gray-300">{{ .Name.Old }}</a></li>
-
{{ else }}
-
<li><a href="#file-{{ .Name.New }}" class="dark:hover:text-gray-300">{{ .Name.New }}</a></li>
+
<div class="overflow-x-auto">
+
{{ range $diff }}
+
<ul class="dark:text-gray-200">
+
{{ if .IsDelete }}
+
<li><a href="#file-{{ .Name.Old }}" class="dark:hover:text-gray-300">{{ .Name.Old }}</a></li>
+
{{ else }}
+
<li><a href="#file-{{ .Name.New }}" class="dark:hover:text-gray-300">{{ .Name.New }}</a></li>
+
{{ end }}
+
</ul>
{{ end }}
-
</ul>
-
{{ end }}
+
</div>
</div>
</section>