Skip to content

(feat) Add toggle for 3rd row message previews - #312

Open
brmiller wants to merge 1 commit into
maathimself:mainfrom
brmiller:disableMessagePreview
Open

(feat) Add toggle for 3rd row message previews#312
brmiller wants to merge 1 commit into
maathimself:mainfrom
brmiller:disableMessagePreview

Conversation

@brmiller

@brmiller brmiller commented Jul 25, 2026

Copy link
Copy Markdown

Summary

Per Issue #311 , add settings ability to disable message previews

Changes

Adds toggle to Settings | Appearance | Layout | Message List to disable message previews.

Testing

Included index.test.js (not sure if you do test files this way) to test local storage; live compile, re-deploy, re-run, manual testing of toggle on and off, displaying in different layout styles.

Contributor License Agreement

By submitting this pull request I confirm that:

  • I have read and agree to the Contributor License Agreement.
  • My contribution is my own original work (or I have identified any
    third-party material and confirmed it is compatible with the CLA).
  • I have the right to submit this contribution under the terms of the CLA.

@brmiller

Copy link
Copy Markdown
Author

Yes, I got excited and did not follow all the guidelines in the CONTRIBUTING.md. If you approve the idea of the issue, I will fix up my commit to use conventional commit style. I can also rename my branch if necessary.

@maathimself

Copy link
Copy Markdown
Owner

Thanks for this, two things currently fail the frontend test job (I ran npm test on the branch):

  1. The store test fails. node --test on store/index.test.js throws ERR_IMPORT_ATTRIBUTE_MISSING for locales/en.json: importing the store transitively pulls in en.json, which Vite handles but raw node --test (what CI uses) rejects without a type: json attribute. That's why there's no existing store test. Please drop store/index.test.js, or, if you want coverage, extract the toggle logic into a small pure helper and test that instead of importing the whole store.

  2. The new strings need every locale. The five new admin.messageList.* keys are only in en.json, which fails the existing i18n locale files test (it enforces key parity across locales) and leaves non-English users on English labels. Please add them to the other six (fr, es, it, de, ru, zh-CN).

With those two, npm test goes green. Two more for completeness:

  1. Gate the expanded-thread previews too. There are three snippet renders in MessageList.jsx; the PR gates ThreadRow and MessageRow but not the expanded-thread sub-rows (the {msg.snippet || ''} near line 4135). With previews off, expanding a thread still shows a preview per sub-message. Please wrap that one in showMessagePreviews as well.

  2. Persist the preference server-side. schedulePrefSave({ showMessagePreviews }) is sent, but PATCH /auth/preferences (backend/src/routes/auth.js) whitelists a fixed set of keys and doesn't include showMessagePreviews, so it's dropped: the toggle only lives in localStorage per device and won't sync across devices. Please add it alongside the sibling prefs (hoverQuickActions, showMobileAvatars) in that handler.

Appreciate you picking this up. Once those are in I'll re-review and get it merged.

@brmiller
brmiller force-pushed the disableMessagePreview branch from 6816be2 to 303517e Compare July 27, 2026 04:11
@brmiller

Copy link
Copy Markdown
Author
  1. The store test fails. node --test on store/index.test.js... Please drop store/index.test.js...

Dropped.

  1. The new strings need every locale. ... Please add them to the other six (fr, es, it, de, ru, zh-CN).

I am not a speaker of these languages. Rather than using a plain "google translate", I used an AI with some context of what I was doing and asked it to provide translations. Hopefully this is accurate. If not, let me know how I might get better translations.

  1. Gate the expanded-thread previews too. There are three snippet renders in MessageList.jsx; the PR gates ThreadRow and MessageRow but not the expanded-thread sub-rows (the {msg.snippet || ''} near line 4135).

Good catch! I did not know this feature did that as I do not use it. :D Should be fixed.

  1. Persist the preference server-side. schedulePrefSave({ showMessagePreviews }) is sent, but ... whitelists a fixed set of keys and doesn't include showMessagePreviews.

Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants