Commit Graph

17 Commits

Author SHA1 Message Date
giles
05cba16cef Fix category highlighting and revert current_local_href breakage
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
- Update shared submodule: category selector uses slug comparison
  instead of current_local_href for active state
- Keep current_local_href commented out in category_context() to
  avoid overriding the base template value used by brand filters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:29:06 +00:00
giles
1aa3659bb8 Uncomment current_local_href in category_context for subcategory highlighting
The category selector compares current_local_href against sub.local_href
to determine the active subcategory. This was commented out, so no
subcategory was ever highlighted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:17:12 +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
8c2358022a Fix undefined calendar_total/calendar_cart_entries in product cart template
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 40s
The _added.html template's summary macro expects calendar_total and
calendar_cart_entries from the cart/events domain. The market app has
no calendar entries, so pass a no-op function and empty list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:15:07 +00:00
giles
44f475857b Fix AttributeError on g.cart in product cart route
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 42s
g.cart was never populated in the market app — the cart loader
before_request hook was only registered in the cart microservice.
Replace the dead filter-building code with an actual query that
loads cart items inline, scoped to the current user/session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:11:49 +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
fd205b9b61 fix: inject post data via blueprint context processor
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 33s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:17:13 +00:00
giles
863429d51b fix: add post header bar to market pages and show market name
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 36s
- Add post header row to market/index.html template chain
- Fix OOB templates to include post header on HTMX navigation
- Show market name instead of static coop_title in header
- Restore trailing slash on POST /cart/ route; fix templates to
  include trailing slash in cart URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:55:16 +00:00
giles
93e1e6d41e fix: remove trailing slash from POST /cart route
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s
Templates generate URLs without trailing slash via market_url(), but
the route required one. POST requests don't get redirected by Werkzeug,
causing a 405 MethodNotAllowed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:52:25 +00:00
giles
6a378a2425 fix: use cart_url() instead of url_for('cart.view_cart') for cross-app redirect
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s
The market app doesn't have a cart blueprint registered, so url_for()
would fail. Uses the cross-app cart_url() helper instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:45:54 +00:00
giles
ce1847e06c feat: set market_place_id on CartItem when adding to cart (Phase 3)
Track which market a cart item came from by setting market_place_id
from g.market.id on new CartItem creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:49:37 +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
88c38c0e74 fix: add cart identity stub for product blueprint
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 40s
Product routes lazily import current_cart_identity from cart.services.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 01:18:53 +00:00
giles
efe769a0fc fix: add cart services stub for product blueprint dependency
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Product routes import total() from cart.services — provide a minimal
copy so the market image can start independently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 01:16:00 +00:00
giles
601a696ecb fix: add register_product to bp/__init__.py (needed by browse)
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-10 00:34:39 +00:00
giles
e737a953a6 fix: add proper register_market_bp export to bp/__init__.py
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-10 00:28:46 +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