refactoring-backend #3

Merged
lukas.pupkalipinski merged 403 commits from refactoring-backend into main 2026-05-20 20:23:46 +02:00
2 changed files with 0 additions and 29 deletions
Showing only changes of commit 6d21a53620 - Show all commits

View File

@@ -1,31 +1,3 @@
### TASK-QUALITY-05 — `console.warn` in `MapPage` Provides No User Feedback for Threshold Errors
**Where found**
`frontend/src/pages/MapPage.tsx` lines ~148151:
```ts
useEffect(() => {
if (mapThresholdError) {
console.warn("Failed to load map color thresholds:", mapThresholdError);
}
}, [mapThresholdError]);
```
When the threshold fetch fails the map silently falls back to hardcoded defaults. The user has no indication that their custom thresholds are not being applied.
**Goal**
Replace the `console.warn` with a small inline `MessageBar` or tooltip near the map legend that indicates thresholds could not be loaded and defaults are in use. The `console.warn` should be removed from production-facing code.
**Possible traps and issues**
- The fallback behaviour (using hardcoded defaults) is correct and the map should still render. The notification should be non-blocking (not a modal or full-page error).
- If the threshold fetch failing is expected in certain deployment configurations (e.g. feature not configured), an info-level message rather than a warning may be more appropriate.
**Docs changes needed**
None required.
**Why this is needed**
`console.warn` is invisible to end users. If a custom threshold configuration is silently not applied, the map colour coding may be misleading with no indication of why.
---
### TASK-QUALITY-06 — `console.log` Leaked in `HistoryPage.test.tsx`
**Where found**

View File

@@ -5,7 +5,6 @@ import { FluentProvider, webLightTheme } from "@fluentui/react-components";
let lastCallArgs: unknown[] | null = null;
const mockUseHistory = vi.fn((...args: unknown[]) => {
console.log("mockUseHistory called with args:", args);
lastCallArgs = args;
return {
items: [],