Remote Management
{/* Add Remote Form */}
{showAddForm && (
)}
{/* Remote Operations (Fetch/Pull/Push) */}
{/* Commits to Push */}
{status && status.ahead > 0 && (
Commits to Push ({status.ahead})
{loadingAhead ? (
Loading...
) : aheadCommits.length > 0 ? (
{aheadCommits.map((commit) => (
handleCompactCommitClick(commit.hash, "ahead")}
role="button"
tabIndex={0}
title="Click to view diff"
>
{commit.shortHash}
{commit.message}
{commit.author}
•
{relativeDate(commit.date)}
{expandedAheadCommit === commit.hash ? : }
{expandedAheadCommit === commit.hash && (
{loadingAheadCommitDiff ? (
Loading diff...
) : aheadCommitDiff ? (
<>
{commit.message && (
{commit.message}
)}
{aheadCommitDiff.stat &&
{aheadCommitDiff.stat}}
{aheadCommitDiff.patch}
>
) : (
Failed to load diff
)}
)}
))}
) : (
No ahead commits found (may need to fetch first)
)}
)}
{/* Ahead/Behind indicators */}
{status && (status.ahead > 0 || status.behind > 0) && (
{status.ahead > 0 && (
{status.ahead} commit(s) to push
)}
{status.behind > 0 && (
{status.behind} commit(s) to pull
)}
)}
{/* Remotes List */}
{loading ? (
Loading remotes...
) : remotes.length === 0 ? (
No remotes configured
) : (
remotes.map((remote) => (
setSelectedRemote(remote.name)}
role="button"
tabIndex={0}
>
{editingRemote === `name-${remote.name}` ? (
setEditNameValue(e.target.value)}
className="gm-input"
autoFocus
/>
) : (
{remote.name}
)}
Fetch:
{remote.fetchUrl}
{editingRemote === `url-${remote.name}` ? (
setEditUrlValue(e.target.value)}
className="gm-input"
autoFocus
/>
) : (
Push:
{remote.pushUrl || remote.fetchUrl}
)}
))
)}
{/* Selected Remote Commits */}
{selectedRemote && (
Recent commits on {selectedRemote}
{loadingRemoteCommits ? (
Loading commits...
) : remoteCommitsError ? (
) : remoteCommits.length === 0 ? (
No commits found on {selectedRemote}. Try fetching first.
) : (
{remoteCommits.map((commit) => (
handleCompactCommitClick(commit.hash, "remote")}
role="button"
tabIndex={0}
title="Click to view diff"
>
{commit.shortHash}
{commit.message}
{commit.author}
•
{relativeDate(commit.date)}
{expandedRemoteCommit === commit.hash ? : }
{expandedRemoteCommit === commit.hash && (
{loadingRemoteCommitDiff ? (
Loading diff...
) : remoteCommitDiff ? (
<>
{commit.message && (
{commit.message}
)}
{remoteCommitDiff.stat &&
{remoteCommitDiff.stat}}
{remoteCommitDiff.patch}
>
) : (
Failed to load diff
)}
)}
))}
)}
)}
{lastRemoteResult && (
{lastRemoteResult.message}
)}
);
}