forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bugfix and update Preview.tsx #1420
Open
Stijnus
wants to merge
4
commits into
stackblitz-labs:main
Choose a base branch
from
Stijnus:ACT_BoltDYI_BUGFIX_PREVIEW
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
# Device Frame Feature Implementation ## Key Features Added 1. **Device Frames for Mobile and Tablet Previews** - Added visual frames for iPhone and iPad devices - Implemented both portrait and landscape orientations - Created realistic device bezels with notches and home buttons 2. **Device Options Panel** - Added toggle for showing/hiding device frames - Added toggle for landscape/portrait orientation - Updated device size information display 3. **External Window Preview Enhancements** - Fixed "about:blank" issue with external previews - Implemented reliable window creation with proper dimensions - Added device name and orientation labels ## Technical Implementation Details 1. **Frame Rendering Approach** - Created a complete HTML document with styling for device frames - Used document.write() to inject content into new window - Implemented proper iframe loading within the device frame 2. **Responsive Design** - Dynamic adjustment of frame elements based on device type - Proper handling of orientation changes (landscape/portrait) - Appropriate sizing for different device types (mobile vs tablet) 3. **Security and Reliability** - Avoided cross-origin manipulation issues - Implemented error handling for window creation - Maintained proper sandbox attributes for security ## UI/UX Improvements 1. **Visual Enhancements** - Added realistic device styling (rounded corners, notches, buttons) - Implemented proper shadows and depth for 3D appearance - Created clean, minimal interface for device controls 2. **User Controls** - Intuitive toggles for device frame and orientation - Clear labeling of device dimensions and frame status - Maintained existing preview functionality while adding new features ## Code Quality 1. **Maintainability** - Used TypeScript interfaces for proper typing - Implemented clean separation of concerns - Added appropriate comments for complex sections 2. **Performance** - Optimized rendering approach to avoid unnecessary reflows - Used efficient DOM manipulation techniques - Maintained responsive performance across different device sizes
#1474 isnt this partly the same? |
yes, and it has some extra features also... |
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.
Fix for : #1097
Device Frame Feature Implementation
Key Features Added
Device Frames for Mobile and Tablet Previews
Device Options Panel
External Window Preview Enhancements
Technical Implementation Details
Frame Rendering Approach
Responsive Design
Security and Reliability
UI/UX Improvements
Visual Enhancements
User Controls
Code Quality
Maintainability
Performance