Adjust ProcessGit viewer height and prettify XML source#82
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d4271513b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (child.nodeType === Node.TEXT_NODE) { | ||
| const text = child.textContent?.trim(); | ||
| if (text) { | ||
| output.push(`${indent}${indentUnit}${text}`); |
There was a problem hiding this comment.
Preserve significant XML whitespace in raw view
The new XML formatter trims text nodes before emitting them, which removes leading/trailing spaces that are semantically significant in mixed-content XML (e.g., <p>Hello <b>world</b></p> loses the space after “Hello”). That means the “raw” panel no longer reflects the file contents and copy/paste from the viewer can change document meaning. This only occurs for .xml paths, but it will affect any XML that relies on whitespace. Consider preserving text nodes exactly or only normalizing indentation between elements.
Useful? React with 👍 / 👎.
Motivation
allow-modals, keepingsandbox="allow-scripts allow-forms"for safety.Description
web_src/js/features/processgitviewer/index.tstowidth: 100%,height: calc(100vh - 240px),border: 0, anddisplay: blockso the GUI fills the page height.templates/repo/view_file_processgit_viewer.tmplto wrap the mount withstyle="padding:0"and addstyle="min-height:calc(100vh - 240px)"on the mount container to allow the iframe to expand.formatXmlclient-side XML formatter (usesDOMParserand a small serializer) and apply it when loading raw source for files whose path ends with.xml.setRawContenthelper that detects aCodeMirror.setValueAPI and uses it when present, otherwise falls back to setting the<pre>element'stextContent, so syntax highlighting integrations are not broken.Testing
Codex Task