Wrap all prop-derived $state initializers with untrack() to explicitly
signal that one-time capture from the product prop is intentional.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds full_weight_g and empty_weight_g to ProductBase (inherited by Product
and response models) so per-product package weight specs are captured.
Adds last_weighed_at to ProductInventory to record when a package was last
weighed. Wires up all fields through API schemas, frontend types, forms, and
the product detail page (add/edit/display).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Classification: replace fragmented layout (full-width + 3-col + full-width)
with a single 2-column grid; Category spans full width via col-span-2
- Effect profile: replace flex + fixed w-40 label with CSS grid using
minmax(7rem,10rem) label column to prevent overflow at narrow viewports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ProductBase, ProductPublic, ProductWithInventory and
SkinConditionSnapshotBase, SkinConditionSnapshotPublic. Table models now inherit
from their Base counterpart and override JSON fields with sa_column. All
field_serializer hacks removed; FastAPI response models use the non-table Public
classes so Pydantic coerces raw DB dicts → typed models cleanly. ProductCreate
and SnapshotCreate now simply inherit their respective Base classes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract shared ProductForm.svelte component covering actives (dynamic
rows with ingredient function checkboxes), product_effect_profile
(range sliders 0–5), context_rules (tristate selects), synergizes_with,
incompatible_with (dynamic rows), and contraindications.
Replace the Quick edit stub on the product detail page with the full
edit form pre-populated from the existing product. Update both server
actions to parse all new fields including JSON payloads for complex
nested objects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop Product.personal_rating from model, API schemas, and all frontend
views (list table, detail view, quick-edit form, new-product form)
- Extract get_or_404 into backend/innercontext/api/utils.py; remove five
duplicate copies from individual API modules
- Fix all ty type errors: generic get_or_404 with TypeVar, cast() in
coerce_effect_profile validator, col() for ilike on SQLModel column,
dict[str, Any] annotation in test helper, ty: ignore for CORSMiddleware
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
shadcn-svelte components import these types from \$lib/utils — add
re-exports from bits-ui to resolve 25 type errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop fields identified as redundant or low-value from the Product model,
API schemas, frontend types, and forms. Raise effect_profile threshold in
to_llm_context() from >0 to >=2 to suppress noise values. Remove sku/barcode
from LLM context output (kept on model for catalog use).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename skincare route prefix /skin-snapshots → /skincare to match API client
- Add redirect_slashes=False to FastAPI app; change collection routes from "/" to ""
to eliminate 307 redirects on POST/GET without trailing slash
- Fix redirect() inside try/catch in products/new and routines/new server actions
(SvelteKit redirect() throws and was being caught as a 500 error)
- Eagerly load inventory and steps relationships via explicit SELECT + model_dump(mode="json"),
working around SQLModel 0.0.37 not serializing Relationship fields in response_model
- Add field_validator for product_effect_profile to coerce DB-returned dict → ProductEffectProfile,
eliminating Pydantic serializer warning
- Update all tests to use routes without trailing slash
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FastAPI backend for personal health and skincare data with MCP export.
Includes SQLModel models for products, inventory, medications, lab results,
routines, and skin condition snapshots. Pytest suite with 111 tests running
on SQLite in-memory (no PostgreSQL required).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>