fix: cleaning repo

This commit is contained in:
2026-04-22 12:44:10 +02:00
parent ce4cd6939a
commit 7de1fa2850
13 changed files with 78 additions and 10 deletions

11
.gitignore vendored
View File

@ -7,7 +7,16 @@ dist-ssr/
# Rust / Tauri # Rust / Tauri
src-tauri/target/ src-tauri/target/
src-tauri/gen/schemas/ src-tauri/gen/
# Local dev scripts (machine-specific paths)
run.sh
# Template assets (not used)
public/tauri.svg
public/vite.svg
src/assets/react.svg
src/App.css
# Logs # Logs
logs/ logs/

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/png" href="/logo_tougli.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TougliGui</title> <title>TougliGui</title>
</head> </head>

2
src-tauri/Cargo.lock generated
View File

@ -5589,6 +5589,7 @@ dependencies = [
"chrono", "chrono",
"csv", "csv",
"dirs-next", "dirs-next",
"gtk",
"reqwest 0.12.28", "reqwest 0.12.28",
"rusqlite", "rusqlite",
"serde", "serde",
@ -5600,6 +5601,7 @@ dependencies = [
"tauri-plugin-sql", "tauri-plugin-sql",
"tokio", "tokio",
"uuid", "uuid",
"webkit2gtk",
] ]
[[package]] [[package]]

View File

@ -26,3 +26,7 @@ tokio = { version = "1", features = ["full"] }
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4"] } uuid = { version = "1", features = ["v4"] }
dirs-next = "2" dirs-next = "2"
[target.'cfg(target_os = "linux")'.dependencies]
webkit2gtk = { version = "2.0", features = ["v2_38"] }
gtk = "0.18"

View File

@ -14,6 +14,23 @@ pub fn run() {
let conn = db::open().expect("Failed to open database"); let conn = db::open().expect("Failed to open database");
db::migrate(&conn).expect("Failed to migrate database"); db::migrate(&conn).expect("Failed to migrate database");
app.manage(DbState(Mutex::new(conn))); app.manage(DbState(Mutex::new(conn)));
#[cfg(target_os = "linux")]
{
use gtk::prelude::*;
use webkit2gtk::WebViewExt;
let window = app.get_webview_window("main").expect("no main window");
window.with_webview(|wv| {
let webkit_view = wv.inner();
if let Some(parent) = webkit_view.parent() {
if let Ok(sw) = parent.downcast::<gtk::ScrolledWindow>() {
sw.set_policy(gtk::PolicyType::Never, gtk::PolicyType::Never);
}
}
}).ok();
}
Ok(()) Ok(())
}) })
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![

View File

@ -19,6 +19,7 @@
"minHeight": 500, "minHeight": 500,
"decorations": false, "decorations": false,
"transparent": false, "transparent": false,
"backgroundColor": "#0d1117",
"alwaysOnTop": true, "alwaysOnTop": true,
"resizable": true "resizable": true
} }

View File

@ -82,7 +82,7 @@ export default function App() {
background: #0d1117; overflow: hidden; background: #0d1117; overflow: hidden;
} }
.app-body { display: flex; flex: 1; overflow: hidden; } .app-body { display: flex; flex: 1; overflow: hidden; }
.app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; } .app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
`}</style> `}</style>
</div> </div>
); );

View File

