User profiles, settings sheet, and detail view fixes
Created by: jedmund
Summary
-
User profiles: Rewrites
ProfileViewfrom a static info screen into a full profile with avatar, bio, stats, and a masonry grid of the user's illustrations. Current user sees a Works/Bookmarks segmented picker; bookmark visibility (public/private) is a toolbar filter menu. Other users' profiles show works only. -
Settings sheet: Moves R-18 toggle and sign-out into a
SettingsSheetpresented from a gear toolbar button. Adds portrait/landscape grid column pickers (2–6 range) thatMasonryFeedreads via@AppStorage. -
Cross-user navigation:
ProfileDestinationregistered on every tab'sNavigationStackso tapping an artist name in the detail view or any feed pushes to their profile. -
Detail carousel fix: Multi-page illusts now render each page at its own natural aspect ratio (
.fit) instead of forcing all pages into the first page's ratio and clipping.
New files
-
PixivUserDetail.swift— DTO for/v1/user/detail -
ProfileHeaderView.swift— avatar, name, handle, bio, stat counts -
SettingsSheet.swift— account info, R-18 toggle, column settings, sign-out -
ProfileDestination.swift—Hashablevalue for navigation path
Modified files
-
PixivEndpoint.swift—.userIllusts,.userBookmarks+BookmarkRestrict -
ProfileView.swift— full rewrite with masonry feeds -
MainTabView.swift— passesuserID/apitoProfileView,.profileNavigation()modifier -
IllustDetailView.swift— per-page aspect ratio in carousel, artist row links to profile -
MasonryFeed.swift— reads column counts from@AppStorage -
AppSettings.swift—portraitColumns/landscapeColumnskeys
Test plan
-
Sign in → Profile tab loads with avatar, bio, illustration grid -
Tap gear → Settings sheet with account info, column pickers, R-18 toggle, sign-out -
Switch to Bookmarks tab → grid loads; filter icon appears; toggle public/private reloads -
Change column count in settings → grids across all tabs update -
Tap artist name in detail view → pushes to their profile (works only, no segmented control) -
Multi-page illust detail → each page renders at its own aspect ratio, no cropping -
Pull-to-refresh on profile reloads header and current feed