feat(ui): refine history graph visuals and layout

Refines history panel visuals and layout, including min width handling.
Removes the old branch visibility select in favor of a dialog button.
It also adds a graph connector to show primary branches.
Adds branch chips, icons, and hover effects to commits for clarity.

- History panel visuals and min width updated to improve layout.
- Removed branch visibility select; added dialog to customize branches.
- Branch chips and graph connectors enhanced with icons and hover effects.
This commit is contained in:
Christoph Brandau
2026-08-13 18:01:10 +02:00
parent 608b3131d2
commit ca14fac90c
3 changed files with 226 additions and 104 deletions
+19 -24
View File
@@ -47,6 +47,7 @@
"#ff7c9f", "#48c7d8", "#c5cf54", "#e18c55",
];
const GRAPH_LANE = 18;
const GRAPH_REF_ARM = 16;
const GRAPH_VISIBILITY_STORAGE_PREFIX = "gitlite.graphVisibility.v1:";
const commitDateFormatter = new Intl.DateTimeFormat(undefined, {
dateStyle: "medium",
@@ -411,12 +412,6 @@
branchVisibilityMode = "focus";
}
function changeBranchVisibilityMode(event: Event) {
const value = (event.currentTarget as HTMLSelectElement).value as BranchVisibilityMode;
branchVisibilityMode = value;
if (value === "custom") openBranchDialog();
}
function openBranchDialog() {
branchDialogOpen = true;
}
@@ -760,21 +755,6 @@
</div>
{#if graphBranchNames.length > 0}
<div class="section-head-actions">
<label class="graph-visibility-select" title="Choose which branches are shown in the graph">
<GitBranch size={13} aria-hidden="true" />
<span class="graph-visibility-label">Branches</span>
<select
aria-label="Branch visibility mode"
value={branchVisibilityMode}
onchange={changeBranchVisibilityMode}
>
<option value="focus">Focus</option>
<option value="local">Local</option>
<option value="all">All</option>
<option value="custom">Custom…</option>
</select>
<ChevronDown size={12} aria-hidden="true" />
</label>
<button
class="graph-branch-dialog-button"
type="button"
@@ -782,6 +762,8 @@
title="Customize visible branches"
aria-label={`${visibleBranchCount} of ${graphBranchNames.length} branches visible. Customize branches.`}
>
<GitBranch size={13} aria-hidden="true" />
Branches
<span>{visibleBranchCount}/{graphBranchNames.length}</span>
</button>
</div>
@@ -837,6 +819,15 @@
vector-effect="non-scaling-stroke"
/>
{/each}
{#if refSummary.primaryBranch}
<path
class="graph-ref-connector"
d={`M ${graphColX(row.dotCol)} 50 L ${graphWidth - GRAPH_REF_ARM * 2} 50`}
stroke={row.dotColor}
stroke-width="1.5"
vector-effect="non-scaling-stroke"
/>
{/if}
</svg>
<span
class="graph-dot"
@@ -851,9 +842,13 @@
{/if}
</div>
<div class="commit-body">
<div
class="commit-body"
class:has-branch-ref={Boolean(refSummary.primaryBranch)}
style={`--ref-lane-color:${row?.dotColor ?? GRAPH_COLORS[0]}`}
>
{#if refSummary.primaryBranch || refSummary.primaryTag || refSummary.overflowCount > 0}
<div class="commit-ref-area" style={`--ref-lane-color:${row?.dotColor ?? GRAPH_COLORS[0]}`}>
<div class="commit-ref-area">
<div class="commit-ref-strip" aria-label="Commit references">
{#if refSummary.primaryBranch}
<span
@@ -862,7 +857,7 @@
class:remote={refSummary.primaryBranch.kind === "remote"}
title={branchDecorationTitle(refSummary.primaryBranch)}
>
<i aria-hidden="true"></i>
<GitBranch class="compact-ref-branch-icon" size={10} aria-hidden="true" />
<span>{refSummary.primaryBranch.label}</span>
{#if branchStatusLabel(refSummary.primaryBranch)}
<small class:up-to-date={Boolean(refSummary.primaryBranch.trackedRemote)}>