Follow users: pill in detail view + glass pill on profile
Created by: jedmund
Summary
- Adds
/v1/user/follow/addand/v1/user/follow/deletetoPixivEndpointand a sharedFollowStateobservable + two button variants (FollowPillButton,FloatingFollowPill). - Detail view: Follow pill sits at the trailing end of the metadata card's user row, paired with a compact 38pt share icon (both on
secondarySystemBackground, explicitColor(.label)glyph). The old full-width bottom share button is gone — share lives inline with the user it belongs to. - Profile view (pushed): glass Follow pill in the floating chrome's trailing slot, so it scrolls with the user sibling-to the back chevron. Hidden while
userDetailhasn't resolved, and fully suppressed forisCurrentUser.
IllustDetailViewController fetches .userDetail(userID:) per current item to resolve is_followed, cancels the in-flight fetch on swipe-page, and does optimistic toggle + rollback on failure. ProfileView seeds the state from the detail it already fetches and resets to .unknown on pull-to-refresh.
Test plan
-
Open a detail from Home → tap Follow → pill flips to "Following" with a plus→checkmark morph -
Tap Following → pill flips back to Follow; confirm the real Pixiv state persists across app relaunch -
Swipe-page in detail while follow POST is in flight — state snaps to the new author without clobbering on late response -
Push profile (tap user row in detail) → glass Follow pill appears top-trailing once header loads, and scrolls with chrome -
Follow / unfollow on profile → persists after popping back to detail (next detail open re-fetches) -
Open your own profile via Bookmarks tab → Follow pill is not shown -
Kill network mid-POST → button rolls back; confirm no visual flash before the revert -
Dark mode: both follow pill and share icon render with white glyphs, no blue tint -
Tap share icon → standard iOS share sheet with https://www.pixiv.net/en/artworks/<id>