diff --git a/src/screens/EmailThreadScreen.tsx b/src/screens/EmailThreadScreen.tsx index f4ef59e6..65eb18f5 100644 --- a/src/screens/EmailThreadScreen.tsx +++ b/src/screens/EmailThreadScreen.tsx @@ -1032,6 +1032,8 @@ function EmailPane({ }: EmailPaneProps) { const c = useColors(); const t = useLocaleStore((s) => s.t); + // The quick reply box can be turned off (webmail #1370). + const quickReplyEnabled = useSettingsStore((s) => s.quickReplyEnabled); // Freeze the pane's vertical scroll while a pinch is in flight so a two- // finger zoom can't fling the page. const [pinching, setPinching] = React.useState(false); @@ -1286,7 +1288,7 @@ function EmailPane({ - {newest && newestLoaded && ( + {quickReplyEnabled && newest && newestLoaded && ( { // proxies them through its own server, so its default doesn't carry over. expect(useSettingsStore.getState().senderFavicons).toBe(false); }); + + // Quick reply could not be turned off (webmail #1370). On by default like + // the webmail, under the webmail's key so export and import carry it. + it('keeps the quick reply on by default and lets it be turned off', async () => { + expect(useSettingsStore.getState().quickReplyEnabled).toBe(true); + const { mergeWithDefaults, toExportShape } = await import('../settings-store'); + expect(mergeWithDefaults({ quickReplyEnabled: false }).quickReplyEnabled).toBe(false); + expect(toExportShape(useSettingsStore.getState())).toHaveProperty('quickReplyEnabled', true); + const fs = await import('node:fs'); + const path = await import('node:path'); + const screen = fs.readFileSync(path.resolve(__dirname, '../../screens/EmailThreadScreen.tsx'), 'utf8'); + expect(screen).toMatch(/\{quickReplyEnabled && newest && newestLoaded && \(/); + }); }); diff --git a/src/stores/settings-store.ts b/src/stores/settings-store.ts index 674a2fa3..15cc4ce2 100644 --- a/src/stores/settings-store.ts +++ b/src/stores/settings-store.ts @@ -309,6 +309,10 @@ interface PersistedSettings { // Hard cap on the on-disk body cache, in megabytes. When a sync pushes the // cache past this, the oldest messages are evicted to fit. offlineCacheMaxMB: number; + + // reader: the quick reply box under a conversation can be turned off + // (webmail #1370, same key as the webmail's for export/import). + quickReplyEnabled: boolean; } const DEFAULT_PERSISTED: PersistedSettings = { @@ -463,6 +467,9 @@ const DEFAULT_PERSISTED: PersistedSettings = { offlineCacheEnabled: false, offlineCacheDays: 7, offlineCacheMaxMB: 50, + + // reader: + quickReplyEnabled: true, }; export interface SettingsState extends PersistedSettings {