Repository navigation
feat(launchpad): official store badges, a linked title, and an app-website link on the header - #69
Merged
Merged
Conversation
…bsite link on the header
- The App Store and Google Play buttons are now the official badges: Apple's
SVG and Google's PNG (Google publishes no public SVG), unmodified and
embedded as data URIs, so the page makes no third-party request. Each links
only to its own store listing; a notice keeps the artwork out of the MIT
license. Open in app stays the primary button.
- The default hero's title links to the web destination, beside Continue on
the web rather than instead of it.
- New launchpad.appWebsiteUrl setting: when set, the header's icon and name
link to the app's own website (cta_app_website). Explicit rather than
derived from a link's web fallback, which may be a third-party page.
- resolveContent receives a third argument, { webUrl }, so a host that draws
its own hero can link its title the same way.
App-open routing is unchanged: page content only.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three improvements to the Launchpad page, the page a visitor sees when a link can't open the app:
launchpad.appWebsiteUrlsetting: when set, the header's icon and name link to the app's own website.For hosts that draw their own hero,
resolveContentnow receives a third argument,{ webUrl }, so they can link their title the same way.Type of Change
Related Issues
None filed publicly.
Changes Made
src/lib/store-badges.ts(new): the badge artwork as data URIs.src/lib/launchpad.ts:cta_ios/cta_androidevents, are drawn at the same visible height (CSS pulls in the transparent clear space built into Google's PNG), and have alt text.<h1>links towebUrl(cta_web). With no web destination, or an unsafe one, it stays plain text. A host-suppliedheroHtmlis left alone.appWebsiteUrlinLaunchpadSettings.readLaunchpadSettingskeeps only http(s) values. The header wraps the icon and name in a link to it (cta_app_website), and stays unlinked when it's unset. It's deliberately explicit rather than derived from a link's web fallback, which may be a third-party page.src/routes/redirect.ts: passes{ webUrl }toresolveContent(additive, non-breaking), andappWebsiteUrlto the page. The beacon doc comment now lists every event; it was missingcta_web.appWebsiteUrl, the hook's new argument, and the full beacon event list.Testing
npm test): 422 passed, 2 skippednpm run typecheck)Test Coverage
viewBox 0 0 119.66407 40) and a 646×250 PNG.appWebsiteUrlis set, and unlinked when unset or unsafe;readLaunchpadSettingsdrops non-http(s) values.resolveContentreceives the decoratedwebUrl, and the header links to the workspace'sappWebsiteUrl.npm test -- src/lib/launchpad.test.ts src/routes/redirect.launchpad.test.tsScreenshots/Examples
{ "launchpad": { "appName": "Example", "appWebsiteUrl": "https://example.com" } }Checklist
feat:,fix:)Breaking Changes
None.
resolveContent's new third argument is additive. The store buttons' markup changes (badge images instead of text), so anything that scraped the page for the button text will seealttext instead.Additional Notes
cta_app_website. Until it does, those taps just aren't counted.