feat: Implement tabbed article editor with real-time preview#2125
feat: Implement tabbed article editor with real-time preview#2125anshul23102 wants to merge 2 commits into
Conversation
…rkdown preview - Merge EditorScreen and PreviewScreen into single tabbed component - Add "Editor" tab with rich text editor and formatting toolbar - Add "Preview" tab with real-time HTML rendering using AutoHeightWebView - Implement tab switching via TouchableOpacity buttons (no new dependencies) - Update preview button header to switch to preview tab instead of navigation - Enhance UX for healthcare professionals unfamiliar with raw markdown by providing immediate visual feedback - Maintain all existing editor functionality (image insertion, rich formatting, character count) Resolves SB2318#1291
|
Thank you @, for creating the PR and contributing to our UltimateHealth project 💗. |
|
@SB2318 /assign /claim GSSoC 2026 |
|
This implementation could benefit from labels: |
Automated Review FeedbackProvide actionable comments grouped by severity: Critical
Important
Suggestions
|
- ArticleCard.tsx: close mockReadability object literal (missing closing brace swallowed heartScale declaration) - PreferencesContext.tsx: restore missing generic angle bracket on useState<LanguageCode[]> - CommentScreen.tsx: restore missing generic angle brackets on useState<Comment[]>, useState<User[]>, and TriggersConfig<...> - HomeScreen.tsx: remove orphaned import fragment left over from a prior merge These were unrelated to the tabbed editor feature but broke tsc/eslint parsing repo-wide, so CI could not validate this PR.
|
CI status update The Typecheck/Lint/Unit Test failures on the first push were caused by pre-existing issues on `main`, unrelated to this feature - confirmed by diffing the affected files against `upstream/main` before any change here. I've fixed what was safely fixable in a small follow-up commit:
After these fixes, Typecheck/Lint parse cleanly and Unit Tests went from failing outright to 383/386 passing (the remaining 3 are pre-existing test-assertion mismatches in files I didn't touch, e.g. Two things I intentionally left alone since they're outside this PR's scope and need repo-level decisions, not source edits:
Happy to open a separate issue/PR for those if useful - didn't want to bundle a lockfile bump into a feature PR. |
Summary
Implements a tabbed interface for the article editor that merges EditorScreen and PreviewScreen into a single component, providing healthcare professionals with real-time markdown preview without navigation delays.
Key Changes
Technical Details
Implementation Highlights
✓ No external dependencies added - uses existing react-native, react-native-pell-rich-editor, and AutoHeightWebView
✓ Maintains all existing rich text editing capabilities
✓ Character count persists across tab switches
✓ Professional tab UI with visual feedback on active tab
✓ Respects safe area insets for notch-aware devices
Resolves
Addresses the feature request in #1291 to merge article editor and preview into a tabbed interface
Testing
The implementation maintains all editor functionality while adding tab switching:
Performance Considerations