Skip to content

Feature/GitHub source - #114

Open
osbgx wants to merge 16 commits into
bjarneo:mainfrom
osbgx:feature/github-source
Open

Feature/GitHub source#114
osbgx wants to merge 16 commits into
bjarneo:mainfrom
osbgx:feature/github-source

Conversation

@osbgx

@osbgx osbgx commented Jun 24, 2026

Copy link
Copy Markdown

Adds a complete GitHub repository wallpaper browser as a new source tab
under the Sources dropdown. Supports github.com, GitHub Pages
(*.github.io), and raw.githubusercontent.com URLs.

Backend

  • internal/githubsource/ — new package with GitHub Contents API client,
    URL parser (4 formats), TTL-cached ListImages(), and server-side
    thumbnail pipeline (DownloadThumbnailscaleImage → PNG + .dims
    disk cache)
  • app.goListGitHubImages and GetGitHubThumbnail Wails bindings

Frontend

  • GitHubBrowser.svelte — URL input, saved repos (localStorage), name
    filter, directory/file grid, preview overlay, card size toggle
  • GitHubCard.svelte — per-card intersection observer, thumbnail via
    GetGitHubThumbnail, favorite/add-extra/use/wallpaper-only/preview actions
  • github.svelte.ts — Svelte 5 runes store with pre-warm (first 12
    thumbnails)
  • FavoritesView.svelteloadRemoteThumb for GitHub thumbnails
  • HeaderBar.svelte — restructured Sources dropdown (Wallhaven / GitHub / Local)
  • RemoteImage.svelte — uses GetGitHubThumbnail instead of inline Image
  • models.tsgithubsource types (ImageInfo, ListContentsResult,
    ThumbnailResult)

Docs

  • docs/github-source.md — feature overview, URL formats, usage
  • README.md — GitHub source listed under Wallpaper Tools

Review fixes squashed in

  • Register golang.org/x/image/webp decoder (thumbnails + extraction)
  • 30s timeout on thumbnail HTTP downloads
  • Atomic thumbnail writes (tmp + rename) to prevent partial-file races
  • canGoUp now supports Pages and raw.githubusercontent.com URLs
  • Rename wallhaven DownloadDownloadImage (generic HTTP downloader)

osbgx added 16 commits June 23, 2026 00:00
- New internal/githubsource/ package: parses GitHub URLs, queries
  Contents API, filters images, returns raw.githubusercontent.com URLs
- Frontend: GitHub tab with URL input, lazy-loading image grid,
  download-on-use flow (reuses DownloadWallpaper)
- Nav: Sources dropdown grouping Wallhaven, GitHub, Local
- Tests: parseURL for 5 URL formats, filterImages, buildRawURL
Replace separate sourceItems array + slice rendering with a single
{#each tabs as tab} loop using a discriminated NavItem type.
Dropdown items (children) live inline in the nav data, keeping the
order explicit and extensible for future additions.
- ImageInfo now carries Type (file/dir) and Path fields
- ListImages returns ListContentsResult wrapper with mixed file/dir items
- Uses download_url from GitHub API directly (no branch resolution needed)
- parseURL handles 3+ segment URLs as owner/repo/path for dir navigation
- Frontend shows folder cards with folder icon; click navigates deeper
- Up-arrow button in header for parent directory
- Counter shows images and directories separately
- svelte-check 0 errors, go test -v PASS
- Add in-memory TTL cache (5 min, 100 entry FIFO eviction)
- Cache ListImages results to speed up repeated directory navigation
- Add heart/favorite button on each GitHub image card (ToggleFavorite IPC)
- Add star/bookmark saved-repos dropdown with localStorage persistence
- Fix nested <button> in saved-repos list
…ecoding=async

- Move heart to right side, add button to left (matches Wallhaven layout)
- Heart always visible when favorited, hidden+hover-reveal when not
- Remove bulk IsFavorite IPC loop on every render (N Go bridge crossings)
- ToggleFavorite now drives the state directly from its return value
- Add decoding='async' to RemoteImage img for smoother hover transitions
- Download full-res GitHub raw image in Go, resize to 300px PNG
- Cache thumbnail on disk (~/.cache/aether/thumbnails/github/<hash>.png)
- Return as data URL to frontend (single IPC call, tiny payload)
- RemoteImage calls GetGitHubThumbnail instead of loading raw URL
- First load downloads and caches; subsequent loads are instant
Re-generate Wails JS/TS bindings and bump indirect dependencies
(go-toast, wails v2.11.0→v2.12.0). GetGitHubThumbnail entry
re-ordered alphabetically in App.d.ts/App.js.
Kick off GetGitHubThumbnail for the first 12 images as soon as
ListImages returns, so HTTP download + Go resize starts in the
background. By the time the user scrolls to each card, the
thumbnail is on disk and RemoteImage gets it instantly.
Text input filters grid results by filename (case-insensitive).
Clears automatically when navigating to a new directory.
Count changes to '12 / 20' style to show filtered vs total.
FavoritesView now calls GetGitHubThumbnail for remote URLs that
don't have a native thumbUrl (GitHub favorites). Fire-and-forget
so the loop doesn't block on HTTP downloads.
Add ThumbnailResult struct (dataURL, width, height) to Go thumbnail
pipeline — dimensions come from image.Decode before resize. Cache
them in a sidecar .dims file alongside the PNG so cached thumbnails
also report original dimensions. Replace filename in card info bar
with '1920×1080 · 1.2 MB' style; filename visible as tooltip.
- Stale cache entries (pre-dims migration) are now discarded so the
  next visit re-downloads the image and persists original dimensions.
- Info bar layout matches Wallhaven: justify-between, dimensions left,
  file size right, same padding and font size.
…e Wallhaven)

- New GitHubCard.svelte: lazy thumbnail via GetGitHubThumbnail, lazy
  favorite check via IsFavorite (both gated on intersection observer),
  loading shimmer (animate-pulse), heart/add positions matching
  WallpaperCard, dimensions + file size info bar, hover overlay with
  Use/Wallpaper only/Preview.
- GitHubBrowser.svelte: remove per-card state (favState, dims,
  handleLoad/Favorite/AddExtra/Use/formatSize) — delegated to card.
- RemoteImage.svelte is now unused (kept as no-op).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant