Eliminate Python page helpers from account, federation, and cart
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m8s

All three services now fetch page data via (service ...) IO primitives
in .sx defpages instead of Python middleman functions.

- Account: newsletters-data → AccountPageService.newsletters_data
- Federation: 8 page helpers → FederationPageService methods
  (timeline, compose, search, following, followers, notifications)
- Cart: 4 page helpers → CartPageService methods
  (overview, page-cart, admin, payments)
- Serializers moved to service modules, thin delegates kept for routes
- ~520 lines of Python page helpers removed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 02:01:50 +00:00
parent fb8f115acb
commit 418ac9424f
12 changed files with 520 additions and 521 deletions

View File

@@ -1,49 +1,82 @@
;; Federation social pages
;; All data fetching via (service ...) IO primitives, no Python helpers.
(defpage home-timeline
:path "/social/"
:auth :login
:layout :social
:content (home-timeline-content))
:data (service "federation-page" "home-timeline-data")
:content (~federation-timeline-content
:items items
:timeline-type timeline-type
:actor actor))
(defpage public-timeline
:path "/social/public"
:auth :public
:layout :social
:content (public-timeline-content))
:data (service "federation-page" "public-timeline-data")
:content (~federation-timeline-content
:items items
:timeline-type timeline-type
:actor actor))
(defpage compose-form
:path "/social/compose"
:auth :login
:layout :social
:content (compose-content))
:data (service "federation-page" "compose-data")
:content (~federation-compose-content
:reply-to reply-to))
(defpage search
:path "/social/search"
:auth :public
:layout :social
:content (search-content))
:data (service "federation-page" "search-data")
:content (~federation-search-content
:query query
:actors actors
:total total
:followed-urls followed-urls
:actor actor))
(defpage following-list
:path "/social/following"
:auth :login
:layout :social
:content (following-content))
:data (service "federation-page" "following-data")
:content (~federation-following-content
:actors actors
:total total
:actor actor))
(defpage followers-list
:path "/social/followers"
:auth :login
:layout :social
:content (followers-content))
:data (service "federation-page" "followers-data")
:content (~federation-followers-content
:actors actors
:total total
:followed-urls followed-urls
:actor actor))
(defpage actor-timeline
:path "/social/actor/<int:id>"
:auth :public
:layout :social
:content (actor-timeline-content id))
:data (service "federation-page" "actor-timeline-data" :id id)
:content (~federation-actor-timeline-content
:remote-actor remote-actor
:items items
:is-following is-following
:actor actor))
(defpage notifications
:path "/social/notifications"
:auth :login
:layout :social
:content (notifications-content))
:data (service "federation-page" "notifications-data")
:content (~federation-notifications-content
:notifications notifications))