Commit Graph

38 Commits

Author SHA1 Message Date
giles
1a8a5f4487 Store cross-app cart_sid on login for cart adoption
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 58s
Read cart_sid from query params on login page and save to session
so the verify route can emit adoption event with the correct session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:46:27 +00:00
giles
9182c8d0b5 Switch to unified AP activity bus
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m5s
emit_event → emit_activity for login event. Update shared submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:20:11 +00:00
giles
5e9ab507be Tech debt cleanup: update README, fix comments, sync shared submodule
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m21s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:35:47 +00:00
giles
36c33d9ce2 Use full post body in AP notes, not just excerpt
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 54s
Federated content has no character limit — use the complete plaintext
body so followers see the full post in their timeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 09:40:19 +00:00
giles
4c44fc64c5 Enrich AP posts: Note type, images, hashtags, HTML excerpt
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
- Switch object type from Article to Note (Mastodon first-class support)
- Include title + excerpt as HTML content with "Read more" link
- Feature image + up to 3 inline images as AP attachments
- Post tags as AP Hashtag objects with inline links in content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 09:35:40 +00:00
giles
fe3bc9d893 Inline federation publication in ghost_sync
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m2s
Replace emit_event("post.published/updated/unpublished") with direct
try_publish() calls. AP activities are now created at write time,
fixing the race condition where multiple EventProcessors competed
for federation events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 07:55:48 +00:00
giles
ceacf7a56e Fix _upsert_post to return (post, old_status) tuple
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m25s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 23:40:27 +00:00
giles
0d18fd8fd9 Track status changes for unpublish + edit federation events
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m0s
- _upsert_post returns (post, old_status) to detect status transitions
- Emit post.unpublished when published→draft (triggers Delete activity)
- Emit post.updated only when already-published posts are edited
- Emit post.published only for new publishes (not re-syncs)
- Same logic for pages via sync_single_page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 23:27:04 +00:00
giles
507200893d Fix _upsert_post savepoint: add() inside begin_nested()
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s
begin_nested() auto-flushes on entry which triggers the INSERT before
the savepoint is active. Move sess.add() inside the savepoint block
and split into update vs insert paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:59:54 +00:00
giles
9d6a458115 Wire real FederationService + add page federation events
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m2s
- Blog app now registers SqlFederationService (was stub/no-op)
- sync_single_page emits post.published/updated events for pages
- Updated shared submodule: fix sign_request in AP delivery handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:52:36 +00:00
giles
80e4f21b0b Fix page creation labels and webhook race condition
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 56s
- Updated shared submodule: page-aware blog_new template labels
- _upsert_post: handle concurrent webhook INSERTs via savepoint + retry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:32:05 +00:00
giles
954b6cc06a Set page flag in sync_single_page to ensure is_page=true
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 56s
Ghost /pages/ endpoint may not include "page": true in the response.
Explicitly set it so _upsert_post correctly marks is_page=true.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:23:19 +00:00
giles
23fe8c233e Fix page editing: use Ghost /pages/ API for pages, not /posts/
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 56s
Ghost has separate /posts/ and /pages/ endpoints. All admin functions
(get_post_for_edit, update_post, update_post_settings, sync) were
hardcoded to /posts/, causing 404s when editing pages. Now checks
is_page from post_data and uses the correct endpoint.

Also uses sync_single_page (not sync_single_post) after page saves
to prevent IntegrityError from mismatched fetch/upsert paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 22:03:41 +00:00
giles
53dff0d41b Update shared submodule + emit post events for federation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m18s
- Emit post.published/post.updated events from Ghost webhook sync
- Updated shared with federation handlers, delivery, anchoring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:59:53 +00:00
giles
a8e0d8f257 Decoupling audit: remove coop_api, fix blog admin calendar imports
Some checks are pending
Build and Deploy / build-and-deploy (push) Waiting to run
- Delete coop_api.py (dead internal API endpoint)
- Replace cross-app calendar imports with shared service calls
- Update shared submodule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:15:23 +00:00
giles
2dc9bf220b Include ticket counts in cart badge totals
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:01:27 +00:00
giles
89112d0cec Fix indentation error in except block
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 53s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 20:01:20 +00:00
giles
5c203cb99c Fix: update local _nav.html to use widget-driven nav
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m5s
The blog app's local templates/_types/post/_nav.html was shadowing
the shared version due to ChoiceLoader priority. Updated local copy
to use container_nav_widgets while keeping the blog-specific admin
cog link. Removed debug logging from context processor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:57:30 +00:00
giles
7ec38b87f8 Add widget debug logging to post context processor
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:29:07 +00:00
giles
8af7c69090 Decouple blog UI via widget registry
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 54s
Replace explicit calendar/market service calls in post routes, auth
routes, and listing cards with widget-driven iteration. Zero cross-domain
imports remain in blog bp layer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 18:04:26 +00:00
giles
909ae0e2d6 Add tickets & bookings account sub-pages
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 46s
New GET /auth/tickets/ and /auth/bookings/ routes with HTMX support.
Update shared submodule with TicketDTO, service methods, nav links,
and panel templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:06:30 +00:00
giles
f9e39333bf Replace direct MarketPlace imports with MarketService calls
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 51s
Market CRUD in blog now delegates to services.market.create_marketplace()
and soft_delete_marketplace() instead of importing MarketPlace directly.
Adds TODO comments on Calendar imports in admin routes (deferred to
admin UI rework). Updates shared submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 05:57:54 +00:00
giles
4155df7e7c Domain isolation: replace cross-domain imports with service calls
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
Replace direct Calendar, MarketPlace, and Post model queries with typed
service calls (services.blog, services.calendar, services.market,
services.cart). Blog registers all 4 services via domain_services_fn
with has() guards for composable deployment.

