Compare commits

...

22 Commits

Author SHA1 Message Date
62eb7e6e58 Update user menu display for cleaner interface
Replaced the email with a generic "Account" label in the user menu for better design consistency and to avoid truncation issues. Adjusted the dropdown max width to 180px for improved alignment with the new layout.
2026-02-03 20:27:21 +01:00
7036f29481 Add password change functionality to user settings
Implemented a secure password change endpoint in the backend with validation. Enhanced the frontend to include a modal for updating the user's password, ensuring real-time input validation and user feedback.
2026-02-03 20:24:20 +01:00
bf37850e79 Improve chip selection and modal closing behavior
Updated the chip handling logic to ensure a smoother user experience by immediately closing modals in the frontend before performing asynchronous operations. Enhanced error handling and streamlined tag display logic for clarity and consistency.
2026-02-03 20:15:46 +01:00
a9dbbd65a4 Update status logic to include "m" in note_tag checks
Previously, only "i" and "s" were considered in the note_tag check for determining effectiveStatus. This update adds "m" to the condition, ensuring accurate status handling for entries with note_tag "m".
2026-02-03 20:09:45 +01:00
ca15266fb9 Add local storage handling for chip selection in frontend
Introduced functions to manage chip data in local storage, ensuring smoother handling of chip selections without backend dependency. Adjusted UI logic to display chip tags dynamically and modified "s" state handling to integrate local storage data seamlessly.
2026-02-03 18:46:33 +01:00
e2b97b69e9 Refactor tag handling and remove unused functions
Consolidated tag cycling logic into a single function, simplifying and clarifying its purpose. Removed redundant functions related to tag parsing and storage. Updated UI elements for better readability and consistency.
2026-02-03 16:10:32 +01:00
59f477c343 Rename CHIP_LIST to CHIP_OPTIONS for clarity
The constant name was updated to better reflect its purpose as a list of selectable options. This improves code readability and maintainability.
2026-02-03 15:53:40 +01:00
7be21969e7 Add cycleTag function for tag value transitions
Implemented the cycleTag function to handle transitions between tag states ("i", "m", "s") and reset for special cases starting with "s.". This prepares the application to support dynamic tag cycling functionality.
2026-02-03 15:49:09 +01:00
db35a7b0c9 Refactor chip state variable names for consistency
Renamed state variables `chipPickOpen` and `chipPickEntry` to `chipOpen` and `chipEntry`. This change improves naming consistency across the component, simplifying readability and maintenance.
2026-02-03 15:39:10 +01:00
d2e2286627 Refactor chip selection logic and UI improvements
Unified chip modal functionality by consolidating state variables and methods. Enhanced UI consistency for effective statuses and streamlined code for readability and maintainability. Updated styles for better visual appeal and clarity.
2026-02-03 15:35:55 +01:00
b8fc47e881 Update text style for additional conditions
Adjusted text decoration and opacity to apply when certain tags ("i" or "s") are set. This ensures better visual feedback for the specified conditions in the application interface.
2026-02-03 15:22:18 +01:00
2ec7c63119 Refactor tag handling and add chip localStorage support
Refactored tag handling logic by introducing helper functions to improve clarity and maintainability. Added localStorage support for storing and retrieving chip values associated with entries, ensuring smoother transitions and proper state management across sessions. Simplified backend interactions for the "s" tag and improved display logic for tags with chips.
2026-02-03 15:13:21 +01:00
6a5ff44135 Add chip selection feature for "s" tags
Implemented a chip selection modal that appears when cycling to the "s" tag. Users can now assign specific chips (e.g., "s.AL") to entries, improving interactivity and flexibility in tagging.
2026-02-03 15:00:31 +01:00
3546500d9e Refactor styles to use central theme tokens for consistency.
Replaced hardcoded colors and styles with reusable `stylesTokens` for improved maintainability and uniformity across the application. Simplified inline styles, cleaned up redundancies, and enhanced readability while adhering to the new dark and gold theme.
2026-02-03 13:52:43 +01:00
6cf7bf506a Add PWA support using vite-plugin-pwa
Integrated the vite-plugin-pwa to enable Progressive Web App functionality. Added service worker registration, manifest configuration, and necessary assets like icons and favicon. This enhances offline capabilities and user experience.
2026-02-03 13:35:52 +01:00
52e1d5f0f8 Update marauders-map-blur.jpg in public assets
Replaced the previous version of the marauders-map-blur.jpg file with an updated one. This ensures the latest version is available in the frontend public assets directory.
2026-02-03 13:18:39 +01:00
e6267986db Update styling for App background elements
Removed unused `bgInkVignette` styles and adjusted `zIndex` for better layering control. Updated background image URL for `bgMap` to ensure proper path resolution. These changes improve overall code clarity and maintainability.
2026-02-03 13:16:35 +01:00
e6d32bc151 Remove redundant background style settings.
The background color settings for `document.body` and `document.documentElement` were removed as they are not needed. This simplifies the global styling without affecting functionality.
2026-02-03 13:11:55 +01:00
9fd8934439 Remove unused bgInkVignette styling and references.
This cleanup removes the bgInkVignette element and its associated styles from the codebase. These changes simplify the component structure and improve maintainability by eliminating unnecessary code.
2026-02-03 13:10:10 +01:00
f65a2b30ee Update comments for background styling configuration
Replaced a single-line comment with a block comment in the background styling configuration. No functional changes were made; this is purely for better readability and maintainability.
2026-02-03 13:07:43 +01:00
def1fb9545 Update background image for the map in App.jsx
Replaced the old background image with a new blurred version to improve visual aesthetics. The updated image is located in the '/public/bg/' directory.
2026-02-03 13:04:36 +01:00
1645de206f Comment out unused CSS styles
Unused CSS styles related to hover, tap highlight, and button states in the App component have been commented out to clean up the file. This change helps to improve code readability and reduce clutter while retaining the styles for potential future use.
2026-02-03 13:03:33 +01:00
8 changed files with 610 additions and 308 deletions

