feat: Refonte moderne du panneau de notes avec design latéral

- Transformation en panneau latéral droit au lieu du bas
- Header avec gradient violet et design moderne
- Ajout bouton Effacer et amélioration du placeholder
- Suppression du badge rouge de notification
- Animations fluides et redimensionnement automatique de la webview
- Interface plus cohérente et intuitive
This commit is contained in:
Pierre Marx
2025-09-04 16:14:42 -04:00
parent d6e3942e97
commit 29a4cfb410
4 changed files with 197 additions and 42 deletions

View File

@@ -63,6 +63,12 @@ document.addEventListener('DOMContentLoaded', async () => {
saveNotesBtn.addEventListener('click', saveNotes);
}
// Bouton effacer notes
const clearNotesBtn = document.getElementById('clearNotesBtn');
if (clearNotesBtn) {
clearNotesBtn.addEventListener('click', clearNotes);
}
// Bouton toggle notes
const toggleNotesBtn = document.getElementById('toggleNotesBtn');
if (toggleNotesBtn) {
@@ -84,6 +90,7 @@ document.addEventListener('DOMContentLoaded', async () => {
// Charger les préférences utilisateur
loadUserPreferences();
// Gérer les boutons de la modal de déconnexion (si on est sur la page principale)
const cancelLogoutBtn = document.getElementById('cancelLogoutBtn');
const confirmLogoutBtn = document.getElementById('confirmLogoutBtn');
@@ -672,7 +679,10 @@ function updateCallStats() {
async function saveNotes() {
const notes = document.getElementById('quickNotes').value;
if (!notes.trim()) return;
if (!notes.trim()) {
showNotification('Aucune note à sauvegarder', 'error');
return;
}
const result = await ipcRenderer.invoke('save-notes', {
content: notes,
@@ -680,8 +690,9 @@ async function saveNotes() {
});
if (result.success) {
alert('Notes sauvegardées !');
document.getElementById('quickNotes').value = '';
showNotification('Notes sauvegardées avec succès !', 'success');
// Optionnel : garder les notes ou les effacer
// document.getElementById('quickNotes').value = '';
}
}
@@ -835,6 +846,7 @@ function validateTerminal(terminal) {
function toggleNotes() {
const notesSection = document.getElementById('notesSection');
const toggleBtn = document.getElementById('toggleNotesBtn');
const webviewContainer = document.getElementById('webviewContainer');
if (notesSection.classList.contains('visible')) {
hideNotes();
@@ -846,28 +858,54 @@ function toggleNotes() {
function showNotes() {
const notesSection = document.getElementById('notesSection');
const toggleBtn = document.getElementById('toggleNotesBtn');
const webviewContainer = document.getElementById('webviewContainer');
notesSection.classList.add('visible');
toggleBtn.classList.add('active');
// Ajuster la largeur de la webview pour faire de la place aux notes
if (webviewContainer) {
webviewContainer.classList.add('notes-open');
}
// Sauvegarder la préférence
localStorage.setItem('notesVisible', 'true');
// Focus sur le textarea
document.getElementById('quickNotes').focus();
// Focus sur le textarea avec un délai pour l'animation
setTimeout(() => {
const textarea = document.getElementById('quickNotes');
if (textarea) {
textarea.focus();
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
}
}, 300);
}
function hideNotes() {
const notesSection = document.getElementById('notesSection');
const toggleBtn = document.getElementById('toggleNotesBtn');
const webviewContainer = document.getElementById('webviewContainer');
notesSection.classList.remove('visible');
toggleBtn.classList.remove('active');
// Restaurer la largeur normale de la webview
if (webviewContainer) {
webviewContainer.classList.remove('notes-open');
}
// Sauvegarder la préférence
localStorage.setItem('notesVisible', 'false');
}
function clearNotes() {
const textarea = document.getElementById('quickNotes');
if (textarea && confirm('Êtes-vous sûr de vouloir effacer toutes les notes ?')) {
textarea.value = '';
textarea.focus();
}
}
// === GESTION DES PRÉFÉRENCES UTILISATEUR ===
function loadUserPreferences() {
// Charger l'état des notes