From 3be53f1ff96fcf9f5919d2782883a313eba0708a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 9 Aug 2024 10:34:43 +0800 Subject: [PATCH 1/5] Also set sort order when filter by Boosts in Catch-up --- src/pages/catchup.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/catchup.jsx b/src/pages/catchup.jsx index 8a63dfa1d..287209c4f 100644 --- a/src/pages/catchup.jsx +++ b/src/pages/catchup.jsx @@ -1259,6 +1259,7 @@ function Catchup() { setSelectedFilterCategory(label); if (label === 'Boosts') { setSortBy('reblogsCount'); + setSortOrder('desc'); setGroupBy(null); } // setSelectedAuthor(null); From 78ca5bbc0b428d03c3f21f8f8a299abd0728ddbf Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 9 Aug 2024 12:43:12 +0800 Subject: [PATCH 2/5] Fix prefs bug - Some prefs returned can be uppercased, so make them lowercase - `postingDefaultLanguage` probably doesn't work anymore every since masto.js upgrade. Sorry! - Add additional checks to make sure prefs from server are not in unexpected forms --- src/components/compose.jsx | 26 +++++++++++++++++++------- src/components/media-post.jsx | 2 +- src/components/status.jsx | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index ac01fe42d..e2bee5830 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -289,10 +289,14 @@ function Compose({ focusTextarea(); setVisibility( visibility === 'public' && prefs['posting:default:visibility'] - ? prefs['posting:default:visibility'] + ? prefs['posting:default:visibility'].toLowerCase() : visibility, ); - setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG); + setLanguage( + language || + prefs['posting:default:language']?.toLowerCase() || + DEFAULT_LANG, + ); setSensitive(sensitive && !!spoilerText); } else if (editStatus) { const { visibility, language, sensitive, poll, mediaAttachments } = @@ -316,7 +320,11 @@ function Compose({ focusTextarea(); spoilerTextRef.current.value = spoilerText; setVisibility(visibility); - setLanguage(language || presf.postingDefaultLanguage || DEFAULT_LANG); + setLanguage( + language || + prefs['posting:default:language']?.toLowerCase() || + DEFAULT_LANG, + ); setSensitive(sensitive); if (composablePoll) setPoll(composablePoll); setMediaAttachments(mediaAttachments); @@ -331,13 +339,13 @@ function Compose({ focusTextarea(); console.log('Apply prefs', prefs); if (prefs['posting:default:visibility']) { - setVisibility(prefs['posting:default:visibility']); + setVisibility(prefs['posting:default:visibility'].toLowerCase()); } if (prefs['posting:default:language']) { - setLanguage(prefs['posting:default:language']); + setLanguage(prefs['posting:default:language'].toLowerCase()); } if (prefs['posting:default:sensitive']) { - setSensitive(prefs['posting:default:sensitive']); + setSensitive(!!prefs['posting:default:sensitive']); } } if (draftStatus) { @@ -360,7 +368,11 @@ function Compose({ focusTextarea(); if (spoilerText) spoilerTextRef.current.value = spoilerText; if (visibility) setVisibility(visibility); - setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG); + setLanguage( + language || + prefs['posting:default:language']?.toLowerCase() || + DEFAULT_LANG, + ); if (sensitive !== null) setSensitive(sensitive); if (composablePoll) setPoll(composablePoll); if (mediaAttachments) setMediaAttachments(mediaAttachments); diff --git a/src/components/media-post.jsx b/src/components/media-post.jsx index 91ed67d7e..1de082b9c 100644 --- a/src/components/media-post.jsx +++ b/src/components/media-post.jsx @@ -108,7 +108,7 @@ function MediaPost({ const readingExpandMedia = useMemo(() => { // default | show_all | hide_all const prefs = store.account.get('preferences') || {}; - return prefs['reading:expand:media'] || 'default'; + return prefs['reading:expand:media']?.toLowerCase() || 'default'; }, []); const showSpoilerMedia = readingExpandMedia === 'show_all'; diff --git a/src/components/status.jsx b/src/components/status.jsx index 555f86b76..03c52a3b9 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -407,7 +407,7 @@ function Status({ // default | show_all | hide_all // Ignore hide_all because it means hide *ALL* media including non-sensitive ones const prefs = store.account.get('preferences') || {}; - return prefs['reading:expand:media'] || 'default'; + return prefs['reading:expand:media']?.toLowerCase() || 'default'; }, []); // FOR TESTING: // const readingExpandSpoilers = true; From ff29e93b4f1c61d3682dd480e52219caf263d1c7 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 9 Aug 2024 16:19:23 +0800 Subject: [PATCH 3/5] Fix RTL observer not working --- src/utils/is-rtl.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/is-rtl.js b/src/utils/is-rtl.js index 0a868f48d..5e4b5a4ed 100644 --- a/src/utils/is-rtl.js +++ b/src/utils/is-rtl.js @@ -4,12 +4,13 @@ let IS_RTL = false; const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'attributes') { - const { value } = mutation.target; - if (value === 'rtl') { + const { dir } = mutation.target; + if (dir === 'rtl') { IS_RTL = true; } else { IS_RTL = false; } + console.log({ IS_RTL }); // Fire custom event 'dirchange' on document // document.dispatchEvent(new Event('dirchange')); } From c27275a9afa9d5c841cf03b479a3137178668851 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 9 Aug 2024 23:07:03 +0800 Subject: [PATCH 4/5] Disable columns scroll snap for wider viewports --- src/app.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app.css b/src/app.css index 52245283c..71c74d834 100644 --- a/src/app.css +++ b/src/app.css @@ -2401,6 +2401,7 @@ ul.link-list li a .icon { /* COLUMNS */ #columns { + --column-size: 360px; display: flex; width: 100vw; overflow-y: hidden; @@ -2412,6 +2413,11 @@ ul.link-list li a .icon { overscroll-behavior-x: contain; /* This `transform` fixes horizontal scrolling for pointer devices on iPad */ transform: translateZ(0); + + /* 360px * 2 */ + @media (min-width: 720px) { + scroll-snap-type: none; + } } /* #columns::-webkit-scrollbar { display: none; @@ -2421,7 +2427,7 @@ ul.link-list li a .icon { scroll-snap-align: start; scroll-snap-stop: always; overscroll-behavior: auto; - flex-basis: min(100vw, 360px); + flex-basis: min(100vw, var(--column-size)); flex-shrink: 0; box-shadow: -1px 0 var(--bg-color), -2px 0 var(--drop-shadow-color), -3px 0 var(--bg-color); From 3f23fe6eb6506029eaeee83e357ae0c40cefb56c Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 10 Aug 2024 09:21:41 +0800 Subject: [PATCH 5/5] New post languages --- src/data/status-supported-languages.json | 32 +++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/data/status-supported-languages.json b/src/data/status-supported-languages.json index 495b9fa50..b587da904 100644 --- a/src/data/status-supported-languages.json +++ b/src/data/status-supported-languages.json @@ -534,6 +534,11 @@ "Malay", "Bahasa Melayu" ], + [ + "ms-Arab", + "Jawi Malay", + "بهاس ملايو" + ], [ "mt", "Maltese", @@ -626,7 +631,7 @@ ], [ "pa", - "Panjabi", + "Punjabi", "ਪੰਜਾਬੀ" ], [ @@ -949,6 +954,11 @@ "Montenegrin", "crnogorski" ], + [ + "csb", + "Kashubian", + "Kaszëbsczi" + ], [ "jbo", "Lojban", @@ -969,6 +979,21 @@ "Lingua Franca Nova", "lingua franca nova" ], + [ + "moh", + "Mohawk", + "Kanienʼkéha" + ], + [ + "nds", + "Low German", + "Plattdüütsch" + ], + [ + "pdc", + "Pennsylvania Dutch", + "Pennsilfaani-Deitsch" + ], [ "sco", "Scots", @@ -994,6 +1019,11 @@ "Toki Pona", "toki pona" ], + [ + "vai", + "Vai", + "ꕙꔤ" + ], [ "xal", "Kalmyk",