diff --git a/web/scripts/render-diagram.test.mjs b/web/scripts/render-diagram.test.mjs index dab241d..1b850dd 100644 --- a/web/scripts/render-diagram.test.mjs +++ b/web/scripts/render-diagram.test.mjs @@ -63,8 +63,13 @@ describe("the committed architecture.svg", () => { assert.ok(!/]*\swidth=/.test(svg)); }); + // `outsideNode` is deliberately not in this list. It used to give the + // services outside the browser a dashed border, but the diagram now draws + // that boundary with subgraphs instead and applies no such class. The rule + // survives in global.css so re-adding `class … outsideNode` to the source + // starts working again without a second change. it("keeps the class hooks global.css styles it through", () => { - for (const cls of ["node", "cluster", "flowchart-link", "arrowMarkerPath", "outsideNode"]) { + for (const cls of ["node", "cluster", "flowchart-link", "arrowMarkerPath"]) { assert.ok(svg.includes(cls), `architecture.svg has no ${cls} to style`); } }); diff --git a/web/src/diagrams/architecture.mmd b/web/src/diagrams/architecture.mmd index c7fcf80..ba06518 100644 --- a/web/src/diagrams/architecture.mmd +++ b/web/src/diagrams/architecture.mmd @@ -19,40 +19,52 @@ flowchart LR } subgraph browser["your browser"] direction TB - subgraph page["the page you are viewing"] - content["content script
src/content.ts
reads two link tags"] + subgraph page["current tab"] + content["page contents"] + metadata["site metadata"] end subgraph ext["the substandard extension"] direction TB - worker["background worker
src/background.ts
per-tab state, toolbar badge"] - popup["popup
src/popup/
cards and actions"] - offscreen["offscreen document
src/offscreen/
hosts the OAuth client"] + popup["extension\nbadge and\npopup"] + worker["background worker"] end end - subgraph outside["everything else, contacted directly"] - site["the site you are on
/.well-known/
site.standard.publication"] - identity["plc.directory
public.api.bsky.app
bsky.social"] - pubpds["the publication's PDS
and other PDSes"] - ownpds["your PDS"] - constellation["Constellation
constellation.microcosm.blue"] - labelers["the labelers your
account subscribes to"] + subgraph outside["other sites"] + ecosystem["Public ecosystem APIs"] + + subgraph pds["atproto PDSes"] + pubpds["the publication's PDS"] + ownpds["your PDS"] + end end - content -- "page-hints: the at:// URIs
in the page's link tags" --> worker - popup -- "get-state, signin, follows" --> worker - worker -- "oauth-authorize,
oauth-callback" --> offscreen + worker -- "check page for articles" --> content + worker -- "check site for pubs" --> metadata + + worker -- "enrich with\npublic metadata" --> ecosystem + worker -- "show notifications" --> popup + popup -- "Atmosphere\nlogin flow" --> ownpds + popup -- "Atmosphere\nlogin storage" --> worker + + worker -- "get data about\npublication and\npublisher" --> pubpds + worker -- "update your\nsubscriptions" --> ownpds + + + %% content -- "page-hints: the at:// URIs
in the page's link tags" --> worker + %% popup -- "get-state, signin, follows" --> worker + %% worker -- "oauth-authorize,
oauth-callback" --> offscreen - worker -- "GET, no cookies,
8 KB cap" --> site - worker -- "resolve DIDs
and handles" --> identity - worker -- "read publication
and document records" --> pubpds - worker -- "read your subscriptions,
blocks and follows" --> ownpds + %% worker -- "GET, no cookies,
8 KB cap" --> site + %% worker -- "resolve DIDs
and handles" --> identity + %% worker -- "read publication
and document records" --> pubpds + %% worker -- "read your subscriptions,
blocks and follows" --> ownpds - popup -- "owner profile,
avatar blobs" --> pubpds - popup -- "who else subscribes
to this publication" --> constellation - popup -- "labels on this
publication" --> labelers - popup -- "write or delete a
subscription record" --> ownpds - offscreen -- "OAuth: authorize,
token, revoke" --> ownpds + %% popup -- "owner profile,
avatar blobs" --> pubpds + %% popup -- "who else subscribes
to this publication" --> constellation + %% popup -- "labels on this
publication" --> labelers + %% popup -- "write or delete a
subscription record" --> ownpds + %% offscreen -- "OAuth: authorize,
token, revoke" --> ownpds - classDef outsideNode fill:none - class site,identity,pubpds,ownpds,constellation,labelers outsideNode + %% classDef outsideNode fill:none + %% class site,identity,pubpds,ownpds,constellation,labelers outsideNode diff --git a/web/src/diagrams/architecture.svg b/web/src/diagrams/architecture.svg index 01f49fd..f9860c4 100644 --- a/web/src/diagrams/architecture.svg +++ b/web/src/diagrams/architecture.svg @@ -1,8 +1,8 @@ -substandard extension components and the calls between themA content script in the page reports the page's standard.site link tags to +substandard extension components and the calls between themA content script in the page reports the page's standard.site link tags to the extension's background worker. The worker keeps per-tab state and the toolbar badge, probes the visited site's well-known path, resolves DIDs and handles, and reads publication, document and account records from PDSes. The popup reads owner profiles, subscriber counts from Constellation and moderation labels from labelers, and writes subscription records to the signed-in account's PDS. An offscreen document hosts the OAuth client and -talks to that same PDS to authorize, refresh and revoke tokens.everything else, contacted directlyGET, no cookies,8 KB capresolve DIDsand handlesread publicationand document recordsread your subscriptions,blocks and followsowner profile,avatar blobswho else subscribesto this publicationlabels on thispublicationwrite or delete asubscription recordOAuth: authorize,token, revokeyour browserthe page you are viewingpage-hints: the at:// URIsin the page's link tagsthe substandard extensionget-state, signin, followsoauth-authorize,oauth-callbackbackground workersrc/background.tsper-tab state, toolbar badgepopupsrc/popup/cards and actionsoffscreen documentsrc/offscreen/hosts the OAuth clientcontent scriptsrc/content.tsreads two link tagsthe site you are on/.well-known/site.standard.publicationplc.directorypublic.api.bsky.appbsky.socialthe publication's PDSand other PDSesyour PDSConstellationconstellation.microcosm.bluethe labelers youraccount subscribes to +talks to that same PDS to authorize, refresh and revoke tokens.other sitesatproto PDSesenrich withpublic metadataAtmospherelogin flowget data aboutpublication andpublisherupdate yoursubscriptionsyour browsercurrent tabcheck page for articlescheck site for pubsthe substandard extensionshow notificationsAtmospherelogin storageextensionbadge andpopupbackground workerpage contentssite metadataPublic ecosystem APIsthe publication's PDSyour PDS