Commit-Ausblendung (für UI) implementiert
Dieser Commit ist enthalten in:
committet von
Claude Project Manager
Ursprung
dad07c7879
Commit
50da44aabc
@ -391,6 +391,19 @@
|
||||
COMMITS PANEL
|
||||
============================================================================= */
|
||||
|
||||
.commits-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-3);
|
||||
}
|
||||
|
||||
.commits-header h3 {
|
||||
margin: 0;
|
||||
font-size: var(--text-base);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.gitea-commits-panel h3 {
|
||||
margin: 0 0 var(--spacing-3) 0;
|
||||
font-size: var(--text-base);
|
||||
@ -452,6 +465,32 @@
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.commit-delete {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--text-tertiary);
|
||||
cursor: pointer;
|
||||
border-radius: var(--radius-sm);
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s, color 0.15s, background 0.15s;
|
||||
flex-shrink: 0;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.commit-item:hover .commit-delete {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.commit-delete:hover {
|
||||
color: var(--error);
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
/* =============================================================================
|
||||
EMPTY STATE
|
||||
============================================================================= */
|
||||
|
||||
@ -659,7 +659,12 @@
|
||||
|
||||
<!-- Commit-Historie -->
|
||||
<div id="gitea-commits-section" class="gitea-commits-panel">
|
||||
<h3>Letzte Commits</h3>
|
||||
<div class="commits-header">
|
||||
<h3>Letzte Commits</h3>
|
||||
<button id="btn-clear-commits" class="btn btn-small btn-secondary" title="Alle aus Anzeige entfernen">
|
||||
Alle ausblenden
|
||||
</button>
|
||||
</div>
|
||||
<div id="git-commits-list" class="commits-list">
|
||||
<!-- Dynamisch gefüllt -->
|
||||
</div>
|
||||
|
||||
@ -19,6 +19,7 @@ class GiteaManager {
|
||||
this.initialized = false;
|
||||
this.refreshInterval = null;
|
||||
this.isLoading = false;
|
||||
this.hiddenCommits = new Set(); // Ausgeblendete Commits
|
||||
}
|
||||
|
||||
async init() {
|
||||
@ -79,6 +80,10 @@ class GiteaManager {
|
||||
// Branch umbenennen
|
||||
$('#btn-rename-branch')?.addEventListener('click', () => this.openRenameBranchModal());
|
||||
$('#git-rename-branch-form')?.addEventListener('submit', (e) => this.executeRenameBranch(e));
|
||||
|
||||
// Commits ausblenden
|
||||
$('#btn-clear-commits')?.addEventListener('click', () => this.clearAllCommits());
|
||||
$('#git-commits-list')?.addEventListener('click', (e) => this.handleCommitListClick(e));
|
||||
}
|
||||
|
||||
subscribeToStore() {
|
||||
@ -775,24 +780,73 @@ class GiteaManager {
|
||||
|
||||
renderCommits() {
|
||||
const listEl = $('#git-commits-list');
|
||||
const clearBtn = $('#btn-clear-commits');
|
||||
if (!listEl) return;
|
||||
|
||||
if (this.commits.length === 0) {
|
||||
listEl.innerHTML = '<div class="gitea-empty-state" style="padding: var(--spacing-4);"><p>Keine Commits gefunden</p></div>';
|
||||
// Filtern: Ausgeblendete Commits nicht anzeigen
|
||||
const visibleCommits = this.commits.filter(commit => {
|
||||
const hash = commit.hash || commit.sha || commit.shortHash;
|
||||
return !this.hiddenCommits.has(hash);
|
||||
});
|
||||
|
||||
// Button-Text anpassen
|
||||
if (clearBtn) {
|
||||
clearBtn.style.display = visibleCommits.length > 0 ? '' : 'none';
|
||||
}
|
||||
|
||||
if (visibleCommits.length === 0) {
|
||||
const message = this.commits.length > 0
|
||||
? 'Alle Commits ausgeblendet'
|
||||
: 'Keine Commits gefunden';
|
||||
listEl.innerHTML = `<div class="gitea-empty-state" style="padding: var(--spacing-4);"><p>${message}</p></div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
listEl.innerHTML = this.commits.map(commit => `
|
||||
<div class="commit-item">
|
||||
<span class="commit-hash">${escapeHtml(commit.shortHash || commit.sha?.substring(0, 7))}</span>
|
||||
listEl.innerHTML = visibleCommits.map(commit => {
|
||||
const hash = commit.hash || commit.sha || '';
|
||||
const shortHash = commit.shortHash || hash.substring(0, 7);
|
||||
return `
|
||||
<div class="commit-item" data-hash="${escapeHtml(hash)}">
|
||||
<span class="commit-hash">${escapeHtml(shortHash)}</span>
|
||||
<div class="commit-info">
|
||||
<div class="commit-message">${escapeHtml(commit.message?.split('\n')[0] || '')}</div>
|
||||
<div class="commit-meta">
|
||||
<span class="author">${escapeHtml(commit.author)}</span> · ${this.formatDate(commit.date)}
|
||||
</div>
|
||||
</div>
|
||||
<button class="commit-delete" title="Ausblenden" data-hash="${escapeHtml(hash)}">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16"><path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
`).join('');
|
||||
`}).join('');
|
||||
}
|
||||
|
||||
handleCommitListClick(e) {
|
||||
const deleteBtn = e.target.closest('.commit-delete');
|
||||
if (deleteBtn) {
|
||||
const hash = deleteBtn.dataset.hash;
|
||||
if (hash) {
|
||||
this.hideCommit(hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hideCommit(hash) {
|
||||
this.hiddenCommits.add(hash);
|
||||
this.renderCommits();
|
||||
this.showToast('Commit ausgeblendet', 'info');
|
||||
}
|
||||
|
||||
clearAllCommits() {
|
||||
// Alle sichtbaren Commits ausblenden
|
||||
this.commits.forEach(commit => {
|
||||
const hash = commit.hash || commit.sha || commit.shortHash;
|
||||
if (hash) {
|
||||
this.hiddenCommits.add(hash);
|
||||
}
|
||||
});
|
||||
this.renderCommits();
|
||||
this.showToast('Alle Commits ausgeblendet', 'info');
|
||||
}
|
||||
|
||||
renderChanges() {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Offline support and caching
|
||||
*/
|
||||
|
||||
const CACHE_VERSION = '124';
|
||||
const CACHE_VERSION = '125';
|
||||
const CACHE_NAME = 'taskmate-v' + CACHE_VERSION;
|
||||
const STATIC_CACHE_NAME = 'taskmate-static-v' + CACHE_VERSION;
|
||||
const DYNAMIC_CACHE_NAME = 'taskmate-dynamic-v' + CACHE_VERSION;
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren