-
Notifications
You must be signed in to change notification settings - Fork 734
Improve live code visuals #3654
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
Conversation
…ments; bump version to 3.19.0
There was a problem hiding this 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 PR improves the live code visuals by transitioning styling to CSS modules, adding a Prism theme for the live editor, and fixing flex behavior on mobile for the preview container, while also addressing a bug in TableSection when cell data is missing.
- Introduces conditional rendering and safe property access in TableSection to avoid errors.
- Migrates UILivePreview styling from react-native to CSS modules and integrates a new code formatting hook.
- Updates livePreview.tsx to employ CSS modules for improved mobile flex layout.
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
TableSection.tsx | Adds a null-check for cell data to prevent runtime errors |
UILivePreview.tsx | Migrates styling to CSS modules and applies a Prism theme |
useFormattedCode.ts | Updates the initial state for code formatting so it starts as an empty string |
livePreview.tsx | Adopts CSS modules for the mobile preview container layout |
Files not reviewed (3)
- docuilib/package.json: Language not supported
- docuilib/src/components/UILivePreview.module.scss: Language not supported
- docuilib/src/pages/livePreview.module.css: Language not supported
Comments suppressed due to low confidence (1)
docuilib/src/hooks/useFormattedCode.ts:9
- [nitpick] Using an empty string as the initial value might result in a less informative UI while formatting is in progress; consider providing a placeholder or loading indicator if formatting takes noticeable time.
const [formattedCode, setFormattedCode] = useState<string>('');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there's not enough contrast between the "device" and the screen
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
padding: 20px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want the "user" to decide on the padding
? Could we have a screen that wants no padding
?
Description
Improve live code visuals
Unrelated, fix minor issue in TableSection to avoid error when missing cell (item) data - this will show empty cell instead of throwing a vague error
Changelog
N/A
Additional info