feat: support deep link#47
Conversation
🦋 Changeset detectedLatest commit: 7639eab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for lynx-go-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Dugyu
left a comment
There was a problem hiding this comment.
Thanks for contributing! Please run pnpm changeset at repo root and include a minor change for this PR:)
There was a problem hiding this comment.
Pull request overview
Adds deep-link support to the example preview UI so consumers can provide a URL and button title to open the app locally from the preview.
Changes:
- Extend
ExamplePreviewProps/ExampleContentPropswithdeepLinkUrlanddeepLinkTitle. - Pass deep-link props through
ExamplePreview→ExampleContent. - Conditionally hide the preview tab switcher when only a single preview option is available, and render a deep-link button when configured.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/example-preview/index.tsx | Adds deep-link props to the public ExamplePreviewProps API and forwards them to ExampleContent. |
| src/example-preview/components/index.tsx | Wires deep-link props into the preview UI and conditionally renders the tab switcher and deep-link button. |
Comments suppressed due to low confidence (1)
src/example-preview/components/index.tsx:285
- The conditional that decides whether to show the
RadioGroupis hard to read and duplicates logic already derived inhasPreview/hasWebPreview. Consider computing the number of available preview options (preview image / QR code / web) and rendering the switcher when the count > 1; also reformat the JSX so theRadioGroupprops are consistently indented (current indentation makes the block difficult to scan).
{/* Show tab switcher only if there are multiple preview options */}
{((previewImage && hasWebPreview) || (previewImage && currentEntry) || (hasWebPreview && currentEntry)) ? (
<RadioGroup
onChange={(e) => setPreviewType(e.target.value)}
value={previewType}
type="button"
style={{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ad00c05 to
da12ccf
Compare
|
@Dugyu Comments solved, PTAL again. |
fda35fc to
f506a45
Compare
There was a problem hiding this comment.
Pull request overview
Adds deep link support to the ExamplePreview / ExampleContent UI so consumers can optionally render a call-to-action button that navigates to a provided app deep-link URL.
Changes:
- Extend
ExamplePreviewPropsandExampleContentPropswithdeepLinkUrl/deepLinkTitle. - Forward deep link props from
ExamplePreviewtoExampleContent. - Update preview header tab-switcher rendering and add a deep link button in the preview area.
- Add a changeset for a minor version bump.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/example-preview/index.tsx |
Adds deep link props to the public ExamplePreviewProps API and forwards them to ExampleContent. |
src/example-preview/components/index.tsx |
Adds deep link button rendering logic and refines when the preview tab switcher is shown. |
.changeset/new-suits-burn.md |
Declares a minor release for the deep link support change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Support deep link in example preview components. This change enables users to open specific content directly via deep links
4747f68 to
b5fabe5
Compare
- Add `deepLinkUrl`/`deepLinkTitle` props to <Go> ExamplePreview
- Support URL templating via `{{{url}}}` and `{{{urlEncoded}}}` for current entry URL
- Provide default i18n key `go.deeplink.open` and update example translations
- Render deep link button within QRCode tab to avoid overlaying absolute preview panels
- Update embed options, README docs, and changeset wording
There was a problem hiding this comment.
Pull request overview
Adds optional deep-link support to the example preview UI so users can open the currently selected entry directly in a local app via a configurable URL template.
Changes:
- Adds
deepLinkUrl/deepLinkTitleprops toExamplePreviewand plumbs them through toExampleContent. - Renders a deep-link button in the QR-code panel and adds an i18n key for its default label.
- Documents the new options in the embed options table and publishes a changeset.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/example-preview/index.tsx |
Adds deep-link props to ExamplePreview and forwards them to the content component. |
src/example-preview/components/index.tsx |
Implements deep-link button + URL templating logic and adjusts preview header tab-switcher rendering. |
src/embed.ts |
Extends EmbedOptions type to include deep-link fields. |
src/config.tsx |
Adds default i18n string for the deep-link button label. |
example/src/main.tsx |
Adds translations for the new i18n key in the example app. |
README.md |
Documents deepLinkUrl / deepLinkTitle options. |
.changeset/new-suits-burn.md |
Marks a minor release for the new deep-link capability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return deepLinkUrl | ||
| .split('{{{urlEncoded}}}') | ||
| .join(encodeURIComponent(rawUrl)) | ||
| .split('{{{url}}}') | ||
| .join(rawUrl); |
| {previewOptionCount >= 2 ? ( | ||
| <RadioGroup | ||
| onChange={(e) => setPreviewType(e.target.value)} | ||
| value={previewType} | ||
| type="button" |
| /** | ||
| * Deep link URL template for opening the app locally. | ||
| * | ||
| * Supports templating with the currently selected entry URL: | ||
| * - `{{{url}}}` - raw URL | ||
| * - `{{{urlEncoded}}}` - encodeURIComponent(URL) | ||
| */ | ||
| deepLinkUrl?: string; | ||
| /** Custom title for the deep link button */ | ||
| deepLinkTitle?: string; |
| */ | ||
| defaultTab?: PreviewTab; | ||
| /** | ||
| * Deep link URL for opening the app locally, e.g., lynxtron-go:// |
Add deep link support in example preview components.