View File

@@ -2,7 +2,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request, Response
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from ..db import get_db from ..db import get_db
from ..models import User from ..models import User
from ..security import verify_password, make_session_value, set_session, clear_session, get_session_user_id from ..security import verify_password, make_session_value, set_session, clear_session, get_session_user_id, hash_password
router = APIRouter(prefix="/auth", tags=["auth"]) router = APIRouter(prefix="/auth", tags=["auth"])
@@ -31,3 +31,22 @@ def me(req: Request, db: Session = Depends(get_db)):
raise HTTPException(status_code=401, detail="not logged in") raise HTTPException(status_code=401, detail="not logged in")
return {"id": user.id, "email": user.email, "role": user.role} return {"id": user.id, "email": user.email, "role": user.role}
@router.patch("/password")
def set_password(data: dict, req: Request, db: Session = Depends(get_db)):
uid = get_session_user_id(req)
if not uid:
raise HTTPException(status_code=401, detail="not logged in")
password = data.get("password") or ""
if len(password) < 8:
raise HTTPException(status_code=400, detail="password too short (min 8)")
user = db.query(User).filter(User.id == uid, User.disabled == False).first()
if not user:
raise HTTPException(status_code=401, detail="not logged in")
user.password_hash = hash_password(password)
db.add(user)
db.commit()
return {"ok": True}

View File

@@ -13,6 +13,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
"vite": "^5.4.8" "vite": "^5.4.8",
"vite-plugin-pwa": "^0.20.0"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 47 KiB

BIN
frontend/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,7 @@
import React from "react"; import React from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import App from "./App.jsx"; import App from "./App.jsx";
import { registerSW } from "virtual:pwa-register";
createRoot(document.getElementById("root")).render(<App />); createRoot(document.getElementById("root")).render(<App />);
registerSW({ immediate: true });

View File

@@ -1,6 +1,34 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [
react(),
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"favicon.ico",
"icons/icon-512.png",
"marauders-map.jpg" // oder dein Hintergrund
],
manifest: {
name: "Zauber-Detektiv Notizbogen",
short_name: "Notizbogen",
description: "Cluedo-Magie Sheet",
start_url: "/",
scope: "/",
display: "standalone",
background_color: "#1c140d",
theme_color: "#caa45a",
icons: [
{ src: "/icons/icon-512.png", sizes: "512x512", type: "image/png" }
]
},
workbox: {
// Caching-Default: die App-Shell wird offline verfügbar
globPatterns: ["**/*.{js,css,html,ico,png,jpg,jpeg,svg,webp}"],
}
})
]
}); });