Add XML Formatter component and update styles #282#283
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new XmlFormatter React component, integrates it into DevTools routing and DevArea availability, and updates global input/textarea styles. The tool validates XML with DOMParser, formats valid XML with indentation, supports clear/reset, and is now selectable in the DevArea UI. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant DevArea as DevArea (Pages)
participant XmlFmt as XmlFormatter (Component)
participant Parser as DOMParser
participant Formatter as formatXml()
User->>DevArea: Select "XML Formatter"
DevArea->>XmlFmt: Render tool
User->>XmlFmt: Enter XML and click "Format"
XmlFmt->>Parser: parseFromString(xml, "application/xml")
alt Valid XML
Parser-->>XmlFmt: Parsed Document
XmlFmt->>Formatter: formatXml(parsed)
Formatter-->>XmlFmt: Indented XML string
XmlFmt-->>User: Display formatted output
else Invalid XML
Parser-->>XmlFmt: parsererror
XmlFmt-->>User: Show "❌ Invalid XML structure."
end
User->>XmlFmt: Click "Clear"
XmlFmt-->>User: Reset input and output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Implemented XmlFormatter component for formatting XML input. - Updated index.css to enhance textarea and input styles. - Registered XmlFormatter in DevTools and marked it as available in the DevArea.
Summary by CodeRabbit