From f0b1255a3cd2672df06cf7d05561c2aefe8f65e3 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Wed, 18 Jun 2025 18:46:33 +0000 Subject: [PATCH 1/3] Apply 2 suggestion(s) to 2 file(s) --- src/components/settings_modal/tabs/notifications_tab.js | 2 +- src/components/user_card/user_card.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings_modal/tabs/notifications_tab.js b/src/components/settings_modal/tabs/notifications_tab.js index 76007773b..c53b5889d 100644 --- a/src/components/settings_modal/tabs/notifications_tab.js +++ b/src/components/settings_modal/tabs/notifications_tab.js @@ -18,7 +18,7 @@ const NotificationsTab = { }, canReceiveReports () { if (!this.user) { return false } - return this.user.privileges?.includes('reports_manage_reports') + return this.user.privileges.includes('reports_manage_reports') }, ...SharedComputedObject() }, diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index f4ae5f12e..55c76225c 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -136,7 +136,7 @@ export default { const privileges = this.loggedIn.privileges return this.loggedIn.role === 'admin' || privileges.includes('users_manage_activation_state') || - privileges.includes('users_delete')|| + privileges.includes('users_delete') || privileges.includes('users_manage_tags') }, hasNote () { From 97497b59457265110f47d9ee3433c352dbc3cb81 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 24 Jun 2025 15:56:08 +0300 Subject: [PATCH 2/3] bubble pin --- src/components/navigation/navigation_pins.js | 9 +++++++-- src/modules/instance.js | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/navigation/navigation_pins.js b/src/components/navigation/navigation_pins.js index 50acbbaf1..2d1922acb 100644 --- a/src/components/navigation/navigation_pins.js +++ b/src/components/navigation/navigation_pins.js @@ -9,6 +9,7 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { faUsers, faGlobe, + faCity, faBookmark, faEnvelope, faComments, @@ -25,6 +26,7 @@ import { useServerSideStorageStore } from 'src/stores/serverSideStorage' library.add( faUsers, faGlobe, + faCity, faBookmark, faEnvelope, faComments, @@ -65,7 +67,8 @@ const NavPanel = { followRequestCount: state => state.api.followRequests.length, privateMode: state => state.instance.private, federating: state => state.instance.federating, - pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable + pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable, + bubbleTimeline: state => state.instance.localBubbleInstances.length > 0 }), pinnedList () { if (!this.currentUser) { @@ -79,7 +82,8 @@ const NavPanel = { hasAnnouncements: this.supportsAnnouncements, isFederating: this.federating, isPrivate: this.privateMode, - currentUser: this.currentUser + currentUser: this.currentUser, + supportsBubbleTimeline: this.bubbleTimeline, }) } return filterNavigation( @@ -98,6 +102,7 @@ const NavPanel = { { hasChats: this.pleromaChatMessagesAvailable, hasAnnouncements: this.supportsAnnouncements, + supportsBubbleTimeline: this.bubbleTimeline, isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser diff --git a/src/modules/instance.js b/src/modules/instance.js index 98917e791..39d1fc662 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -163,6 +163,7 @@ const defaultState = { suggestionsWeb: '', quotingAvailable: false, groupActorAvailable: false, + localBubbleInstances: [], // Akkoma // Html stuff instanceSpecificPanelContent: '', From 187d43a4e57147b856f21a173d0f10f7a9b8159b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 24 Jun 2025 17:01:17 +0300 Subject: [PATCH 3/3] better handling of bookmarks --- src/components/nav_panel/nav_panel.js | 7 ++++--- src/components/navigation/filter.js | 3 ++- src/components/navigation/navigation.js | 11 ++++++++++- src/components/navigation/navigation_pins.js | 2 ++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index 2cdb4c45b..70d378e86 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -117,6 +117,8 @@ const NavPanel = { return filterNavigation( Object .entries({ ...TIMELINES }) + // do not show in timeliens list since it's in a better place now + .filter(([key]) => key !== 'bookmarks') .map(([k, v]) => ({ ...v, name: k })), { hasChats: this.pleromaChatMessagesAvailable, @@ -124,7 +126,6 @@ const NavPanel = { isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser, - supportsBookmarkFolders: this.bookmarkFolders, supportsBubbleTimeline: this.bubbleTimeline } ) @@ -140,8 +141,8 @@ const NavPanel = { isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser, - supportsBookmarkFolders: this.bookmarkFolders, - supportsBubbleTimeline: this.bubbleTimeline + supportsBubbleTimeline: this.bubbleTimeline, + supportsBookmarkFolders: this.bookmarkFolders } ) }, diff --git a/src/components/navigation/filter.js b/src/components/navigation/filter.js index 69d0b43cb..54abb67b4 100644 --- a/src/components/navigation/filter.js +++ b/src/components/navigation/filter.js @@ -15,8 +15,9 @@ export const filterNavigation = (list = [], { if ((!currentUser || !currentUser.locked) && set.has('lockedUser')) return false if (!hasChats && set.has('chats')) return false if (!hasAnnouncements && set.has('announcements')) return false - if (!supportsBookmarkFolders && set.has('supportsBookmarkFolders')) return false if (!supportsBubbleTimeline && set.has('supportsBubbleTimeline')) return false + if (!supportsBookmarkFolders && set.has('supportsBookmarkFolders')) return false + if (supportsBookmarkFolders && set.has('!supportsBookmarkFolders')) return false return true }) } diff --git a/src/components/navigation/navigation.js b/src/components/navigation/navigation.js index 80da8f52d..d1c2b6763 100644 --- a/src/components/navigation/navigation.js +++ b/src/components/navigation/navigation.js @@ -41,11 +41,11 @@ export const TIMELINES = { label: 'nav.twkn', criteria: ['!private', 'federating'] }, + // bookmarks are still technically a timeline so we should show it in the dropdown bookmarks: { route: 'bookmarks', icon: 'bookmark', label: 'nav.bookmarks', - criteria: ['supportsBookmarkFolders'] }, favorites: { routeObject: { name: 'user-profile', query: { tab: 'favorites' } }, @@ -60,6 +60,15 @@ export const TIMELINES = { } export const ROOT_ITEMS = { + bookmarks: { + route: 'bookmarks', + icon: 'bookmark', + label: 'nav.bookmarks', + // shows bookmarks entry in a better suited location + // hides it when bookmark folders are supported since + // we show custom component instead of it + criteria: ['!supportsBookmarkFolders'] + }, interactions: { route: 'interactions', icon: 'bell', diff --git a/src/components/navigation/navigation_pins.js b/src/components/navigation/navigation_pins.js index 2d1922acb..f9a900fc6 100644 --- a/src/components/navigation/navigation_pins.js +++ b/src/components/navigation/navigation_pins.js @@ -84,6 +84,7 @@ const NavPanel = { isPrivate: this.privateMode, currentUser: this.currentUser, supportsBubbleTimeline: this.bubbleTimeline, + supportsBookmarkFolders: this.bookmarks }) } return filterNavigation( @@ -103,6 +104,7 @@ const NavPanel = { hasChats: this.pleromaChatMessagesAvailable, hasAnnouncements: this.supportsAnnouncements, supportsBubbleTimeline: this.bubbleTimeline, + supportsBookmarkFolders: this.bookmarks, isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser