1
0
This commit is contained in:
2025-05-23 20:52:25 +02:00
parent 134a3b7f27
commit 20e0c61589
4 changed files with 100 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ window.addEventListener('DOMContentLoaded', async () => {
const contentList = document.getElementById('contentList');
const panel = document.querySelector('.flex-1.p-4.overflow-y-auto');
const commitBtn = document.getElementById('commitBtn');
// 1) Baby-Blau und Nacht-Blau als RGB-Arrays
const DAY_COLOR = [173, 216, 230];
const NIGHT_COLOR = [0, 0, 50];
@@ -394,4 +399,33 @@ async function renderSidebar() {
window.electronAPI.showFolderContextMenu(titleEl.textContent);
}
});
commitBtn.addEventListener('click', async () => {
const folder = await window.electronAPI.getSelected();
console.log('[DEBUG] Selected folder for commit:', folder);
if (!folder || folder === 'No folder selected') {
alert('Kein Ordner ausgewählt!');
return;
}
const message = prompt('Commit-Nachricht:', 'test');
if (!message) return;
commitBtn.disabled = true;
commitBtn.textContent = 'Committing...';
const result = await window.electronAPI.commitCurrentFolder(folder, message);
console.log('[DEBUG] Commit result:', result);
if (result.success) {
alert('Commit erfolgreich!');
await renderContent(folder); // ← refresht Commit-Liste!
} else {
alert('Commit fehlgeschlagen:\n' + result.error);
}
commitBtn.disabled = false;
commitBtn.textContent = 'Commit';
});
});