Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8214b2e9ac | ||
|
|
63d8a1c4e1 | ||
|
|
87eeba192f | ||
|
|
753dec84c5 | ||
|
|
06736a32be | ||
|
|
f400b2413d | ||
|
|
df5e562ea6 | ||
|
|
c8fd2346b4 | ||
|
|
cdc308c16b | ||
|
|
67301593c6 |
No files matched your search
@@ -39,12 +39,12 @@ jobs:
|
||||
npm install
|
||||
|
||||
- name: Build the Tauri app
|
||||
uses: tauri-apps/tauri-action@v1
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tagName: v__VERSION__
|
||||
releaseName: 'TodoFlow v__VERSION__'
|
||||
tagName: ${{ github.ref_name }}
|
||||
releaseName: 'TodoFlow ${{ github.ref_name }}'
|
||||
releaseBody: 'Release generated automatically by GitHub Actions.'
|
||||
releaseDraft: true
|
||||
prerelease: false
|
||||
|
||||
@@ -21,3 +21,7 @@ codegen-units = 1
|
||||
lto = true
|
||||
opt-level = "z"
|
||||
strip = true
|
||||
|
||||
[features]
|
||||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 332 KiB |
@@ -28,7 +28,7 @@ fn set_autostart(enabled: bool) -> Result<(), String> {
|
||||
// Permet d'activer ou de désactiver le lancement automatique au démarrage de Windows.
|
||||
// On écrit directement dans le registre Windows (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run)
|
||||
// ce qui évite d'avoir à gérer un installateur complexe ou des plugins externes lourds.
|
||||
let hkcu = RegKey::predefined(HKEY_CURRENT_USER);
|
||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||
let run_key = hkcu
|
||||
.open_subkey_with_flags(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Run",
|
||||
@@ -55,7 +55,7 @@ fn set_autostart(enabled: bool) -> Result<(), String> {
|
||||
#[tauri::command]
|
||||
fn get_autostart() -> Result<bool, String> {
|
||||
// Lit le registre Windows pour vérifier si l'application est configurée pour démarrer automatiquement.
|
||||
let hkcu = RegKey::predefined(HKEY_CURRENT_USER);
|
||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||
let run_key = hkcu
|
||||
.open_subkey_with_flags(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Run",
|
||||
@@ -89,7 +89,7 @@ fn main() {
|
||||
window.hide().unwrap();
|
||||
} else {
|
||||
window.show().unwrap();
|
||||
window.focus().unwrap();
|
||||
window.set_focus().unwrap();
|
||||
}
|
||||
}
|
||||
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
|
||||
@@ -102,7 +102,7 @@ fn main() {
|
||||
window.hide().unwrap();
|
||||
} else {
|
||||
window.show().unwrap();
|
||||
window.focus().unwrap();
|
||||
window.set_focus().unwrap();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"distDir": "../src",
|
||||
"devPath": "../src",
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "TodoFlow",
|
||||
@@ -48,6 +49,11 @@
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"systemTray": {
|
||||
"iconPath": "icons/icon.ico",
|
||||
"iconAsTemplate": false,
|
||||
"menuOnLeftClick": false
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
|
||||
@@ -70,7 +70,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
// Si exécuté hors de Tauri (ex: navigateur classique), masquer les boutons de fenêtre
|
||||
btnMinimize.style.display = "none";
|
||||
btnClose.style.display = "none";
|
||||
document.querySelector(".setting-toggle").style.display = "none"; // Cacher l'autostart
|
||||
inputAutostart.closest(".setting-toggle").style.display = "none"; // Cacher l'autostart
|
||||
}
|
||||
|
||||
// Événement d'ajout de tâche
|
||||
@@ -294,6 +294,39 @@ function renderTasksList() {
|
||||
content.appendChild(title);
|
||||
content.appendChild(date);
|
||||
|
||||
// Container d'actions (Edit / Delete)
|
||||
const actions = document.createElement("div");
|
||||
actions.className = "task-actions";
|
||||
|
||||
// Bouton Modifier
|
||||
const btnEdit = document.createElement("button");
|
||||
btnEdit.className = "btn-task-action btn-edit";
|
||||
btnEdit.title = "Modifier la tâche";
|
||||
btnEdit.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4z"/></svg>`;
|
||||
btnEdit.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
startEditingTask(task.id, card, title, task.title);
|
||||
});
|
||||
|
||||
// Double-clic sur le titre pour éditer également
|
||||
title.addEventListener("dblclick", (e) => {
|
||||
e.stopPropagation();
|
||||
startEditingTask(task.id, card, title, task.title);
|
||||
});
|
||||
|
||||
// Bouton Supprimer
|
||||
const btnDelete = document.createElement("button");
|
||||
btnDelete.className = "btn-task-action btn-delete";
|
||||
btnDelete.title = "Supprimer la tâche";
|
||||
btnDelete.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>`;
|
||||
btnDelete.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
deleteTask(task.id);
|
||||
});
|
||||
|
||||
actions.appendChild(btnEdit);
|
||||
actions.appendChild(btnDelete);
|
||||
|
||||
// Badge de statut (En cours / À faire)
|
||||
const badge = document.createElement("span");
|
||||
|
||||
@@ -314,6 +347,7 @@ function renderTasksList() {
|
||||
|
||||
card.appendChild(checkbox);
|
||||
card.appendChild(content);
|
||||
card.appendChild(actions);
|
||||
card.appendChild(badge);
|
||||
|
||||
tasksList.appendChild(card);
|
||||
@@ -337,3 +371,87 @@ function formatDate(dateString) {
|
||||
return dateString;
|
||||
}
|
||||
}
|
||||
|
||||
// --- NOUVELLES FONCTIONS DE SUPPRESSION ET MODIFICATION ---
|
||||
|
||||
function startEditingTask(taskId, card, titleElement, currentTitle) {
|
||||
if (card.classList.contains("editing")) return;
|
||||
card.classList.add("editing");
|
||||
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "task-edit-input";
|
||||
input.value = currentTitle;
|
||||
input.maxLength = 100;
|
||||
|
||||
titleElement.innerHTML = "";
|
||||
titleElement.appendChild(input);
|
||||
input.focus();
|
||||
input.select();
|
||||
|
||||
const finishEditing = async (save) => {
|
||||
const newTitle = input.value.trim();
|
||||
card.classList.remove("editing");
|
||||
|
||||
if (save && newTitle && newTitle !== currentTitle) {
|
||||
titleElement.textContent = newTitle;
|
||||
await updateTaskTitle(taskId, newTitle);
|
||||
} else {
|
||||
titleElement.textContent = currentTitle;
|
||||
}
|
||||
};
|
||||
|
||||
input.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
finishEditing(true);
|
||||
} else if (e.key === "Escape") {
|
||||
finishEditing(false);
|
||||
}
|
||||
});
|
||||
|
||||
input.addEventListener("blur", () => {
|
||||
finishEditing(true);
|
||||
});
|
||||
|
||||
input.addEventListener("click", (e) => e.stopPropagation());
|
||||
}
|
||||
|
||||
async function updateTaskTitle(taskId, newTitle) {
|
||||
try {
|
||||
const response = await fetch(`${state.apiUrl}/api/v1/tasks/${taskId}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-API-Key": state.apiKey
|
||||
},
|
||||
body: JSON.stringify({
|
||||
title: newTitle
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) throw new Error("Échec de la mise à jour");
|
||||
fetchTasks();
|
||||
} catch (error) {
|
||||
console.error("Erreur de mise à jour du titre :", error);
|
||||
alert("Impossible de modifier la tâche.");
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteTask(taskId) {
|
||||
if (!confirm("Voulez-vous vraiment supprimer cette tâche ?")) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(`${state.apiUrl}/api/v1/tasks/${taskId}`, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"X-API-Key": state.apiKey
|
||||
}
|
||||
});
|
||||
|
||||
if (!response.ok) throw new Error("Échec de la suppression");
|
||||
fetchTasks();
|
||||
} catch (error) {
|
||||
console.error("Erreur de suppression de la tâche :", error);
|
||||
alert("Impossible de supprimer la tâche.");
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@
|
||||
<body>
|
||||
<div class="todo-widget">
|
||||
<!-- Barre supérieure personnalisée avec zone de déplacement pour Tauri -->
|
||||
<header class="widget-header" data-tauri-drag-region>
|
||||
<div class="header-left" data-tauri-drag-region>
|
||||
<header class="widget-header">
|
||||
<div class="header-drag-zone" data-tauri-drag-region>
|
||||
<span class="status-indicator disconnected" id="connection-status" title="Déconnecté"></span>
|
||||
<h1 class="widget-title" data-tauri-drag-region>TodoFlow</h1>
|
||||
</div>
|
||||
|
||||
@@ -63,17 +63,19 @@ body {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: grab; /* Indique qu'on peut faire glisser le widget */
|
||||
}
|
||||
|
||||
.widget-header:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
.header-drag-zone {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.header-drag-zone:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* Indicateur d'état connecté à l'API */
|
||||
@@ -571,3 +573,58 @@ body {
|
||||
background: hsl(250, 85%, 58%);
|
||||
box-shadow: 0 0 10px var(--accent-indigo-glow);
|
||||
}
|
||||
|
||||
/* --- BOUTONS ACTIONS DES TÂCHES (MODIFIER / SUPPRIMER) --- */
|
||||
.task-actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-right: 8px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.task-card:hover .task-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.btn-task-action {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-task-action:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.btn-task-action.btn-delete:hover {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
color: hsl(0, 80%, 65%);
|
||||
}
|
||||
|
||||
.btn-task-action svg {
|
||||
pointer-events: none; /* Évite d'interférer avec le clic */
|
||||
}
|
||||
|
||||
/* Style de l'input d'édition en ligne */
|
||||
.task-edit-input {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid var(--accent-indigo);
|
||||
border-radius: 6px;
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
font-family: inherit;
|
||||
padding: 2px 6px;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
box-shadow: 0 0 8px var(--accent-indigo-glow);
|
||||
}
|
||||