Prompt: WYSIWYG Rich Text Editor with Image Upload and Tables (FPC010)
Model: Groq-Llama4-Scout | Date: 05/17/2025 | Page Title: WYSIWYG Editor
Prompt Description
Develop a sophisticated WYSIWYG (What You See Is What You Get) Rich Text Editor similar to those found in CMS systems or advanced blogging platforms. This is a highly complex front-end challenge. **Core Features:** 1. **Editable Content Area (`data-testid='wysiwyg-editor'`):** A `div` with `contenteditable='true'`, serving as the primary editing surface. Must support `role='textbox'` and `aria-multiline='true'`. 2. **Comprehensive Toolbar (`data-testid='wysiwyg-toolbar'`):** * **Text Formatting:** Bold, Italic, Underline, Strikethrough, Subscript, Superscript. * **Block Formatting:** Paragraph, Heading Levels (H1-H6 via a dropdown/select). * **List Formatting:** Unordered List, Ordered List. * **Alignment:** Left, Center, Right, Justify. * **Links:** Create/Edit Hyperlink (should open a small modal to input URL and text). * **Image Upload (Simulated):** A button to 'Insert Image'. Clicking it should open a prompt/modal asking for an image URL. Upon providing a URL, the image is inserted into the editor content. Image should be resizable (basic handles or fixed size options). * **Table Insertion:** A button to 'Insert Table'. Opens a small modal/grid to select table dimensions (e.g., 3x2 grid). Inserts an empty, editable HTML table into the editor. * **Undo/Redo:** Buttons for undoing and redoing actions. 3. **Output:** A mechanism to get the HTML content of the editor (e.g., a button 'View HTML' that displays the editor's `innerHTML` in a `<pre>` tag or logs to console). **Technical & Accessibility Requirements:** * **Rich Text Engine:** MUST implement logic for applying and removing formatting using `document.execCommand` (understanding its limitations for a simulation is fine) or preferably by directly manipulating the DOM and selection ranges for more robust behavior. This is the core challenge. * **Toolbar Accessibility:** All toolbar buttons MUST be proper `<button>` elements, fully keyboard accessible, and use `aria-pressed` to indicate active states for toggleable formats (Bold, Italic). Dropdowns (e.g., for Headings) must follow ARIA menu/listbox patterns. * **Editor Accessibility:** The contenteditable area itself must be navigable. Semantic meaning of formatted text (e.g., headings are `<h1>`, lists are `<ul>`) must be preserved in the underlying HTML. * **Modals (for Links, Image, Table):** Must be accessible (trap focus, Escape to close, proper ARIA roles like `dialog`). * **Image and Table Manipulation:** Inserted images should be focusable and ideally have basic resizing. Inserted tables should allow typing into cells. * Responsive toolbar and editor area. * Styling: Tailwind CSS where appropriate, but significant custom CSS/JS will be required for the toolbar's appearance, button states, modal dialogs, and the editor's behavior (e.g., custom list styling if not using default, table cell borders within editor). **Testing Identifiers:** * Editable Content Area: `data-testid='wysiwyg-editor'` * Toolbar: `data-testid='wysiwyg-toolbar'` * Bold Button: `data-testid='toolbar-btn-bold'` * Heading Selector (dropdown/select): `data-testid='toolbar-select-heading'` * Insert Image Button: `data-testid='toolbar-btn-image'` * Insert Table Button: `data-testid='toolbar-btn-table'` * Link Modal (example input): `data-testid='link-modal-url-input'` * View HTML Output Area (if used): `data-testid='html-output-area'`
Key Links & Info
Analysis Timestamp: 05/17/2025 11:46:10
Scores for this Prompt
Technical Quality
135.3 / 190.0
(71.21%)
Prompt Adherence
22.0 / 24.0
(91.67%)
Overall Weighted
87.58 %
Technical Quality Breakdown
HTML Structure & Semantics (3.0 / 10.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
HTML Lang | PASS |
PASS
|
1.0 / 1.0 | desktop |
Page Title | PASS |
PASS
|
1.0 / 1.0 | desktop |
Main Tag | FAIL |
No visible <main>.
|
0.0 / 1.0 | desktop |
Nav Tag | WARN |
No visible <nav>.
|
0.0 / 1.0 | desktop |
Footer Tag | WARN |
No visible <footer>.
|
0.0 / 1.0 | desktop |
H1 Count | FAIL |
No visible headings.
|
0.0 / 1.0 | desktop |
Heading Order Logic | FAIL |
No visible headings.
|
0.0 / 1.0 | desktop |
Image Alts | INFO |
No visible images (INFO).
|
1.0 / 1.0 | desktop |
Form Labels | FAIL |
1 inputs unlabeled.
{ "unlabeled_count": 1 } |
0.0 / 2.0 | desktop |
CSS Quality (2.0 / 5.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
CSS Variables | WARN |
No :root CSS variables.
|
0.0 / 2.0 | desktop |
Modern Layout Body/Main | INFO |
Flex/Grid not on body/main.
|
0.0 / 1.0 | desktop |
Inline Styles | PASS |
Minimal inline styles.
|
1.0 / 1.0 | desktop |
!important Usage | PASS |
No !important in <style> tags.
|
1.0 / 1.0 | desktop |
JavaScript Health (5.0 / 5.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
JS Console Errors | PASS |
No significant JS errors.
|
5.0 / 5.0 | desktop |
Accessibility (Axe-core) (6.0 / 40.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Axe Violations | FAIL |
5 Axe violations (Crit:1,Ser:0,Mod:3,Min:1). Report: axe_report_FPC010_WYSIWYG_Rich_Text_Editor_with_Image_Upload_and_Tables_desktop.json
[ { "help": "ARIA role must be appropriate for the element", "id": "aria-allowed-role", "impact": "minor" }, { "help": "Form elements must have labels", "id": "label", "impact": "critical" }, { "help": "Page must have one main landmark", "id": "landmark-one-main", "impact": "moderate" }, { "help": "Page must contain a level-one heading", "id": "page-has-heading-one", "impact": "moderate" }, { "help": "All page content must be contained by landmarks", "id": "region", "impact": "moderate" } ] |
3.0 / 20.0 | desktop |
Axe Violations | FAIL |
5 Axe violations (Crit:1,Ser:0,Mod:3,Min:1). Report: axe_report_FPC010_WYSIWYG_Rich_Text_Editor_with_Image_Upload_and_Tables_mobile.json
[ { "help": "ARIA role must be appropriate for the element", "id": "aria-allowed-role", "impact": "minor" }, { "help": "Form elements must have labels", "id": "label", "impact": "critical" }, { "help": "Page must have one main landmark", "id": "landmark-one-main", "impact": "moderate" }, { "help": "Page must contain a level-one heading", "id": "page-has-heading-one", "impact": "moderate" }, { "help": "All page content must be contained by landmarks", "id": "region", "impact": "moderate" } ] |
3.0 / 20.0 | mobile |
Rendered Color & Contrast (30.0 / 30.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Contrast Check Result | PASS |
All 18 instances meet WCAG AA. (0 only AA, not AAA).
|
15.0 / 15.0 | desktop |
Contrast Check Result | PASS |
All 18 instances meet WCAG AA. (0 only AA, not AAA).
|
15.0 / 15.0 | mobile |
Responsiveness (Viewport & Scroll) (16.0 / 20.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Viewport Meta Tag | PASS |
Configured correctly for responsiveness.
|
4.0 / 4.0 | desktop |
Horizontal Scrollbar | PASS |
No horizontal scrollbar detected.
|
6.0 / 6.0 | desktop |
Viewport Meta Tag | INFO |
Already scored for this prompt.
|
0.0 / 0.0 | mobile |
Horizontal Scrollbar | PASS |
No horizontal scrollbar detected.
|
6.0 / 6.0 | mobile |
Performance (Lighthouse) (37.2 / 40.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Lighthouse Score | PASS |
94/100
|
18.8 / 20.0 | desktop |
Lighthouse Score | PASS |
92/100
|
18.4 / 20.0 | mobile |
Accessibility (Lighthouse) (17.5 / 20.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Lighthouse Score | PASS |
90/100
|
9.0 / 10.0 | desktop |
Lighthouse Score | WARN |
85/100
|
8.5 / 10.0 | mobile |
Best Practices (Lighthouse) (9.6 / 10.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Lighthouse Score | PASS |
96/100
|
4.8 / 5.0 | desktop |
Lighthouse Score | PASS |
96/100
|
4.8 / 5.0 | mobile |
SEO (Lighthouse) (9.0 / 10.0)
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
Lighthouse Score | PASS |
90/100
|
4.5 / 5.0 | desktop |
Lighthouse Score | PASS |
90/100
|
4.5 / 5.0 | mobile |
Prompt Adherence Breakdown
Check | Status | Message & Data | Points | Viewport |
---|---|---|---|---|
WYSIWYG Editor Area | PASS |
Element '[data-testid='wysiwyg-editor'][contenteditable='true'][role='textbox'][aria-multiline='true']' present and visible.
Selector:
[data-testid='wysiwyg-editor'][contenteditable='true'][role='textbox'][aria-multiline='true'] |
3.0 / 3.0 | desktop |
WYSIWYG Toolbar | PASS |
Element '[data-testid='wysiwyg-toolbar']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] |
2.0 / 2.0 | desktop |
Bold Button in Toolbar | PASS |
Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-bold']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-bold'] |
1.0 / 1.0 | desktop |
Heading Selector in Toolbar | PASS |
Element '[data-testid='wysiwyg-toolbar'] [data-testid='toolbar-select-heading']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] [data-testid='toolbar-select-heading'] |
1.0 / 1.0 | desktop |
Insert Image Button | PASS |
Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-image']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-image'] |
1.0 / 1.0 | desktop |
Insert Table Button | PASS |
Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-table']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-table'] |
1.0 / 1.0 | desktop |
Apply Bold and Check State | PASS |
All interaction steps/outcomes verified.
|
5.0 / 5.0 | desktop |
Insert H2 Heading (Simulated) | PASS |
All interaction steps/outcomes verified.
|
4.0 / 4.0 | desktop |
Insert Image (Simulated via Prompt) | PASS |
All interaction steps/outcomes verified.
|
4.0 / 4.0 | desktop |
Undo/Redo Buttons Exist | FAIL |
Custom script evaluation result: False (expected true).
Script Eval: False
|
0.0 / 2.0 | desktop |
WYSIWYG Editor Area | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-editor'][contenteditable='true'][role='textbox'][aria-multiline='true']' present and visible.
Selector:
[data-testid='wysiwyg-editor'][contenteditable='true'][role='textbox'][aria-multiline='true'] |
0.0 / 3.0 | mobile |
WYSIWYG Toolbar | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-toolbar']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] |
0.0 / 2.0 | mobile |
Bold Button in Toolbar | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-bold']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-bold'] |
0.0 / 1.0 | mobile |
Heading Selector in Toolbar | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-toolbar'] [data-testid='toolbar-select-heading']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] [data-testid='toolbar-select-heading'] |
0.0 / 1.0 | mobile |
Insert Image Button | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-image']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-image'] |
0.0 / 1.0 | mobile |
Insert Table Button | PASS |
(Points already awarded) Element '[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-table']' present and visible.
Selector:
[data-testid='wysiwyg-toolbar'] button[data-testid='toolbar-btn-table'] |
0.0 / 1.0 | mobile |
Apply Bold and Check State | PASS |
(Points already awarded) All interaction steps/outcomes verified.
|
0.0 / 5.0 | mobile |
Insert H2 Heading (Simulated) | PASS |
(Points already awarded) All interaction steps/outcomes verified.
|
0.0 / 4.0 | mobile |
Insert Image (Simulated via Prompt) | PASS |
(Points already awarded) All interaction steps/outcomes verified.
|
0.0 / 4.0 | mobile |
Undo/Redo Buttons Exist | FAIL |
Custom script evaluation result: False (expected true).
Script Eval: False
|
0.0 / 2.0 | mobile |