Commit Graph

12 Commits

Author SHA1 Message Date
giles
63778d9f20 Fix cart quantities not showing on product list after page refresh
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
The context processor loaded cart items but only passed aggregates
(cart_count, cart_total) — not the cart list itself. Templates need
the full list to display per-product quantities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:40:48 +00:00
giles
28938e38b5 Fix cart count: query DB directly instead of cross-app API
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 42s
Two bugs fixed:

1. First htmx add didn't update mini cart count because the context
   processor's API call couldn't see the uncommitted transaction.
   Fix: pass cart_count/cart_total explicitly from the route handler.

2. Page refresh always showed cart count 0 because the internal API
   call to the cart service failed to resolve cart identity correctly.
   Fix: replace the API call with a direct DB query using the same
   shared database and session, matching how the cart app itself works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:39:43 +00:00
giles
f81d6803d4 Add glue layer: replace /internal/menu-items API with direct DB query
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 46s
- Context processor: get_navigation_tree() replaces api_get("coop", "/internal/menu-items")
- Add glue submodule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:37:47 +00:00
giles
478636f799 feat: decouple market from shared_lib, add app-owned models
Phase 1-3 of decoupling:
- path_setup.py adds project root to sys.path
- Market-owned models in market/models/ (market, market_place)
- All imports updated: shared.infrastructure, shared.db, shared.browser, etc.
- MarketPlace uses container_type/container_id instead of post_id FK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:46:32 +00:00
giles
b8f57ef92f fix: register cart loader so g.cart is available for product cart route
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 35s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:52:29 +00:00
giles
2788e24ec8 fix: inject post data into template context for post header row
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 36s
The post header bar needs `post` in the template context to render
the page link, feature image, and nav. Added context processor to
spread g.post_data into templates, matching the events app pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:12:35 +00:00
giles
98abe5a0de fix: rename post slug URL param to page_slug to avoid collision
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s
The market blueprint already uses <slug> for product routes,
so the app-level prefix uses <page_slug> instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:20:49 +00:00
giles
6202b31e8e fix: nest market blueprint under post slug /<slug>/<market_slug>/
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
Market app now follows the events app pattern — URLs include
the post slug prefix (e.g. /market/suma-market/). Hydrate
loads both post and market, verifying market belongs to post.
Scraper default URLs updated accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:15:45 +00:00
giles
33a30bef06 fix: remove duplicate market_slug in blueprint registration
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 41s
The url_prefix was being set both in register_market_bp() and
app.register_blueprint(), causing a SyntaxError from duplicate
route parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:26:26 +00:00
giles
9b2687b039 feat: restructure market app with per-market URL scoping
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 41s
- URL structure changes from /<route> to /<market_slug>/<route>
- Root / shows markets listing page
- app.py: url_value_preprocessor, url_defaults, hydrate_market (events app pattern)
- Browse queries (db_nav, db_products_nocounts, db_products_counts) accept market_id
- _productInfo reads g.market.id to scope all queries
- save_nav accepts market_id, sets on new NavTop rows
- API save_nav passes g.market.id
- Scraper default URLs point to /suma-market/ on port 8001

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:08:48 +00:00
giles
dc7c989834 feat: add shared library as git submodule
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:41:50 +00:00
giles
6271a715a1 feat: initialize market app with browsing, product, and scraping code
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Split from coop monolith. Includes:
- Market/browse/product blueprints
- Product sync API
- Suma scraping pipeline
- Templates for market, browse, and product views
- Dockerfile and CI workflow for independent deployment
2026-02-09 23:16:34 +00:00