Relocate sidebar settings from the Appearance tab to a new popover within the Sidebar

This commit is contained in:
pa
2026-02-14 20:04:48 +09:00
parent ad3346427f
commit 2e627ba6f5
7 changed files with 349 additions and 220 deletions
+12 -13
View File
@@ -305,26 +305,25 @@ export const useFriendStore = defineStore('Friend', () => {
function updateLocalFavoriteFriends() {
const favoriteStore = useFavoriteStore();
localFavoriteFriends.clear();
const groups = generalSettingsStore.localFavoriteFriendsGroups;
const hasRemoteGroupFilter = groups.some(
(key) => !key.startsWith('local:')
);
// Remote favorites: filter by selected remote groups
for (const ref of favoriteStore.cachedFavorites.values()) {
if (
ref.type === 'friend' &&
(generalSettingsStore.localFavoriteFriendsGroups.includes(
ref.$groupKey
) ||
generalSettingsStore.localFavoriteFriendsGroups.length ===
0)
(!hasRemoteGroupFilter || groups.includes(ref.$groupKey))
) {
localFavoriteFriends.add(ref.favoriteId);
}
}
for (const selectedKey of generalSettingsStore.localFavoriteFriendsGroups) {
if (selectedKey.startsWith('local:')) {
const groupName = selectedKey.slice(6);
const userIds = favoriteStore.localFriendFavorites[groupName];
if (userIds) {
for (let i = 0; i < userIds.length; ++i) {
localFavoriteFriends.add(userIds[i]);
}
// Local favorites: always include all
for (const groupName in favoriteStore.localFriendFavorites) {
const userIds = favoriteStore.localFriendFavorites[groupName];
if (userIds) {
for (let i = 0; i < userIds.length; ++i) {
localFavoriteFriends.add(userIds[i]);
}
}
}