Key changes:
- app.py: use domain_services_fn instead of inline service registration
- admin routes: MarketPlace queries → services.market.marketplaces_for_container()
- entry_associations: CalendarEntryPost → services.calendar.entry_ids_for_content()
- markets service: Post query → services.blog.get_post_by_id/slug()
- posts_data, post routes: use calendar/market/cart services
- menu_items: glue imports → shared imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 04:30:14 +00:00
giles
c537770172 Decouple blog: use shared.models for all cross-app imports
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 47s
- Replace all imports from cart.models, market.models, events.models
  with shared.models equivalents
- Convert blog/models/ghost_content.py to re-export stub
- Update shared + glue submodule pointers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:57:56 +00:00
giles
dd7fbc89ce Add HTML email templates for magic link sign-in
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
Extract inline email body into separate Jinja2 templates
(_email/magic_link.html and .txt) with a styled sign-in
button and fallback plain-text link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:09:49 +00:00
giles
a24e5c6407 Phase 5: Replace HTTP cart adoption with event-driven adoption
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
Emit user.logged_in event instead of HTTP POST to /internal/cart/adopt.
Event is emitted inside the last_login_at transaction for atomicity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 17:35:55 +00:00
giles
75a5d520e8 Add attach/detach glue calls to menu items, markets, and page config CRUD
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
Wire up ContainerRelation tracking via attach_child/detach_child in:
- menu_items: create, update (re-link on post change), delete
- markets: create (including revive), soft_delete
- page config: creation in update_features and update_sumup routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:52:12 +00:00
giles
05d9e70e8a Add glue layer: MenuNode replaces MenuItem, remove /internal/menu-items API
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m4s
- Context processor: get_navigation_tree() replaces get_all_menu_items()
- Menu admin service: MenuItem → MenuNode (container_type/container_id pattern)
- Remove /internal/menu-items endpoint (other apps query menu_nodes directly)
- Remove menu_items relationship from Post model
- Templates: item.post.X → item.X
- Add glue submodule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:37:43 +00:00
giles
a01016d8d5 feat: decouple blog from shared_lib, add app-owned models
Phase 1-3 of decoupling:
- path_setup.py adds project root to sys.path
- Blog-owned models in blog/models/ (ghost_content, snippet, tag_group)
- Re-export shims for shared models (user, kv, magic_link, menu_item)
- All imports updated: shared.infrastructure, shared.db, shared.browser, etc.
- No more cross-app post_id FKs in calendar/market/page_config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:46:31 +00:00
giles
8fad1ecc7d fix: auto-create PageConfig when enabling page features
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 36s
When toggling market/calendar features or saving SumUp settings,
create a PageConfig row if one doesn't exist yet instead of returning
a 404 error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:34:18 +00:00
giles
6bb520cb0a feat: show page cart badge in blog post header (Phase 4)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 41s
Fetches page-scoped cart count from /internal/cart/summary?page_slug=
for page posts and displays a cart icon with count in the post header
that links to the page cart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:45:41 +00:00
giles
d859be217a feat: per-page SumUp admin UI and update_sumup route (Phase 3)
- Replace SumUp placeholder with real form for merchant code, API key, prefix
- Add PUT /admin/sumup/ route to save per-page SumUp credentials
- Pass sumup_configured/merchant_code/checkout_prefix to template context
- SumUp form only shown when calendar or market feature is enabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:49:30 +00:00
giles
3376e4e990 feat: show markets in post nav bar and admin panel
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 38s
- Post context processor loads MarketPlace rows for the page
- Nav bar displays market links (shopping-bag icon) alongside calendars
- Admin panel includes markets CRUD when market feature is enabled
- Updated shared_lib submodule with nav_entries template change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:37:06 +00:00
giles
24d3860952 feat: add page admin market CRUD and update shared_lib
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
- Market create/delete routes in post admin blueprint
- markets.py service (create_market, soft_delete_market)
- _markets_panel.html admin template with HTMX create/delete
- Update shared_lib submodule (MarketPlace model, migration, URLs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:08:32 +00:00
giles
632df29356 fix: add missing template variables for pages listing context
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 35s
The shared sidebar/filter templates expect selected_groups, tags, authors
etc. Provide empty defaults when rendering the pages view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:38:00 +00:00
giles
8b6320619e feat: implement Pages as Spaces Phase 1
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
- Add PageConfig model with feature flags (calendar, market)
- Auto-create PageConfig on Ghost page sync
- Add create_page() for Ghost /pages/ API endpoint
- Add /new-page/ route for creating pages
- Add ?type=pages blog filter with Posts|Pages tab toggle
- Add list_pages() to DBClient with PageConfig eager loading
- Add PUT /<slug>/admin/features/ route for feature toggles
- Add feature badges (calendar, market) on page cards
- Add features panel to page admin dashboard
- Update shared_lib submodule with PageConfig model

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:25:34 +00:00
giles
1d4a026f4d fix: add bp/__init__.py with register function exports
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:40 +00:00
giles
8f7a15186c feat: initialize blog app with blueprints and templates
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Extract blog-specific code from the coop monolith into a standalone
repository. Includes auth, blog, post, admin, menu_items, snippets
blueprints, associated templates, Dockerfile (APP_MODULE=app:app),
entrypoint, and Gitea CI workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:15:56 +00:00