110 lines
3.9 KiB
Markdown
110 lines
3.9 KiB
Markdown
# Session Checkpoint (2026-05-11)
|
|
|
|
## Status
|
|
- Branch/worktree: ändringar finns lokalt och är analyserade med `flutter analyze`.
|
|
- Senaste verifiering: `flutter analyze lib/core/utils/display_labels.dart lib/features/inventory/presentation/swipeable_inventory_tile.dart lib/features/pantry/presentation/pantry_screen.dart` -> inga fel.
|
|
|
|
## Klart i denna session
|
|
|
|
1. Kategori-chip i `/inventory` och `/baslager` visar nu djupaste kategori (L3 om den finns, annars L2/L1) utan prefix (`L1/L2/L3`).
|
|
2. Hover/long-press på chip visar full kategoriväg (`L1 > L2 > L3`) via tooltip.
|
|
3. Cache-invalidation fixad efter kategoriändring i admin:
|
|
- Invaliderar både `inventoryProvider` och `pantryProvider` i globala produktflöden.
|
|
4. Kodstädning/optimering:
|
|
- Gemensam helper returnerar både chip-label och tooltip i en parsing.
|
|
- Oanvänd helper borttagen.
|
|
5. Dokumentation uppdaterad och rubrik-konflikt städad för 2026-05-11-sektionerna.
|
|
|
|
## Ändrade filer
|
|
|
|
- `flutter/lib/features/admin/presentation/admin_products_panel.dart`
|
|
- `flutter/lib/core/utils/display_labels.dart`
|
|
- `flutter/lib/features/inventory/presentation/swipeable_inventory_tile.dart`
|
|
- `flutter/lib/features/pantry/presentation/pantry_screen.dart`
|
|
- `TEKNISK_BESKRIVNING.md`
|
|
|
|
## Viktiga beteenderegler som nu gäller
|
|
|
|
- Chiptext: visar endast djupaste kategorinamn.
|
|
- Tooltip: visar full kategori-path.
|
|
- Om path saknas: fallback till L1/"Övrigt" enligt befintlig modell.
|
|
|
|
## Kvar / nästa steg (rekommenderat)
|
|
|
|
1. Lägg widgettester för category-chip:
|
|
- inventory: djupaste label + full tooltip
|
|
- baslager: djupaste label + full tooltip
|
|
2. Besluta om sortering ska följa visad kategori (djupaste nod) eller fortsatt L1.
|
|
3. Commit/pusha ändringarna när du är nöjd.
|
|
|
|
---
|
|
|
|
## Uppdatering 2026-05-12
|
|
|
|
### Klart nu
|
|
|
|
1. Widgettester tillagda för category-chip/tooltip:
|
|
- `flutter/test/features/inventory/presentation/swipeable_inventory_tile_test.dart`
|
|
- `flutter/test/features/pantry/presentation/pantry_screen_category_chip_test.dart`
|
|
2. Sorteringsbeslut implementerat:
|
|
- Sortering på `Kategori (A-O)` följer nu visad kategori (djupaste nod), inte enbart L1.
|
|
- Uppdaterat i både inventory- och baslagervyn.
|
|
|
|
### Deploy + manuell produktionstest (körplan)
|
|
|
|
Kör deploy:
|
|
|
|
```bash
|
|
./deploy.sh --backend --flutter
|
|
```
|
|
|
|
Om du vill tvinga kontroll av nya basimages:
|
|
|
|
```bash
|
|
./deploy.sh --backend --flutter --pull-always
|
|
```
|
|
|
|
Verifiera drift efter deploy:
|
|
|
|
```bash
|
|
docker compose -f compose.yml -f compose.flutter.yml ps
|
|
curl http://localhost:8080/api/health
|
|
curl http://localhost:8080/api/health/db
|
|
```
|
|
|
|
Manuell produktionschecklista:
|
|
|
|
- [ ] Receipt import: verifiera att alla rader syns (scroll-fix).
|
|
- [ ] Receipt import: verifiera att okända varor visar `Kategoriförslag`.
|
|
- [ ] Inventory: verifiera category-chip (djupaste nod) + tooltip (full path).
|
|
- [ ] Baslager: verifiera category-chip (djupaste nod) + tooltip (full path).
|
|
- [ ] Admin: verifiera rename/merge av produkter.
|
|
- [ ] User: verifiera private rename/merge-behörighet och funktion.
|
|
|
|
Fallback vid avvikelse:
|
|
|
|
- Spara backend-loggar för receipt import och kategori-matchning.
|
|
- Notera exakt testdata (kvitto/PDF, produktnamn, förväntat vs faktiskt utfall).
|
|
|
|
## Snabb återstart nästa gång
|
|
|
|
Kör:
|
|
|
|
```bash
|
|
git status
|
|
git diff -- flutter/lib/core/utils/display_labels.dart \
|
|
flutter/lib/features/inventory/presentation/swipeable_inventory_tile.dart \
|
|
flutter/lib/features/pantry/presentation/pantry_screen.dart \
|
|
flutter/lib/features/admin/presentation/admin_products_panel.dart \
|
|
TEKNISK_BESKRIVNING.md
|
|
```
|
|
|
|
Och därefter:
|
|
|
|
```bash
|
|
cd flutter
|
|
flutter analyze lib/core/utils/display_labels.dart \
|
|
lib/features/inventory/presentation/swipeable_inventory_tile.dart \
|
|
lib/features/pantry/presentation/pantry_screen.dart
|
|
```
|