Skip to content

feat: add insert iframe modal#127

Merged
wendyyuchensun merged 2 commits intocoseeing:mainfrom
wendyyuchensun:iframe-modal
May 3, 2026
Merged

feat: add insert iframe modal#127
wendyyuchensun merged 2 commits intocoseeing:mainfrom
wendyyuchensun:iframe-modal

Conversation

@wendyyuchensun
Copy link
Copy Markdown
Collaborator

@wendyyuchensun wendyyuchensun commented Apr 24, 2026

Solves #114 .

Summary

  • Adds IframeInputModal — a modal with title and URL fields that inserts an iframe markdown block into the editor
  • Extracts isValidUrl from LinkInputModal into src/lib/url.js so both modals share the same validation logic
  • Adds the iframe markdown button and markdown syntax insertion support

Demo

Screenshot 2026-04-24 at 20 39 13

Note

  1. Why there is no preview panel

The design includes an iframe preview panel inside the modal. I currently remove it because iframe load/error state is not reliably detectable in the browser:

  • The onerror event does not fire for the most common failure cases — blocked by X-Frame-Options or Content-Security-Policy: frame-ancestors headers (which most sites
    send)
  • The load event fires regardless of whether the content loaded successfully or was blocked
  • Cross-origin content prevents any inspection of contentDocument after load

We can discuss if the feature is necessary in future meetings.

  1. insert_iframe button svg:設計師還沒確認用哪個 icon,我先暫時先放一個,之後等拿到 svg 檔案再更新

@wendyyuchensun wendyyuchensun changed the title Iframe modal feat: add insert iframe modal Apr 24, 2026
@wendyyuchensun wendyyuchensun force-pushed the iframe-modal branch 2 times, most recently from 3d24d8d to a27c652 Compare April 24, 2026 12:35
@wendyyuchensun wendyyuchensun merged commit 279882d into coseeing:main May 3, 2026
1 check passed
@wendyyuchensun wendyyuchensun deleted the iframe-modal branch May 3, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants