Start in src/skyloom/. The application uses native GTK 4/libadwaita widgets;
demo.py supplies an offline service with invented data.
| Area | Entry points |
|---|---|
| Application and navigation | application.py, window.py, navigation.py |
| Shared lists and post cells | widgets.py, list_state.py, list_interaction.py |
| Conversations | conversation.py, conversation_view.py, thread_context.py, thread_prefetch.py |
| Feed loading and reading position | pagination.py, feed_coordination.py, reading.py |
| Keyboard and gestures | keyboard.py, interactions.py |
| Immutable records and text | domain.py, richtext.py |
| AT Protocol and authentication | service.py, sdk.py, network.py, credentials.py |
| Profile editing and people lists | profile_service.py, profile_editor.py, people_view.py |
| Private bookmarks | bookmark_service.py, bookmark_view.py |
| Reply and quote controls | thread_service.py, thread_controls.py |
| Video playback and preparation/upload | video_player.py, video_stream.py, video_upload.py |
| Background work | worker.py, request_scope.py |
| Drafts and local data | composer.py, storage.py |
| Images | media.py |
| Refresh and connection policy | refresh.py, refresh_monitor.py |
GTK runs on the main thread. The worker owns the asyncio loop and sends completions back through GLib. When tracing a stale result, follow its request scope, page lifetime and account generation from submission to completion.
The SDK request hook checks HTTPS on every hop. For procedures, it carries the
original host and port through the redirect chain, including redirects that
change the HTTP method. Repository reads recognise the named RecordNotFound
error when the PDS returns HTTP 400.
sdk.py uses atproto's public model serializer, including its unknown-record
fallback, and the 0.0.74 typed page-item interface. Adapters convert one fetched
page into immutable app records; native pagers retain responsibility for bounded
windows, reading positions, repeated cursors and request cancellation. Notification
mapping reads typed fields directly and avoids serialising unused post records.
Live post and record pagers keep 150 items, leaving space for gap/footer rows below the supported GTK runtime's 200-widget list tracker budget. This avoids repeated median-height estimation and large batches of rebinding in mixed-height feeds. Photo/video shape and preview sizes are unchanged. Archived history and real-cursor paging remain separate from this active widget window. Older saved 250-post windows are narrowed around their bookmark on the worker; archived page starts recover the exact tail continuation. If a legacy window has no safe real boundary, its readable data is preserved until normal feed reconciliation can supply one.
Home normally keeps two recently visited native feed views. The limit rises to three with at least 12 GiB total and 2 GiB available, or four with at least 24 GiB total and 4 GiB available. Below 512 MiB available only the active view is kept. A worker samples Linux memory at startup and on feed visits or refreshes, at most once every 30 seconds. Missing readings use the two-view default. GIO memory warnings reduce the limit to two at low pressure or one at medium pressure and above. A two-minute cooldown delays growth after a warning or a drop in headroom. Extra slots are filled by visiting feeds.
Retiring a view cancels its requests, releases its list factories and disconnects the callbacks owned by the retired view and cells. Each saved feed keeps its logical pager and reading session, so returning to it restores its bookmark even if its SQLite checkpoint is still in flight.
On startup, a saved position below the feed head restores behind the opaque loading screen. The list stays mapped for virtualized layout and adjustment correction. Once the position settles and a frame can paint underneath, the loading screen fades away, followed by the feed selector. Motion preferences apply to both transitions.
For scrolling issues, start with the shared list and reading-position code; conversations also have their own projection and loader handling. Use the profiling guide for measurements.
Own and other profiles share one adaptive identity/actions row. Actions sit beside the name and handle when space permits and wrap within the header on narrow pages.
confirmed.py retains only successful writes for two minutes, scoped to the
exact signed-in session object and bounded to 2,000 records. Profile and
relationship fields, reactions and notification cutoffs have independent expiry;
reads never renew them. Service reads reconcile these facts across profiles,
feeds, search, people, notifications, nested quotes and cached content. Mutations
still validate the exact supplied record URI and ownership before deleting it.
Account replacement or sign-out drops these in-memory confirmations.
Profile edits return the submitted name/description and prepared local images without a dependent AppView read. Immutable author flags distinguish trusted prepared images from remote URLs; API mapping cannot supply those flags. The current profile also retains its prepared banner across view replacement.
A successful publish retains its returned URI/CID and submitted text, facets, media and reply/quote references until indexing catches up. Missing posts are added only to the Following head, the matching author's compatible profile head, and threads containing their parent. Indexed records win; tail pages and custom feeds do not receive invented membership. Deleting a post removes its pending publication. Draft cleanup failures cannot turn successful publishing into an invitation to retry.
Notification reads apply the confirmed seen timestamp only to older records.
Unread-count requests pass the SDK's explicit seen_at cutoff, allowing newer
notifications to remain unread. The Notifications view reapplies the confirmed
cutoff when it displays a staged refresh. No mutation is automatically retried.
Account databases and prepared uploads live in $XDG_DATA_HOME/skyloom;
encoded images live in $XDG_CACHE_HOME/skyloom. Under Flatpak these normally
resolve beneath ~/.var/app/com.nedrichards.Skyloom/data/ and cache/.
Tokens live in the login keyring; preferences use GSettings.
Sign-out invalidates the account storage lease and keeps that lease eligible
to retry cleanup. Skyloom removes the saved session after local cleanup, so a
filesystem error leaves a saved session available after restart.
Deleted-post tombstones are account-local and prevent stale cached/network responses restoring deleted content. Storage commits the tombstone before rewriting archived posts and quotes. If SQLite cannot commit it, the running process retains the deletion and retries local cleanup on later reads. If the app exits after committing the tombstone but before finishing the cache rewrite, reads still hide the content. Older payload bytes can remain on disk until cache eviction or sign-out. Bookmarks use Bluesky's private service, separate from the local feed reading-position bookmarks. Thread/post gate writes preserve unrelated fields and compare record versions; separate reply and quote saves make partial failures explicit.
Video playback uses GStreamer URI decoding through a Gtk.MediaStream and
Gtk.Video controls. Feed rows show the supplied thumbnail using the shared
image download policy and bounded cache. Missing or failed thumbnails keep a
playable fallback card. Thumbnail downloads accept the exact HTTPS
video.bsky.app/watch/…/thumbnail.jpg and
video.cdn.bsky.app/hls/…/thumbnail.jpg routes. At most two redirect hops are
followed, validating each target before fetching; unrelated hosts, credentials,
nonstandard ports, HTTP and video playlists are rejected. Photo-CDN redirects
remain disabled. The original thumbnail URL remains the memory/disk cache key.
An explicit play action replaces the
preview with inline controls, retaining its aspect-aware rectangle. Only one
player owns a pipeline; row unmap/recycling, another play action or account
replacement releases it. Inline players keep up to 32 seek positions in memory
for the active account generation. An explicit resume seeks once the stream is
prepared; finishing the video clears its position. Errors offer an explicit retry.
The dialog player remains available to other callers. The Flatpak audio socket
enables sound.
Video preparation runs under the account storage lease on a worker, validates
MP4/H.264/AAC, strips metadata without re-encoding, and retains private copies
until sign-out. Upload streams to the fixed Bluesky video service using scoped,
short-lived service authorisation and bounded processing polls. Uploads and post
creation are never automatically retried.
The composer saves the draft before starting, reports video upload and processing
separately, and accepts cancellation until the worker enters the post creation
request.
See storage.py and media.py for retention limits and cleanup. These are local
application files, not separately encrypted backups. Use temporary demo storage
when debugging or sharing a reproduction.
The encoded image cache indexes one account’s directory on cataloguing or the first write. Reads update recency, and atomic writes and evictions maintain the index under the existing I/O lock. An I/O error invalidates the index for reconciliation on the next write.
The Home reading marker follows a retained post key and uses an unmeasured row overlay. Undo still uses the existing key and offset. Home parent previews use the current feed’s matching URI and CID, honour content warnings and account visibility, and reuse ordinary conversation navigation.
Single-image previews reserve height from immutable Media dimensions supplied by
the image embed's optional aspectRatio. Native height-for-width measurement is
bounded to 160–560 logical pixels, with a 4:3 fallback for older records. The preview
draws immutable textures with a centred cover crop; image arrival/eviction and
download-policy placeholders do not change the reserved rectangle. This uses
constant arithmetic during layout, with no pixel/subject analysis, decode or
network work added to scrolling. Dimension fields survive cached post round trips.
Multiple images use an equal-width, two-column GTK grid with previews capped at
200 logical pixels before button padding. Three images put the first across the
top. Recycled rows reuse the same image cells and viewport-managed loads.
PreviewTexture queues drawing only when decoded pixels arrive or are released;
it does not inherit a picture's pixel-dependent natural size or propagate a resize
to the list. Alt text remains an accessible image label. The default-off
show-alt-text GSettings preference adds selectable captions below post images;
changes redisplay existing lists while preserving their reading positions. Image
overlays always retain descriptions and their copy action independently.
The image viewer uses native scroll adjustments to pan a single bounded
decoded texture. Fit follows the viewport, zoom retains the viewport centre
where it can, and a separate description scroller caps the space below the
image. Wide dialogs place portrait descriptions beside the image. Decoded
dimensions resolve any missing or inaccurate aspect metadata.
Multi-image posts pass their ordered attachments and clicked index to the
viewer. Each selection resets zoom and scroll, releases the outgoing texture,
and cancels and supersedes its request. The viewer loads only the selected
image and updates its description and original-image action together.
Automatic viewport media uses at most three worker slots. The mapped view
rechecks deferred requests when capacity opens, using then-current geometry.
Inline Gtk.Video
controls are created on the first explicit play action, not while binding a feed
thumbnail. Thumbnail badge changes use opacity rather than changing layout.
Relative post times use one window-owned 60-second BOOTTIME timer in
refresh_monitor.py. Bound cards register weakly; only mapped live cards are
checked, sharing one wall-clock instant. Resume expiry, activation and card
mapping catch up stale labels without rebinding posts.