From dd6f35b8f35f231ebf1511daef3dd707eaa9839d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 24 Aug 2026 11:02:08 +0200 Subject: fix(compose): default to quoting below, and focus the body on a reply The previous commit fixed the cursor within each quote_position branch and the user still saw the old layout, because the branches were already right: what was wrong was the DEFAULT. quote_position shipped as `above`, and the layout asked for is exactly what `below` already produced, a blank line at the top with the quote underneath. So the default flips, along with the fallback for a malformed value and the warning naming it. Nothing needs an Upgrading note: compose has not been released, so no config in the wild sets this. Focus goes to the body whenever To: is already filled, which a Reply and a Forward always are. The form's first widget took it otherwise, so the user had to click into the editor before typing. A New message keeps the default, since an empty To: is genuinely the first thing to fill in. The focus test asserts on the window's focusWidget() rather than on QWidget::hasFocus(): an unshown window is never active, so hasFocus() reads false whatever the code does and would fail against a correct fix. Both directions are mutation-checked, since focusing unconditionally passes the reply case while breaking the new-message one. --- tests/test_config.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/test_config.cpp') diff --git a/tests/test_config.cpp b/tests/test_config.cpp index a902425..c46b153 100644 --- a/tests/test_config.cpp +++ b/tests/test_config.cpp @@ -130,7 +130,7 @@ private slots: void garbageSendDelayIsRejectedNotZero(); void garbageAttachmentWarnBytesIsRejectedNotZero(); void zeroOrNegativeAutosaveIntervalIsClamped(); - void unrecognisedQuotePositionWarnsAndFallsBackToAbove(); + void unrecognisedQuotePositionWarnsAndFallsBackToBelow(); }; static QString writeIni(const QTemporaryDir &dir, const QString &body) @@ -2359,8 +2359,8 @@ void TestConfig::composeSettingsDefaultWhenTheSectionIsAbsent() config.load(writeIni(dir, QStringLiteral("[general]\n"))); const ComposeSettings compose = config.compose(); - QVERIFY2(compose.quotePosition == ComposeSettings::QuotePosition::Above, - "default quote position must be Above"); + QVERIFY2(compose.quotePosition == ComposeSettings::QuotePosition::Below, + "default quote position must be Below"); QVERIFY2(compose.sendHtml, "default send_html must be true"); QCOMPARE(compose.autosaveIntervalMs, 30000); QCOMPARE(compose.sendDelayMs, 5000); @@ -2492,7 +2492,7 @@ void TestConfig::zeroOrNegativeAutosaveIntervalIsClamped() .arg(negative.compose().autosaveIntervalMs))); } -void TestConfig::unrecognisedQuotePositionWarnsAndFallsBackToAbove() +void TestConfig::unrecognisedQuotePositionWarnsAndFallsBackToBelow() { // Matches the precedent set by sync_on_exit, language and date_format: // the only silent fallbacks in this file are for ABSENT keys, never for @@ -2503,8 +2503,8 @@ void TestConfig::unrecognisedQuotePositionWarnsAndFallsBackToAbove() "[compose]\n" "quote_position=abov\n"))); - QVERIFY2(config.compose().quotePosition == ComposeSettings::QuotePosition::Above, - "an unrecognised quote_position must still fall back to Above"); + QVERIFY2(config.compose().quotePosition == ComposeSettings::QuotePosition::Below, + "an unrecognised quote_position must still fall back to Below"); QVERIFY2(!config.problems().isEmpty(), "an unrecognised quote_position was accepted silently"); } -- cgit v1.2.3