Skip to content

Add dedicated raw panel for ProcessGit viewer#80

Merged
rg4444 merged 1 commit into
mainfrom
codex/create-dedicated-raw-panel-for-viewer
Feb 4, 2026
Merged

Add dedicated raw panel for ProcessGit viewer#80
rg4444 merged 1 commit into
mainfrom
codex/create-dedicated-raw-panel-for-viewer

Conversation

@rg4444
Copy link
Copy Markdown
Contributor

@rg4444 rg4444 commented Feb 4, 2026

Motivation

  • The viewer previously reused Gitea's DOM to show raw source which hid the custom GUI when toggling and produced inconsistent "raw source" views.
  • Creating a dedicated raw mount and loading the file from the raw endpoint makes the behaviour deterministic and prevents the viewer from being toggled away by Gitea's DOM.
  • This simplifies the toggle logic and avoids fragile heuristics that attempted to locate external .file-view/pre elements.

Description

  • Updated the template templates/repo/view_file_processgit_viewer.tmpl to render a dedicated raw panel (#processgit-raw-mount with #processgit-raw-pre) alongside the GUI mount.
  • Updated web_src/js/features/processgitviewer/index.ts to select #processgit-raw-mount and #processgit-raw-pre, compute the primaryRawUrl from payload.entryRawUrl and payload.path, and add loadRawSource() which fetches the raw text using fetch(..., {credentials: 'same-origin'}).
  • Removed the previous DOM probing logic that attempted to find Gitea's raw panel, and replaced it with controlled showGui() / showRaw() toggles that switch between mount and rawMount and call loadRawSource() when showing raw.

Testing

  • No automated tests were run for this change.
  • Changes were committed and verified via static inspection of the modified files.
  • CI/test suite should validate runtime behaviour after deployment.

Codex Task

@rg4444 rg4444 merged commit 783c84d into main Feb 4, 2026
4 checks passed
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