Conversation
Replace all pravatar.cc URLs with GitHub avatars to avoid CORS issues in WASM/browser environment. Also adjust XSmall avatar size from 20px to 16px for better consistency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref zed-industries/zed#50228
Summary
Show case
https://huacnlee.github.io/gpui-component-story-web/
Key Changes
1. Shared Gallery Component
crates/story/src/gallery.rsmain.rsandstory-web/lib.rs2. WASM Async Architecture Improvements
Problem: WASM main thread cannot use blocking synchronization primitives (
Mutex,RwLock) that rely onAtomics.wait.Solution: Redesigned the async architecture to avoid cross-thread locks:
Arc<Mutex<ParsedContent>>to direct storage inTextViewStateNew workflow:
UpdateOptionsto background taskParsedContent, parses text, returns newParsedContentparsed_contentparsed_content, no locks needed3. Cross-platform Time APIs
std::timewithinstantcrate for cross-platform compatibilityinstant::{Duration, Instant}.without_time())Technical Details
Files Modified
crates/story/src/gallery.rs- New shared Gallery modulecrates/story/src/main.rs- Simplified to use shared Gallerycrates/story-web/src/lib.rs- Simplified to use shared Gallery (326 lines → 26 lines)crates/ui/src/text/state.rs- WASM async architecture improvementscrates/ui/src/async_util.rs- Cross-platform async utilitiescrates/ui/Cargo.toml- Addedinstantandparking_lotdependenciesKey Architecture Changes
Test Plan
Benefits
TODO
gpui_webnot have implement theset_menus, app menu missing.tree-sittercan't compiled for wasm, disabled to without highlight.🤖 Generated with Claude Code