Fix pre-release issues with attachment viewer (#12244)

* Fix translation issues for "FIT" and "New Attachment" in attachment editor

* Fix markdown preview persistence and enable external links in attachment editor

* Update preview panel if manually moved from collapsed position

* Match edit view scroll position (by percentage) when changed. This ensures the preview remains in relative sync with the edited document, for example when a large amount of HTML reduces down to a short preview document.

* Fix default preview size to be half the width of the edit widget.

* Set tab stop to 10 and remove base ui file

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Copilot
2025-09-08 06:22:20 -04:00
committed by GitHub
parent ad2f95117a
commit dd023ca157
13 changed files with 126 additions and 77 deletions

View File

@@ -50,10 +50,18 @@ void TestTextAttachmentsWidget::testTextReadWriteWidget()
QCOMPARE(attachments.name, Test.name);
QCOMPARE(attachments.data, Test.data);
// Find preview widget and verify that it is in collapsed state
auto previewWidget = qobject_cast<TextAttachmentsPreviewWidget*>(splitter->widget(1));
QVERIFY(previewWidget);
attachments = previewWidget->getAttachment();
QCOMPARE(previewWidget->width(), 0);
// Show the preview widget
QTest::mouseClick(m_textWidget->findChild<QPushButton*>("previewPushButton"), Qt::LeftButton);
QCoreApplication::processEvents();
QVERIFY(previewWidget->width() > 0);
// Verify attachment data has been loaded in the preview
attachments = previewWidget->getAttachment();
QCOMPARE(attachments.name, Test.name);
QCOMPARE(attachments.data, Test.data);
}