Commit graph

20 commits

Author SHA1 Message Date
b11f64d5a1 refactor(frontend): route protected API access through server session 2026-03-12 16:27:24 +01:00
157cbc425e feat(frontend): improve lab result filter ergonomics 2026-03-10 12:44:19 +01:00
0253b2377d feat(frontend): unify page shell and move create flows to dedicated routes 2026-03-10 12:25:25 +01:00
d91d06455b feat(products): improve replenishment-aware shopping suggestions
Replace product weight and repurchase intent fields with per-package remaining levels and inventory-first restock signals. Enrich shopping suggestions with usage-aware replenishment scoring so the frontend and LLM can prioritize real gaps and near-empty staples more reliably.
2026-03-09 13:37:40 +01:00
bb5d402c15 feat(products): improve shopping suggestion decision support 2026-03-08 22:30:30 +01:00
d228b44209 feat(i18n): add Phase 3 observability translations (EN + PL)
Added translations for all observability components:
- Validation warnings panel
- Auto-fixes badge
- AI reasoning process viewer
- Debug information panel
- Structured error display

English translations (en.json):
- observability_validationWarnings: "Validation Warnings"
- observability_autoFixesApplied: "Automatically adjusted"
- observability_aiReasoningProcess: "AI Reasoning Process"
- observability_debugInfo: "Debug Information"
- observability_model/duration/tokenUsage: Debug panel labels
- observability_validationFailed: "Safety validation failed"

Polish translations (pl.json):
- observability_validationWarnings: "Ostrzeżenia walidacji"
- observability_autoFixesApplied: "Automatycznie dostosowano"
- observability_aiReasoningProcess: "Proces rozumowania AI"
- observability_debugInfo: "Informacje debugowania"
- All debug panel labels translated
- observability_validationFailed: "Walidacja bezpieczeństwa nie powiodła się"

Updated components:
- ValidationWarningsAlert: Uses m.observability_validationWarnings()
- AutoFixBadge: Uses m.observability_autoFixesApplied()
- ReasoningChainViewer: Uses m.observability_aiReasoningProcess()
- MetadataDebugPanel: All labels now use i18n
- StructuredErrorDisplay: Translates error prefixes

All components now fully support English and Polish locales.
2026-03-06 16:28:23 +01:00
b99b9ed68e feat(profile): add profile settings and LLM user context 2026-03-05 15:57:21 +01:00
0a4ccefe28 feat(repo): expand lab results workflows across backend and frontend 2026-03-05 12:46:49 +01:00
013492ec2b refactor(products): remove usage notes and contraindications fields 2026-03-05 10:11:24 +01:00
9df241a6a9 feat(frontend): localize skin active concerns with enum multi-select 2026-03-04 23:37:14 +01:00
d4fbc1faf5 feat(frontend): streamline AI workflows and localize remaining UI copy
Move product and skin AI helpers into modal flows, simplify product edit/inventory navigation, and improve responsive actions so core forms are faster to use. Localize remaining frontend labels/placeholders and strip deprecated Rollup output options to remove deploy-time build warnings.
2026-03-04 18:13:49 +01:00
c5ea38880c refactor(products): remove obsolete interaction fields across stack 2026-03-04 12:42:12 +01:00
a7ad956a62 fix(frontend): correct plural forms for count labels 2026-03-04 01:30:56 +01:00
820d58ea37 feat(routines): enrich single AI suggestions with concise context 2026-03-04 01:22:57 +01:00
067e460dd2 chore(frontend): format files with prettier 2026-03-03 20:51:34 +01:00
40f9a353bb feat(products): add shopping suggestions feature
- Add POST /api/products/suggest endpoint that analyzes skin condition
  and inventory to suggest product types (e.g., 'Salicylic Acid 2% Masque')
- Add MCP tool get_shopping_suggestions() for MCP clients
- Add 'Suggest' button to Products page in frontend
- Add /products/suggest page with suggestion cards
- Include product type, key ingredients, target concerns, why_needed,
  recommended_time, and frequency in suggestions
- Fix stock logic: sealed products now count as available inventory
- Add legend to clarify ✓ (in stock) vs ✗ (not in stock) markers
2026-03-02 22:38:08 +01:00
c85ca355df refactor(routines): streamline suggest prompt — merge inventory context, add leaving_home SPF hint
- Remove _build_inventory_context; fold pao_months into DOSTĘPNE PRODUKTY entries
- Remove "Otwarte równolegle" duplicate section from prompt
- Rename OSTATNIE RUTYNY (7 dni) → OSTATNIE RUTYNY
- Add _build_day_context and SuggestRoutineRequest.leaving_home (optional bool)
- System prompt: replace unconditional PAO rule with conditional; add SPF factor
  selection logic based on KONTEKST DNIA leaving_home value
- Frontend: leaving_home checkbox (AM only) + i18n keys pl/en

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 23:47:54 +01:00
17eaa5d1bd fix(frontend): add missing priorities field to skin snapshots UI
priorities was present in the model, API, and LLM prompt but never
surfaced in the frontend — add it to create/edit forms, read view,
AI photo pre-fill, and page.server.ts actions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 19:58:38 +01:00
75ef1bca56 feat(routines): add minoxidil beard/mustache option to routine suggestions
- Add include_minoxidil_beard flag to SuggestRoutineRequest and SuggestBatchRequest
- Detect minoxidil products by scanning name, brand, INCI and actives; pass them
  to the LLM even though they are medications
- Inject CELE UŻYTKOWNIKA context block into prompts when flag is enabled
- Add _build_objectives_context() returning empty string when flag is off
- Add call_gemini() helper that centralises Gemini API calls and logs every
  request/response to a new ai_call_logs table (AICallLog model + /ai-logs router)
- Nginx: raise client_max_body_size to 16 MB for photo uploads

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 19:46:07 +01:00
99584521a1 feat(frontend): add PL/EN i18n using @inlang/paraglide-js v2
- Install @inlang/paraglide-js v2 with Vite plugin and paraglideMiddleware hook
- Add messages/pl.json and messages/en.json with ~400 translation keys
- Create project.inlang/settings.json (PL as base locale)
- Add LanguageSwitcher component (cookie-based, no URL prefix needed)
- Replace all hardcoded strings across 14 pages/components with m.*() calls
- ProductForm uses derived label maps for all enum types (category, texture, etc.)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 13:20:34 +01:00