mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-03 08:06:59 +00:00
feat: let the quick reply under a conversation be turned off (bulwarkmail/webmail#1370)
This commit is contained in:
@@ -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({
|
||||
</View>
|
||||
|
||||
<View style={styles.quickReplySlot}>
|
||||
{newest && newestLoaded && (
|
||||
{quickReplyEnabled && newest && newestLoaded && (
|
||||
<QuickReplyBox
|
||||
email={newest}
|
||||
jmapAccountId={jmapAccountId}
|
||||
|
||||
@@ -17,4 +17,17 @@ describe('settings defaults (reader pass)', () => {
|
||||
// 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 && \(/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user