Skip to content

Adjust ProcessGit viewer height and prettify XML source#82

Merged
rg4444 merged 1 commit into
mainfrom
codex/implement-iframe-height-adjustments
Feb 4, 2026
Merged

Adjust ProcessGit viewer height and prettify XML source#82
rg4444 merged 1 commit into
mainfrom
codex/implement-iframe-height-adjustments

Conversation

@rg4444
Copy link
Copy Markdown
Contributor

@rg4444 rg4444 commented Feb 4, 2026

Motivation

  • Make the embedded ProcessGit viewer use more of the page height so the iframe is less cramped and reaches near the bottom of the page.
  • Improve the View Source panel UX by pretty-printing XML client-side while preserving existing syntax highlighting behavior.
  • Preserve sandbox restrictions and avoid adding allow-modals, keeping sandbox="allow-scripts allow-forms" for safety.

Description

  • Set iframe styles in web_src/js/features/processgitviewer/index.ts to width: 100%, height: calc(100vh - 240px), border: 0, and display: block so the GUI fills the page height.
  • Update templates/repo/view_file_processgit_viewer.tmpl to wrap the mount with style="padding:0" and add style="min-height:calc(100vh - 240px)" on the mount container to allow the iframe to expand.
  • Add a formatXml client-side XML formatter (uses DOMParser and a small serializer) and apply it when loading raw source for files whose path ends with .xml.
  • Add setRawContent helper that detects a CodeMirror.setValue API and uses it when present, otherwise falls back to setting the <pre> element's textContent, so syntax highlighting integrations are not broken.

Testing

  • No automated tests were executed for this change.
  • Changes were committed locally; no CI or automated build/test run was reported in the rollout transcript.

Codex Task

@rg4444 rg4444 merged commit ee5439a into main Feb 4, 2026
4 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +119 to +122
if (child.nodeType === Node.TEXT_NODE) {
const text = child.textContent?.trim();
if (text) {
output.push(`${indent}${indentUnit}${text}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant