fix: improve goView iframe detection and locked selection parity

This commit is contained in:
clawdbot 2026-01-28 02:18:08 +08:00
parent 4c96177982
commit d21806c836
2 changed files with 7 additions and 2 deletions

View File

@ -465,7 +465,7 @@ export function Canvas(props: CanvasProps) {
if (props.selectionIds.includes(node.id)) {
if (node.locked) {
// Locked nodes are selectable, but should not start a move drag.
props.onSelectSingle(node.id);
// Keep the current selection intact for multi-select parity.
return;
}
props.onBeginMove(e);

View File

@ -182,7 +182,12 @@ function looksLikeIframeOption(option: unknown): boolean {
// If it isn't an obvious media URL, it's often an iframe/embed.
// (We deliberately keep this conservative; image/video are handled earlier.)
return (
(/^https?:\/\//i.test(url) || /^data:text\/html/i.test(url)) &&
(
/^https?:\/\//i.test(url) ||
// protocol-relative URLs (//example.com)
/^\/\//.test(url) ||
/^data:text\/html/i.test(url)
) &&
!/\.(png|jpe?g|gif|webp|bmp|svg)(\?|#|$)/i.test(url) &&
// Avoid misclassifying video streams as iframes.
!/\.(mp4|m3u8|flv|webm|mov|m4v|ogv)(\?|#|$)/i.test(url) &&