Skip to content

Add "Open in new tab" link above spec iframe#798

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-open-in-new-window-link
Draft

Add "Open in new tab" link above spec iframe#798
Copilot wants to merge 3 commits intomainfrom
copilot/add-open-in-new-window-link

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

The spec page (guide/spec.html) embeds the Living Specification via iframe, making it inaccessible for LLMs and inconvenient for direct access. Adds a link overlaying the iframe to open the spec standalone.

  • HtmlViewer component: Renders a right-aligned "Open in new tab ↗" link overlaying the iframe, pointing to the same src URL
  • i18n: EN "Open in new tab ↗" / ZH "在新标签页中打开 ↗"
  • Styles: Absolutely-positioned overlay with gradient fade background using var(--rp-c-bg) for dark mode compatibility. Uses pointer-events: none on the bar with pointer-events: auto on the link to keep the iframe fully interactive underneath. Preserves the original full-space iframe layout trick.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Feb 27, 2026

Deploy Preview for lynx-doc ready!

Name Link
🔨 Latest commit c992b91
🔍 Latest deploy log https://app.netlify.com/projects/lynx-doc/deploys/69a299b0acbe3d00087c6020
😎 Deploy Preview https://deploy-preview-798--lynx-doc.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.

- Add i18n translations for link text (en/zh)
- Render right-aligned link in HtmlViewer component above iframe
- Style with brand color and subtle hover effect

Co-authored-by: Huxpro <5563315+Huxpro@users.noreply.github.com>
Copilot AI changed the title [WIP] Add open in new window link to guide/spec.html Add "Open in new tab" link above spec iframe Feb 27, 2026
@Huxpro
Copy link
Collaborator

Huxpro commented Feb 28, 2026

@copilot this change create a huge spacing around the iframe. It seems like the original layout is a trick to workaround Rspress default doc layout so it can fill up all the space. We should maintain the original tricks and add incremental changes to the UI. How about a sticky header?

Instead of a flex column that adds spacing above the iframe, use
position:absolute to overlay the link on top of the iframe content.
Uses var(--rp-c-bg) for dark mode compatibility.

Co-authored-by: Huxpro <5563315+Huxpro@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 28, 2026

@copilot this change create a huge spacing around the iframe. It seems like the original layout is a trick to workaround Rspress default doc layout so it can fill up all the space. We ...

Fixed in c992b91. Changed from a flex column layout (which took up space above the iframe) to an absolutely-positioned overlay that floats on top of the iframe content with a gradient fade. The original height: calc(100vh - 72px) layout trick is preserved — the link bar now uses position: absolute + z-index: 1 with pointer-events: none on the bar (and pointer-events: auto on the link itself) so the iframe remains fully interactive underneath. Also uses var(--rp-c-bg) for dark mode compatibility.

Screenshot

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.

2 participants