Wire the client to PrivaPub: one sign-in, real feeds, a globe, nerd stats

One sign-in for both of PrivaPub's APIs: the root logs in on /clientapi,
picks a persona, and each persona gets its own Mastodon token in
exchange for the JWT (PersonaExchange). HttpService picks credentials
and JSON by route (JWT and camelCase for /clientapi, the persona token
and snake_case for /api, nothing for /oauth), retries a refused persona
token once, and records every request for the nerd stats.

The feed page is three columns: navigation with a persona switcher, the
feed with a tab per kind (home, local, federated, nearby, communities
and circles, direct, notifications, favourites, bookmarks, hashtags),
and a 3D globe that looks at the spherical mean of the posts in view
and draws a pulse and an arc to a hovered one. Posts sit at their own
place, their event's venue, the reader (located posts) or their
author's server as PrivaPub publishes it. Cards favourite, boost,
bookmark, reply, mute, block and delete; the composer posts with a
content warning, visibility, media and alt text, or as a located post.
Older pages load as the end nears; newer ones are polled while visible.
Nerd stats in tooltips: provenance, author and server, place, media,
counts, paging, the globe's camera and frame rate.

The mock (Faker, MessagesService, the Message models and store) and the
OIDC template leftovers are gone. Strings in English and Italian.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-04 11:03:14 +02:00
1 parent f41ebf2160
commit 827ecb770e
56 files changed
+5367 -832

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
// The feed page's scrolling (Pages/Index.razor): tells .NET when the end of the list comes near, so the next page loads
// before the reader gets there, and whether the page is visible, so polling for new posts stops in a hidden tab.
let observer = null
let sentinel = null
let reference = null
export function observeEnd(dotNetReference, sentinelId, rootId) {
dispose()
reference = dotNetReference
sentinel = document.getElementById(sentinelId)
const root = document.getElementById(rootId)
if (!sentinel || !root)
return
observer = new IntersectionObserver(entries => {
if (entries.some(entry => entry.isIntersecting))
nearEnd()
}, { root, rootMargin: "0px 0px 800px 0px" })
observer.observe(sentinel)
}
// After a page is added: if the end is still in sight (a short page), ask for the next one too.
export function checkEnd() {
if (!sentinel || !observer)
return
const root = observer.root
const end = sentinel.getBoundingClientRect().top
const bottom = root.getBoundingClientRect().bottom
if (end < bottom + 800)
nearEnd()
}
export function isVisible() {
return document.visibilityState === "visible"
}
export function scrollToTop(rootId) {
document.getElementById(rootId)?.scrollTo({ top: 0, behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" })
}
export function dispose() {
observer?.disconnect()
observer = null
sentinel = null
reference = null
}
function nearEnd() {
reference?.invokeMethodAsync("NearEnd").catch(e => console.error(e))
}