Skip to content

feat: decouple source and preview panels#27

Merged
Huxpro merged 2 commits intomainfrom
feat/source-preview-decouple
Mar 26, 2026
Merged

feat: decouple source and preview panels#27
Huxpro merged 2 commits intomainfrom
feat/source-preview-decouple

Conversation

@Huxpro
Copy link
Copy Markdown
Member

@Huxpro Huxpro commented Mar 24, 2026

Description

This PR decouples the Source code viewer and Preview panel in the ExamplePreview component, enabling them to be rendered independently or linked.

  • Added a mode prop to ExamplePreview supporting 'linked' | 'preview-only' | 'source-only'.
  • When mode=preview-only, network requests for raw source files are completely bypassed.
  • Refactored UI layouts and footers to adapt smoothly when only one panel is active.
  • Added a dropdown to the demo playground (example/src/main.tsx) to toggle and test between the three modes.

Related Issues

Closes # (if applicable)

Testing

  • Selected 'Preview Only' mode in the demo playground; verified no raw files were downloaded.
  • Selected 'Source Only' mode; verified the UI rendered only the code tree and viewer cleanly.

Add a mode prop to ExamplePreview to allow rendering only the source code or only the preview, decoupling the previously tightly bound architecture.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 24, 2026

Deploy Preview for lynx-go-web ready!

Name Link
🔨 Latest commit a11f26c
🔍 Latest deploy log https://app.netlify.com/projects/lynx-go-web/deploys/69c2f1b8dd7c7500087d148e
😎 Deploy Preview https://deploy-preview-27--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.

Updates the mode prop values from 'preview-only' and 'source-only' to 'preview' and 'source' across the codebase. Ensures the generated JSX string in the example playground correctly reflects these new string values.
@Huxpro Huxpro merged commit 39e47ff into main Mar 26, 2026
4 of 7 checks passed
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