Skip to content

feat: store file content out of tiptap#582

Merged
netchampfaris merged 6 commits intomainfrom
editor-media-improvements
Feb 26, 2026
Merged

feat: store file content out of tiptap#582
netchampfaris merged 6 commits intomainfrom
editor-media-improvements

Conversation

@safwansamsudeen
Copy link
Contributor

Stores the base-64 file content locally so that it isn't included in Tiptap structure at all (and by extension, getHTML).

This caused issues where the editor save would fail if an sufficiently large video failed in the upload.

Also improves UX by adding a "re-upload" feature and hiding media controls until successful uploaded.

Screenshots

Normal UX for current user:
image

Looks like this for other users:
image

@safwansamsudeen
Copy link
Contributor Author

Now maintains dimensions so that there is no layout shift for users:
image

If the upload fails, other users see:
image

@safwansamsudeen safwansamsudeen marked this pull request as ready for review February 24, 2026 06:27
Comment on lines +281 to +287
<img v-if="!isVideo" ref="mediaRef" class="rounded-[2px]" :class="!isUploaded && 'opacity-40'" :src="node.attrs.src || fileContent"
:alt="node.attrs.alt || ''" :width="node.attrs.width" :height="node.attrs.height"
@click.stop="selectMedia" @load="handleMediaLoaded" />
<video v-else ref="mediaRef" class="rounded-[2px]" :class="!isUploaded && 'opacity-40'" :src="node.attrs.src || fileContent"
:width="node.attrs.width" :height="node.attrs.height" :autoplay="node.attrs.autoplay"
:loop="node.attrs.loop" :muted="node.attrs.muted" :controls="isUploaded" @click.stop="selectMedia"
@loadedmetadata="handleMediaLoaded" />
Copy link
Contributor

Choose a reason for hiding this comment

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

no prettier formatting?

@netchampfaris netchampfaris merged commit 5e92fc1 into main Feb 26, 2026
1 check 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.

2 participants