Skip to content

feat: support deep link#47

Open
zsy-jason wants to merge 3 commits into
lynx-community:mainfrom
zsy-jason:p/zsy/support_deep_link
Open

feat: support deep link#47
zsy-jason wants to merge 3 commits into
lynx-community:mainfrom
zsy-jason:p/zsy/support_deep_link

Conversation

@zsy-jason
Copy link
Copy Markdown

Add deep link support in example preview components.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: 7639eab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/go-web Minor

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 27, 2026

Deploy Preview for lynx-go-web ready!

Name Link
🔨 Latest commit 7639eab
🔍 Latest deploy log https://app.netlify.com/projects/lynx-go-web/deploys/69ef921cb48b170009df43cb
😎 Deploy Preview https://deploy-preview-47--lynx-go-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Collaborator

@Dugyu Dugyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! Please run pnpm changeset at repo root and include a minor change for this PR:)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / ExampleContentProps with deepLinkUrl and deepLinkTitle.
  • Pass deep-link props through ExamplePreviewExampleContent.
  • 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 RadioGroup is hard to read and duplicates logic already derived in hasPreview/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 the RadioGroup props 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.

Comment thread src/example-preview/components/index.tsx Outdated
Comment thread src/example-preview/components/index.tsx Outdated
@zsy-jason zsy-jason force-pushed the p/zsy/support_deep_link branch from ad00c05 to da12ccf Compare April 27, 2026 06:40
@zsy-jason
Copy link
Copy Markdown
Author

@Dugyu Comments solved, PTAL again.

@zsy-jason zsy-jason force-pushed the p/zsy/support_deep_link branch 2 times, most recently from fda35fc to f506a45 Compare April 27, 2026 09:34
@Dugyu Dugyu requested a review from Copilot April 27, 2026 09:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ExamplePreviewProps and ExampleContentProps with deepLinkUrl / deepLinkTitle.
  • Forward deep link props from ExamplePreview to ExampleContent.
  • 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.

Comment thread src/example-preview/index.tsx
Comment thread src/example-preview/components/index.tsx Outdated
Comment thread src/example-preview/components/index.tsx
Support deep link in example preview components.
This change enables users to open specific content directly via deep links
@zsy-jason zsy-jason force-pushed the p/zsy/support_deep_link branch from 4747f68 to b5fabe5 Compare April 27, 2026 12:14
@Dugyu Dugyu changed the title feat: support deep link. feat: support deep link Apr 27, 2026
- 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
@Dugyu Dugyu requested a review from Copilot April 27, 2026 16:46
@Dugyu Dugyu linked an issue Apr 27, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / deepLinkTitle props to ExamplePreview and plumbs them through to ExampleContent.
  • 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.

Comment on lines +226 to +230
return deepLinkUrl
.split('{{{urlEncoded}}}')
.join(encodeURIComponent(rawUrl))
.split('{{{url}}}')
.join(rawUrl);
Comment on lines +311 to +315
{previewOptionCount >= 2 ? (
<RadioGroup
onChange={(e) => setPreviewType(e.target.value)}
value={previewType}
type="button"
Comment thread src/embed.ts
Comment on lines +27 to +36
/**
* 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://
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.

Go-Web: Deep Link button (deepLinkUrl/deepLinkTitle)

3 participants