fix: fix some build errors

This commit is contained in:
2026-04-24 20:34:50 +02:00
parent 2984699033
commit e391e9ff6a
9 changed files with 43 additions and 25 deletions

View File

@ -1,5 +1,4 @@
import { useEffect, useState } from "react";
import { openUrl } from "@tauri-apps/plugin-opener";
import { useStore } from "../store";
import { SectionItem, QuestItem, CombatType } from "../types";
import QuestDetailPanel from "./QuestDetailPanel";
@ -55,7 +54,7 @@ export default function GuideView() {
return (
<div style={{ flex: 1, display: "flex", overflow: "hidden", minHeight: 0, position: "relative" }}>
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}>
<div className="with-scrollbar" style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}>
{/* Header */}
<div style={{ marginBottom: "20px" }}>
@ -181,7 +180,7 @@ export default function GuideView() {
{/* List */}
{!resourcesCollapsed && (
<div style={{ flex: 1, overflowY: "auto", padding: "10px 14px", scrollbarWidth: "none" }}>
<div className="with-scrollbar" style={{ flex: 1, overflowY: "auto", padding: "10px 14px" }}>
{resources.map((r, i) => {
const owned = resourceInventory[r.name] ?? 0;
const done = owned >= r.quantity;

View File

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

View File

@ -120,7 +120,7 @@ export default function QuestDetailPanel({ questName, questUrl, profileId, onClo
</div>
{/* Content */}
<div style={{ flex: 1, overflowY: "auto", padding: "12px 16px", scrollbarWidth: "none" }}>
<div className="with-scrollbar" style={{ flex: 1, overflowY: "auto", padding: "12px 16px" }}>
{loading && (
<div style={{ display: "flex", alignItems: "center", justifyContent: "center", height: "120px", color: "#4a5568", fontSize: "13px" }}>
<span style={{ animation: "spin 1s linear infinite", display: "inline-block", marginRight: "8px" }}></span>

View File

@ -1,9 +1,9 @@
import { getCurrentWindow } from "@tauri-apps/api/window";
import type { ResizeEdge } from "@tauri-apps/api/window";
import type { ResizeDirection } from "@tauri-apps/api/window";
const S = 8; // grab zone size in px
const handles: { edge: ResizeEdge; style: React.CSSProperties }[] = [
const handles: { edge: ResizeDirection; style: React.CSSProperties }[] = [
{ edge: "North", style: { top: 0, left: S, right: S, height: S, cursor: "n-resize" } },
{ edge: "South", style: { bottom: 0, left: S, right: S, height: S, cursor: "s-resize" } },
{ edge: "West", style: { top: S, left: 0, bottom: S, width: S, cursor: "w-resize" } },

View File

@ -15,7 +15,6 @@ export default function Sidebar() {
const { guides, openGuide, activeGuideGid, view, sidebarCollapsed, setSidebarCollapsed } = useStore();
const [search, setSearch] = useState("");
const collapsed = sidebarCollapsed;
const setCollapsed = setSidebarCollapsed;
const windowWidth = useWindowWidth();
const isOverlay = collapsed || windowWidth < 500;
@ -41,8 +40,7 @@ export default function Sidebar() {
}}>
{/* Toggle button */}
<button
onClick={() => setCollapsed(c => !c)}
title={collapsed ? "Ouvrir le menu" : "Réduire le menu"}
onClick={() => setSidebarCollapsed(!sidebarCollapsed)} title={collapsed ? "Ouvrir le menu" : "Réduire le menu"}
style={{
width: "100%",
height: "36px",

View File

@ -40,14 +40,13 @@ html, body {
padding: 0;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
html, body {
* {
scrollbar-width: none;
}
@ -65,20 +64,25 @@ body {
user-select: none;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 6px;
height: 6px;
/* Scrollbar explicite sur les zones qui en ont besoin */
.with-scrollbar {
scrollbar-width: thin !important;
scrollbar-color: var(--color-border-bright) var(--color-bg-deep) !important;
}
::-webkit-scrollbar-track {
background: var(--color-bg-deep);
.with-scrollbar::-webkit-scrollbar {
display: block !important;
width: 4px !important;
height: 4px !important;
}
::-webkit-scrollbar-thumb {
background: var(--color-border-bright);
border-radius: 3px;
.with-scrollbar::-webkit-scrollbar-track {
background: var(--color-bg-deep) !important;
}
::-webkit-scrollbar-thumb:hover {
background: var(--color-gold-dim);
.with-scrollbar::-webkit-scrollbar-thumb {
background: var(--color-border-bright) !important;
border-radius: 2px !important;
}
.with-scrollbar::-webkit-scrollbar-thumb:hover {
background: var(--color-gold-dim) !important;
}
/* Checkbox custom */

View File

@ -12,6 +12,7 @@ interface AppState {
syncing: boolean;
syncProgress: { current: number; total: number; label: string } | null;
view: "home" | "guide";
sidebarCollapsed: boolean;
resourcesPanelCollapsed: boolean;
resourceInventory: Record<string, number>;
@ -25,6 +26,7 @@ interface AppState {
loadGuides: () => Promise<void>;
openGuide: (gid: string) => Promise<void>;
setSidebarCollapsed: (collapsed: boolean) => void;
closeGuide: () => void;
toggleQuest: (questName: string) => Promise<void>;
@ -43,6 +45,7 @@ export const useStore = create<AppState>((set, get) => ({
syncing: false,
syncProgress: null,
view: "home",
sidebarCollapsed: false,
resourcesPanelCollapsed: false,
resourceInventory: {},
@ -111,6 +114,8 @@ export const useStore = create<AppState>((set, get) => ({
set({ activeGuideGid: gid, activeGuideData: data, view: "guide" });
},
setSidebarCollapsed: (collapsed) => set({ sidebarCollapsed: collapsed }),
closeGuide: () => {
invoke("set_setting", { key: "active_guide", value: "" });
set({ activeGuideGid: null, activeGuideData: null, view: "home" });