Skip to content

Show editor immediately while WASM compiler loads#16751

Merged
Mossaka merged 1 commit intomainfrom
feat/instant-editor-shell
Feb 19, 2026
Merged

Show editor immediately while WASM compiler loads#16751
Mossaka merged 1 commit intomainfrom
feat/instant-editor-shell

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 19, 2026

Summary

  • Remove the full-page loading overlay that blocks the UI for 5-10s during WASM download
  • Show the CodeMirror editor immediately (~0.5s) so users can start typing right away
  • Display "Loading compiler..." status badge and output placeholder while WASM downloads in background
  • Track edits made before compiler is ready and auto-compile once loaded

Before

  1. Page loads → loading overlay covers everything
  2. WASM downloads (5-10s)
  3. Overlay fades → editor becomes visible
  4. User can finally start typing

After

  1. Page loads → CodeMirror editors visible immediately
  2. Status badge shows "Loading compiler..." with pulsing dot
  3. Output panel shows friendly "Compiler loading... You can start editing!"
  4. WASM downloads in background
  5. When ready: status → "Ready", content auto-compiles

Changes

docs/public/editor/index.html

  • Start the loading overlay with hidden class so it never flashes on screen

docs/public/editor/editor.js

  • Add pendingCompile flag to track edits made before WASM is ready
  • Update EditorView.updateListener to set the flag instead of no-oping when !isReady
  • Rewrite init() to hide overlay immediately, show loading status, and compile on WASM ready

Test plan

  • Editor is visible and interactive immediately on page load
  • Output panel shows "Compiler loading..." placeholder
  • Status badge shows "Loading compiler..." with pulsing dot
  • After WASM loads, default content compiles automatically
  • If you type before WASM is ready, content compiles when WASM loads
  • Deep-link loading (e.g. #issue-triage) still works
  • Error state still shown if WASM fails to load

🤖 Generated with Claude Code

Instead of blocking the entire UI with a loading overlay during the
5-10s WASM download, show the CodeMirror editor right away so users
can start typing within ~0.5s. The compiler status badge and output
placeholder indicate loading progress, and any edits made before
the compiler is ready are compiled automatically once it loads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 19, 2026 04:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves the user experience of the gh-aw Playground editor by removing the blocking full-page loading overlay and showing the CodeMirror editor immediately while the WASM compiler loads in the background. Users can now start typing within ~0.5 seconds instead of waiting 5-10 seconds for the WASM module to download.

Changes:

  • The loading overlay is hidden by default, allowing the editor to be visible immediately on page load
  • Loading status is displayed via a status badge and output placeholder message during WASM download
  • Editor changes made before WASM is ready trigger automatic compilation once the compiler loads
  • Error handling updated to display failures in the output placeholder instead of the loading overlay

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/public/editor/index.html Add hidden class to loading overlay so it's hidden by default instead of showing during WASM load
docs/public/editor/editor.js Refactor initialization to show editor immediately, track pre-compiler edits via pendingCompile flag, and display loading status while WASM downloads in background

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let isCompiling = false;
let compileTimer = null;
let currentYaml = '';
let pendingCompile = false;
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The pendingCompile flag is declared but never actually used. It's set to true on line 195 when the document changes before the compiler is ready, but it's never checked anywhere in the code. Since doCompile() is called unconditionally on line 518 after the compiler is ready, it will compile whatever content is in the editor at that time (whether it was edited or not), making this flag unnecessary. Consider removing this unused variable to reduce code complexity.

Copilot uses AI. Check for mistakes.
// ---------------------------------------------------------------
async function init() {
// Hide the loading overlay immediately — the editor is already visible
loadingOverlay.classList.add('hidden');
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This line adds the hidden class to the loading overlay, but the overlay already has this class in the HTML (line 130 of index.html). While this is harmless and could be considered defensive programming, it's technically redundant. Consider removing this line since the overlay is already hidden by default.

Suggested change
loadingOverlay.classList.add('hidden');

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka merged commit a03abad into main Feb 19, 2026
49 checks passed
@Mossaka Mossaka deleted the feat/instant-editor-shell branch February 19, 2026 05:02
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