Skip to content

feat(super-editor): visual-only loading overlay toggle (IT-1365) - #3880

Open
caio-pizzol wants to merge 2 commits into
mainfrom
caio/it-1365-loading-overlay-visual-gate
Open

feat(super-editor): visual-only loading overlay toggle (IT-1365)#3880
caio-pizzol wants to merge 2 commits into
mainfrom
caio/it-1365-loading-overlay-visual-gate

Conversation

@caio-pizzol

@caio-pizzol caio-pizzol commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Stack 1/2 — internal only, no public API change. Public surface is #3881.

Problem

The built-in loading skeleton (EditorSkeleton) was gated solely on editorReady, so the only way to hide it was the internal suppressSkeletonLoader option — which works by forcing editorReady = true.

That is too blunt. editorReady also gates the interactive chrome: ContextMenu, LinkClickHandler, TableResizeOverlay, ImageResizeOverlay, TextboxResizeOverlay.

Change

Adds an internal showLoadingOverlay option (default true) that controls only whether the placeholder paints.

.placeholder-editor is not just a visual: it is a full-surface, z-indexed element with no pointer-events: none, so it is also the only thing stopping pointer input reaching the editable surface underneath while editorReady is false (the editor is mounted, and editable defaults to true in Editor.ts:793). So the element stays mounted whenever editorReady is false and merely goes transparent when the overlay is off.

Result: hiding the overlay changes pixels and nothing else. Readiness, collaboration timing, the five chrome gates, and the interaction barrier are all untouched — a half-loaded document still cannot be edited.

suppressSkeletonLoader keeps its broader legacy semantics and is unchanged.

Review feedback addressed

  • Codex + cubic (P2), interaction barrier: valid, confirmed in source, fixed in 8eab403. The first revision unmounted the barrier along with the visual.
  • cubic (P3), test coverage: valid. Every test passed a fileSource, so the collaboration init path was never exercised. Added a lane that mounts without a file source and drives provider synced.

Tests

SuperEditor.loading-overlay.test.js — 10/10, split into barrier vs. paint assertions, plus the real collaboration path. Existing SuperEditor.test.js 36/36 unchanged.

Refs IT-1365

🤖 Generated with Claude Code

The built-in loading skeleton (EditorSkeleton) was gated solely on
`editorReady`, so the only way to hide it was the internal
`suppressSkeletonLoader` option, which forces `editorReady` true.

That is too blunt: `editorReady` also gates the interactive chrome
(context menu, link handler, table/image/textbox resize overlays), so
suppressing the skeleton also arms that chrome before collaboration has
synced.

Introduce `showLoadingOverlay` (default true) as a strictly visual gate
on EditorSkeleton. Readiness, collaboration timing and the existing
chrome gates are untouched, so hiding the overlay cannot change editing
behaviour. `suppressSkeletonLoader` keeps its broader legacy semantics.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown

IT-1365

@qodo-code-review

qodo-code-review Bot commented Aug 7, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit 8eab403 🚀 Fast

Results up to commit d00e2af 🚀 Fast


No changes from previous review

Powered by Qodo

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d00e2afe95

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

</div>

<EditorSkeleton v-if="!editorReady" />
<EditorSkeleton v-if="showLoadingOverlay" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the interaction barrier when hiding the skeleton

When a collaborative document is initialized with showLoadingOverlay: false, this removes the only full-size, z-indexed element intercepting pointer input while editorReady is false (EditorSkeleton.vue renders .placeholder-editor across the container). Although the auxiliary chrome remains unmounted, the underlying editor can now receive clicks and edits before collaborationReady, changing editing behavior and potentially allowing mutations against incompletely synchronized state. Keep an invisible input barrier or otherwise disable editor interaction until readiness independently of the skeleton's visual visibility.

Useful? React with 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/super-editor/src/editors/v1/components/SuperEditor.vue Outdated
The skeleton is not only a visual placeholder: `.placeholder-editor` is a
full-surface, z-indexed element with no `pointer-events: none`, so it is
also the only thing stopping pointer input from reaching the editable
surface underneath while `editorReady` is false. The editor is mounted
and `editable` defaults to true (Editor.ts), so unmounting the skeleton
allowed edits against a document that had not finished synchronizing.

Keep the element mounted whenever `editorReady` is false and let
`showLoadingOverlay` control only whether it paints. Hiding the overlay
is now genuinely visual-only.

Also adds coverage through the collaboration init path (no file source,
provider `synced`), which the previous tests never exercised because they
always passed a file source.

Reported by Codex and cubic on #3880.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@caio-pizzol caio-pizzol changed the title feat(super-editor): add visual-only showLoadingOverlay option (IT-1365) feat(super-editor): visual-only loading overlay toggle (IT-1365) Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant