mirror of
https://github.com/R0m1k3/TodoFlow.git
synced 2026-10-12 01:38:28 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e759a1a7d5 | ||
|
|
3b5ede5872 | ||
|
|
a635aa29a4 | ||
|
|
fcac504693 | ||
|
|
27d3fb7d50 |
No files matched your search
@@ -3,7 +3,9 @@ name: Release Tauri App
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
|
# Accept lowercase and uppercase tags, for example v1.1.0.0 or V1.1.0.0.
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
- 'V*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -38,20 +40,37 @@ jobs:
|
|||||||
cd widget
|
cd widget
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
- name: Update version in tauri.conf.json
|
- name: Update app version from tag
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
# Keep Tauri/Cargo on valid SemVer while allowing release tags like V1.1.0.0.
|
||||||
if [[ ! "$TAG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
RAW_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^[vV]//')
|
||||||
TAG_VERSION="1.0.0"
|
APP_VERSION="1.1.0"
|
||||||
|
if [[ "$RAW_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)(\.[0-9]+)?$ ]]; then
|
||||||
|
APP_VERSION="${BASH_REMATCH[1]}"
|
||||||
fi
|
fi
|
||||||
echo "Updating tauri.conf.json version to $TAG_VERSION"
|
echo "Updating app version to $APP_VERSION"
|
||||||
node -e "
|
node -e "
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const file = './widget/src-tauri/tauri.conf.json';
|
|
||||||
const config = JSON.parse(fs.readFileSync(file, 'utf8'));
|
const updateJson = (file, update) => {
|
||||||
config.package.version = '$TAG_VERSION';
|
const data = JSON.parse(fs.readFileSync(file, 'utf8'));
|
||||||
fs.writeFileSync(file, JSON.stringify(config, null, 2), 'utf8');
|
update(data);
|
||||||
|
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
||||||
|
};
|
||||||
|
|
||||||
|
updateJson('./widget/package.json', (pkg) => {
|
||||||
|
pkg.version = '$APP_VERSION';
|
||||||
|
});
|
||||||
|
|
||||||
|
updateJson('./widget/src-tauri/tauri.conf.json', (config) => {
|
||||||
|
config.package.version = '$APP_VERSION';
|
||||||
|
});
|
||||||
|
|
||||||
|
const cargoFile = './widget/src-tauri/Cargo.toml';
|
||||||
|
const cargo = fs.readFileSync(cargoFile, 'utf8')
|
||||||
|
.replace(/^version = \".*\"$/m, 'version = \"$APP_VERSION\"');
|
||||||
|
fs.writeFileSync(cargoFile, cargo, 'utf8');
|
||||||
"
|
"
|
||||||
|
|
||||||
- name: Build the Tauri app
|
- name: Build the Tauri app
|
||||||
@@ -61,7 +80,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
tagName: ${{ github.ref_name }}
|
tagName: ${{ github.ref_name }}
|
||||||
releaseName: 'TodoFlow ${{ github.ref_name }}'
|
releaseName: 'TodoFlow ${{ github.ref_name }}'
|
||||||
releaseBody: 'Release generated automatically by GitHub Actions.'
|
releaseBody: |
|
||||||
releaseDraft: true
|
Installeur Windows de TodoFlow ${{ github.ref_name }}.
|
||||||
|
|
||||||
|
Telechargez le fichier `.exe` (NSIS) ou `.msi` ci-dessous pour installer l'application.
|
||||||
|
releaseDraft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
projectPath: './widget'
|
projectPath: './widget'
|
||||||
+1
-1
@@ -43,7 +43,7 @@ async def lifespan(app: FastAPI):
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="TodoFlow API",
|
title="TodoFlow API",
|
||||||
description="API centralisée pour la Todo list, connectée au widget de bureau et pilotable par Agent IA.",
|
description="API centralisée pour la Todo list, connectée au widget de bureau et pilotable par Agent IA.",
|
||||||
version="1.0.0",
|
version="1.1.0",
|
||||||
lifespan=lifespan
|
lifespan=lifespan
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "todoflow-widget",
|
"name": "todoflow-widget",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "todoflow"
|
name = "todoflow"
|
||||||
version = "1.0.0"
|
version = "1.1.0"
|
||||||
description = "Sleek Windows TodoFlow desktop widget"
|
description = "Sleek Windows TodoFlow desktop widget"
|
||||||
authors = ["Michael"]
|
authors = ["Michael"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -67,6 +67,32 @@ fn get_autostart() -> Result<bool, String> {
|
|||||||
Ok(val.is_ok())
|
Ok(val.is_ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- GESTION DE LA VISIBILITÉ DE LA FENÊTRE ---
|
||||||
|
|
||||||
|
fn toggle_window_visibility(app: &AppHandle) {
|
||||||
|
// Bascule l'affichage du widget depuis l'icône de la barre d'état.
|
||||||
|
// Comme la fenêtre est configurée avec skipTaskbar:true, l'icône du tray est le
|
||||||
|
// seul point de restauration : il doit donc fonctionner dans tous les états.
|
||||||
|
let window = match app.get_window("main") {
|
||||||
|
Some(w) => w,
|
||||||
|
None => return,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Une fenêtre réduite est toujours rapportée comme "visible" par Tauri. On la
|
||||||
|
// considère donc comme masquée afin de la restaurer correctement (et non la re-masquer).
|
||||||
|
let is_minimized = window.is_minimized().unwrap_or(false);
|
||||||
|
let is_visible = window.is_visible().unwrap_or(false);
|
||||||
|
|
||||||
|
if is_visible && !is_minimized {
|
||||||
|
let _ = window.hide();
|
||||||
|
} else {
|
||||||
|
// Restauration robuste : dé-minimiser, ré-afficher, puis ramener au premier plan.
|
||||||
|
let _ = window.unminimize();
|
||||||
|
let _ = window.show();
|
||||||
|
let _ = window.set_focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --- CONTEXTE ET INITIALISATION ---
|
// --- CONTEXTE ET INITIALISATION ---
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -84,26 +110,14 @@ fn main() {
|
|||||||
.on_system_tray_event(|app, event| match event {
|
.on_system_tray_event(|app, event| match event {
|
||||||
SystemTrayEvent::LeftClick { .. } => {
|
SystemTrayEvent::LeftClick { .. } => {
|
||||||
// Un simple clic gauche sur l'icône de la barre des tâches bascule la visibilité
|
// Un simple clic gauche sur l'icône de la barre des tâches bascule la visibilité
|
||||||
let window = app.get_window("main").unwrap();
|
toggle_window_visibility(app);
|
||||||
if window.is_visible().unwrap() {
|
|
||||||
window.hide().unwrap();
|
|
||||||
} else {
|
|
||||||
window.show().unwrap();
|
|
||||||
window.set_focus().unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
|
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
|
||||||
"quit" => {
|
"quit" => {
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
"toggle" => {
|
"toggle" => {
|
||||||
let window = app.get_window("main").unwrap();
|
toggle_window_visibility(app);
|
||||||
if window.is_visible().unwrap() {
|
|
||||||
window.hide().unwrap();
|
|
||||||
} else {
|
|
||||||
window.show().unwrap();
|
|
||||||
window.set_focus().unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "TodoFlow",
|
"productName": "TodoFlow",
|
||||||
"version": "1.0.0"
|
"version": "1.1.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
+4
-1
@@ -88,7 +88,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|||||||
|
|
||||||
// Événements Tauri pour le contrôle de la fenêtre de bureau
|
// Événements Tauri pour le contrôle de la fenêtre de bureau
|
||||||
if (appWindow) {
|
if (appWindow) {
|
||||||
btnMinimize.addEventListener("click", () => appWindow.minimize());
|
// La fenêtre utilise skipTaskbar:true : elle n'apparaît jamais dans la barre des tâches.
|
||||||
|
// Un minimize() classique la rendrait donc irrécupérable. On masque plutôt vers le
|
||||||
|
// system tray, d'où elle peut toujours être restaurée via l'icône de la barre d'état.
|
||||||
|
btnMinimize.addEventListener("click", () => appWindow.hide());
|
||||||
btnClose.addEventListener("click", () => appWindow.hide()); // Masquer vers le tray au clic sur 'Fermer'
|
btnClose.addEventListener("click", () => appWindow.hide()); // Masquer vers le tray au clic sur 'Fermer'
|
||||||
|
|
||||||
// Récupération de l'état réel du démarrage automatique depuis le registre Windows
|
// Récupération de l'état réel du démarrage automatique depuis le registre Windows
|
||||||
|
|||||||
Reference in new issue
Block a user