this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Handle more filter context for notifications

+44 -37
+3 -1
src/components/notification.jsx
··· 460 460 const expandAccounts = diffCount ? 'remote' : 'local'; 461 461 462 462 // If there's a status and filter action is 'hide', then the notification is hidden 463 - // TODO: Handle 'warn' action one day 464 463 if (!!status?.filtered) { 465 464 const isOwnPost = status?.account?.id === currentAccount; 466 465 const filterInfo = isFiltered(status.filtered, 'notifications'); ··· 710 709 size="s" 711 710 previewMode 712 711 allowContextMenu 712 + allowFilters 713 713 /> 714 714 </TruncatedLink> 715 715 </li> ··· 749 749 size="s" 750 750 readOnly 751 751 allowContextMenu 752 + allowFilters 752 753 /> 753 754 ) : ( 754 755 <Status ··· 756 757 size="s" 757 758 readOnly 758 759 allowContextMenu 760 + allowFilters 759 761 /> 760 762 )} 761 763 </TruncatedLink>
+2 -2
src/components/status.jsx
··· 3679 3679 3680 3680 return ( 3681 3681 <div 3682 - class={ 3682 + class={`${ 3683 3683 quoted 3684 3684 ? '' 3685 3685 : isReblog ··· 3689 3689 : isFollowedTags 3690 3690 ? 'status-followed-tags' 3691 3691 : '' 3692 - } 3692 + } visibility-${visibility}`} 3693 3693 {...containerProps} 3694 3694 // title={statusPeekText} 3695 3695 onContextMenu={(e) => {
+1 -1
src/pages/filters.jsx
··· 18 18 import useTitle from '../utils/useTitle'; 19 19 20 20 const FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account']; 21 - const FILTER_CONTEXT_UNIMPLEMENTED = ['notifications', 'thread', 'account']; 21 + const FILTER_CONTEXT_UNIMPLEMENTED = ['thread', 'account']; 22 22 const FILTER_CONTEXT_LABELS = { 23 23 home: msg`Home and lists`, 24 24 notifications: msg`Notifications`,
+34 -31
src/pages/home.jsx
··· 14 14 import Notification from '../components/notification'; 15 15 import { api } from '../utils/api'; 16 16 import db from '../utils/db'; 17 + import FilterContext from '../utils/filter-context'; 17 18 import { massageNotifications2 } from '../utils/group-notifications'; 18 19 import states, { saveStatus } from '../utils/states'; 19 20 import { getCurrentAccountNS } from '../utils/store-utils'; ··· 185 186 <Trans>Notifications</Trans> 186 187 </h2> 187 188 </header> 188 - <main> 189 - {snapStates.notifications.length ? ( 190 - <> 191 - {snapStates.notifications 192 - .slice(0, NOTIFICATIONS_DISPLAY_LIMIT) 193 - .map((notification) => ( 194 - <Notification 195 - key={notification._ids || notification.id} 196 - instance={instance} 197 - notification={notification} 198 - disableContextMenu 199 - /> 200 - ))} 201 - </> 202 - ) : uiState === 'loading' ? ( 203 - <div class="ui-state"> 204 - <Loader abrupt /> 205 - </div> 206 - ) : ( 207 - uiState === 'error' && ( 189 + <FilterContext.Provider value="notifications"> 190 + <main> 191 + {snapStates.notifications.length ? ( 192 + <> 193 + {snapStates.notifications 194 + .slice(0, NOTIFICATIONS_DISPLAY_LIMIT) 195 + .map((notification) => ( 196 + <Notification 197 + key={notification._ids || notification.id} 198 + instance={instance} 199 + notification={notification} 200 + disableContextMenu 201 + /> 202 + ))} 203 + </> 204 + ) : uiState === 'loading' ? ( 208 205 <div class="ui-state"> 209 - <p> 210 - <Trans>Unable to fetch notifications.</Trans> 211 - </p> 212 - <p> 213 - <button type="button" onClick={loadNotifications}> 214 - <Trans>Try again</Trans> 215 - </button> 216 - </p> 206 + <Loader abrupt /> 217 207 </div> 218 - ) 219 - )} 220 - </main> 208 + ) : ( 209 + uiState === 'error' && ( 210 + <div class="ui-state"> 211 + <p> 212 + <Trans>Unable to fetch notifications.</Trans> 213 + </p> 214 + <p> 215 + <button type="button" onClick={loadNotifications}> 216 + <Trans>Try again</Trans> 217 + </button> 218 + </p> 219 + </div> 220 + ) 221 + )} 222 + </main> 223 + </FilterContext.Provider> 221 224 <footer> 222 225 <Link to="/mentions" class="button plain"> 223 226 <Icon icon="at" />{' '}
+1
src/pages/mentions.jsx
··· 175 175 useItemID 176 176 timelineStart={TimelineStart} 177 177 refresh={type} 178 + filterContext="notifications" 178 179 /> 179 180 ); 180 181 }
+3 -2
src/pages/notifications.jsx
··· 28 28 import Status from '../components/status'; 29 29 import { api } from '../utils/api'; 30 30 import enhanceContent from '../utils/enhance-content'; 31 + import FilterContext from '../utils/filter-context'; 31 32 import groupNotifications, { 32 33 groupNotifications2, 33 34 massageNotifications2, ··· 797 798 </p> 798 799 )} 799 800 {snapStates.notifications.length ? ( 800 - <> 801 + <FilterContext.Provider value="notifications"> 801 802 {snapStates.notifications 802 803 // This is leaked from Notifications popover 803 804 .filter((n) => n.type !== 'follow_request') ··· 843 844 </Fragment> 844 845 ); 845 846 })} 846 - </> 847 + </FilterContext.Provider> 847 848 ) : ( 848 849 <> 849 850 {uiState === 'loading' && (