Skip to content

Add New TextViewer#3036

Merged
fabiencastan merged 7 commits intodevelopfrom
copilot/add-text-viewer-functionality
Mar 18, 2026
Merged

Add New TextViewer#3036
fabiencastan merged 7 commits intodevelopfrom
copilot/add-text-viewer-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

Description

Two improvements to text file handling in the UI:

  1. TextFileViewer (the performant ListView-based viewer) now guards against auto-loading files >500 MB — showing a warning overlay with the explicit file size and a confirmation button instead of freezing the UI.
  2. TextViewer (the workspace viewer panel) was reimplemented on top of TextFileViewer instead of a raw ScrollView+TextArea, which had an effective ~50 MB load limit and none of the performance or UX features of TextFileViewer.

Features list

  • Files ≤500 MB load normally in TextFileViewer, including files previously blocked by the ~50 MB limit.
  • Files >500 MB display a centered warning overlay with the explicit size and a "Load File (X MB/GB)" confirmation button; no XHR load is attempted until confirmed.
  • TextViewer.qml now delegates all file loading and display to TextFileViewer, gaining: line-by-line rendering, built-in reload/scroll/copy toolbar, and the large-file guard above.
  • Top file-path bar in TextViewer (path display + copy-to-clipboard) is preserved.

Implementation remarks

TextFileViewer.qml

  • Added largeFileWarning, largeFileSizeMB, largeFileSizeStr (computed once), and confirmLargeLoad properties.
  • loadSource() checks Filepath.fileSizeMB(source) before issuing the XHR; if >500 MB and not yet confirmed, it shows the warning and returns early.
  • XHR logic extracted to _performLoad(), called after the size check passes or after the user confirms.
  • confirmLargeLoad resets on every source change so each new file gets a fresh check.

TextViewer.qml

  • Removed: fileContent, loading, load(), onSourceChanged, ScrollView+TextArea, BusyIndicator, placeholder label, and the redundant "Open Externally" toolbar button (already in TextFileViewer's sidebar).
  • Replaced the entire content area with TextFileViewer { source: root.source }.
  • Result is ~70 fewer lines; TextViewer is now a thin wrapper that adds only the top file-path context bar.
Original prompt

Create a new TextViewer, similar to the ImageViewer but for text files like .txt, .json, ... When we double click on a node with a text file in output display the text file in the new TextViewer.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add TextViewer for displaying text files Add TextViewer for displaying text file outputs from nodes Mar 10, 2026
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Add TextViewer for displaying text file outputs from nodes Add TextViewer and merge with ImageViewer into a shared tabbed panel Mar 10, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.09%. Comparing base (4dbae70) to head (403247a).
⚠️ Report is 31 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/node.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3036      +/-   ##
===========================================
+ Coverage    83.07%   83.09%   +0.01%     
===========================================
  Files           72       72              
  Lines         9657     9684      +27     
===========================================
+ Hits          8023     8047      +24     
- Misses        1634     1637       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Add TextViewer and merge with ImageViewer into a shared tabbed panel Merge ImageViewer and TextViewer into a shared tabbed panel with independent visibility controls Mar 11, 2026
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Merge ImageViewer and TextViewer into a shared tabbed panel with independent visibility controls View menu: separate ImageViewer/TextViewer toggles; open text-only node outputs in Text Viewer on double-click Mar 11, 2026
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title View menu: separate ImageViewer/TextViewer toggles; open text-only node outputs in Text Viewer on double-click Open text-only output nodes in Text Viewer on double-click; add 500 MB load guard to TextFileViewer Mar 11, 2026
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Open text-only output nodes in Text Viewer on double-click; add 500 MB load guard to TextFileViewer TextViewer: replace ScrollView+TextArea with TextFileViewer; add 500 MB load guard Mar 11, 2026
@fabiencastan fabiencastan marked this pull request as ready for review March 11, 2026 04:49
@fabiencastan fabiencastan changed the title TextViewer: replace ScrollView+TextArea with TextFileViewer; add 500 MB load guard Add New TextViewer Mar 11, 2026
@fabiencastan fabiencastan added the feature new feature (proposed as PR or issue planned by dev) label Mar 11, 2026
@fabiencastan fabiencastan added this to the Meshroom 2026.1.0 milestone Mar 11, 2026
@fabiencastan fabiencastan merged commit 63031e1 into develop Mar 18, 2026
4 checks passed
@fabiencastan fabiencastan deleted the copilot/add-text-viewer-functionality branch March 18, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new feature (proposed as PR or issue planned by dev)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants