Skip to content

feat: open a package in Settings from a stablebar:// link - #284

Merged
M4n0x merged 1 commit into
mainfrom
feat/254-package-links
Oct 23, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/254-package-links

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

There was no way to point someone to one package. To share a widget or theme from the Store or a private source, you had to tell them its name so they could search for it in Settings → Packages. StableBar already registered stablebar:// (#249), but only for stablebar://add-source.

Fixes #254

Changes

  • stablebar://package/<id> opens Settings → Packages on that package. An optional ?source=<id> names the source to use.
    • An installed package opens its installed copy.
    • Otherwise the link opens the package's page in the named source. A link without a source opens the Store's page, or the first private source that lists the package.
    • A Store widget that Essentials has replaced opens StableBar Essentials, even once the Store stops listing it.
  • Nothing is installed. The page still needs the usual review and Add to bar, the same way add-source only fills in its form.
  • When the link can't be resolved, the Store shows why above its cards: no source lists the package, the named source is unavailable, or the named source hasn't been added (then: ask for its join link).
  • Copy link sits next to Show in Finder on packages that a source lists. Store drafts link to their own source; an installed copy links to the source that installed it. Folders and local copies get no button.
  • Plumbing:
    • PackageLink parses and builds the links, accepting only one valid package ID and a valid source ID.
    • BarStore.receive(_:) keeps the last stablebar:// link from an open event, so join links and package links share the app's handler.
    • PackageLibrary.open(_:) does the selection.
    • Packages takes a pending link when it appears or when the link arrives, and waits while an add or update is running.
  • Docs: a new "Linking to a package" section in docs/packages.md, and the scheme note in CONTRIBUTING.

No configuration property changes, so the schema, layers and configuration editing are unaffected.

Testing

  • swift test passes in full on the rebased branch: 294 XCTest tests and 447 Swift Testing tests.
  • New tests:
    • PackageLinkTests: parsing, refusals (nested paths, .., encoded slashes, bad or local source IDs), building links, and receive keeping the last link.
    • testPackageLinksOpenTheInstalledCopyOrTheListingWithoutInstalling covers:
      • opening the Store or Acme listing of a package that both list, even before anything has loaded;
      • opening the installed copy whatever source the link names;
      • the Essentials case;
      • every not-found message;
      • nothing installed and the configuration file unchanged.
    • testPackagesCopyALinkOnlyWhenTheirSourceListsThem: which drafts get a link and which source it names.
    • testPackagesViewOpensAPendingPackageLink: a hosted PackagesView takes a pending link on appear and one that arrives while it's open.
  • Screenshots were drawn offscreen from a temporary XCTest that isn't committed. "Before" was rendered from main, where the same pages were opened directly because links didn't exist yet.
  • Not checked: opening a real link through macOS in a running app, and the pasteboard contents after Copy link. The handler path from application(_:open:) to receive is the one add-source already uses.
Before After
A private source's package page
An installed package

A link to a package that no source lists (new; light and dark):

Merging

This is one feat commit, so a merge commit and a squash give the same changelog entry.

Claude Opus 5.5 via Claude Code

@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 23, 2026 11:34
stablebar://package/<id> opens Settings > Packages on that package: the
installed copy, or its page in the source the link names with ?source=<id>,
or else the Store or the first private source that lists it. A Store widget
that Essentials replaced opens StableBar Essentials. A link installs nothing;
the page still needs the usual review and Add to bar. When no source lists
the package, or the named source is unavailable or not added, the Store says
so above its cards.

A package that a source lists gets a Copy link button next to Show in Finder.
@M4n0x
M4n0x force-pushed the feat/254-package-links branch from cc39f93 to 96e37ed Compare October 23, 2026 11:39
@M4n0x
M4n0x merged commit aa78e25 into main Oct 23, 2026
7 checks passed
@M4n0x
M4n0x deleted the feat/254-package-links branch October 23, 2026 12:05
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open a package in Settings from a stablebar:// link

1 participant