@ -14,7 +14,7 @@ export default function GuideView() {
const pct = allQuests.length > 0 ? Math.round((completedCount / allQuests.length) * 100) : 0; const pct = allQuests.length > 0 ? Math.round((completedCount / allQuests.length) * 100) : 0;
return ( return (
<div style={{ flex: 1, display: "flex", overflow: "hidden" }}> <div style={{ flex: 1, display: "flex", overflow: "hidden", minHeight: 0 }}>
{/* Main quest list */} {/* Main quest list */}
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}> <div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}>
{/* Guide header */} {/* Guide header */}

View File

@ -13,7 +13,7 @@ export default function HomeView() {
const inProgressGuides = guides.filter(g => g.completed_quests > 0 && g.completed_quests < g.total_quests); const inProgressGuides = guides.filter(g => g.completed_quests > 0 && g.completed_quests < g.total_quests);
return ( return (
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}> <div style={{ flex: 1, overflowY: "auto", padding: "20px 24px", minHeight: 0 }}>
{/* Header */} {/* Header */}
<div style={{ marginBottom: "24px" }}> <div style={{ marginBottom: "24px" }}>
<h1 style={{ fontSize: "18px", fontWeight: 700, color: "#f0c040", marginBottom: "4px" }}> <h1 style={{ fontSize: "18px", fontWeight: 700, color: "#f0c040", marginBottom: "4px" }}>

View File

@ -30,7 +30,7 @@ export default function Sidebar() {
/> />
</div> </div>
<div style={{ flex: 1, overflowY: "auto", padding: "8px 0" }}> <div style={{ flex: 1, overflowY: "auto", padding: "8px 0", scrollbarWidth: "none" }}>
{filtered.length === 0 ? ( {filtered.length === 0 ? (
<div style={{ padding: "16px 12px", color: "#4a5568", fontSize: "12px", textAlign: "center" }}> <div style={{ padding: "16px 12px", color: "#4a5568", fontSize: "12px", textAlign: "center" }}>
Aucun guide synchronisé Aucun guide synchronisé

View File

@ -9,7 +9,7 @@ export default function TitleBar({ onOpenProfiles }: Props) {
const { alwaysOnTop, toggleAlwaysOnTop, syncing, syncGuides, view, closeGuide, activeGuideData } = useStore(); const { alwaysOnTop, toggleAlwaysOnTop, syncing, syncGuides, view, closeGuide, activeGuideData } = useStore();
function handleDragMouseDown(e: React.MouseEvent) { function handleDragMouseDown(e: React.MouseEvent) {
if (e.button === 0) { if (e.button === 0 && !alwaysOnTop) {
getCurrentWindow().startDragging(); getCurrentWindow().startDragging();
} }
} }
@ -36,7 +36,7 @@ export default function TitleBar({ onOpenProfiles }: Props) {
onMouseDown={handleDragMouseDown} onMouseDown={handleDragMouseDown}
style={{ style={{
display: "flex", alignItems: "center", gap: "8px", flex: 1, display: "flex", alignItems: "center", gap: "8px", flex: 1,
cursor: "grab", userSelect: "none", cursor: alwaysOnTop ? "default" : "grab", userSelect: "none",
}} }}
> >
<img src="/logo_tougli.png" style={{ pointerEvents: "none", width: "24px", height: "24px", objectFit: "contain" }} /> <img src="/logo_tougli.png" style={{ pointerEvents: "none", width: "24px", height: "24px", objectFit: "contain" }} />

View File

@ -32,10 +32,30 @@
padding: 0; padding: 0;
} }
html, body, #root { html, body {
height: 100%; height: 100%;
width: 100%;
overflow: hidden; overflow: hidden;
overscroll-behavior: none;
margin: 0;
padding: 0;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
html, body {
scrollbar-width: none;
}
#root {
position: fixed;
inset: 0;
overflow: hidden;
overscroll-behavior: none;
font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
} }

View File

@ -2,6 +2,21 @@ import React from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import App from "./App"; import App from "./App";
// Block all document-level scrolling
document.addEventListener("wheel", (e) => {
let el = e.target as HTMLElement | null;
while (el && el !== document.documentElement) {
const { overflowY } = window.getComputedStyle(el);
if (overflowY === "scroll" || overflowY === "auto") return;
el = el.parentElement;
}
e.preventDefault();
}, { passive: false });
document.addEventListener("scroll", () => {
window.scrollTo(0, 0);
}, { passive: true });
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode> <React.StrictMode>
<App /> <App />