mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-26 10:13:48 +02:00
improve favorites visibility ui
This commit is contained in:
@@ -111,6 +111,7 @@
|
|||||||
:key="group.key"
|
:key="group.key"
|
||||||
:class="[
|
:class="[
|
||||||
'group-item',
|
'group-item',
|
||||||
|
`group-item--${group.visibility}`,
|
||||||
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
||||||
]"
|
]"
|
||||||
@click="handleGroupClick('remote', group.key)">
|
@click="handleGroupClick('remote', group.key)">
|
||||||
@@ -125,9 +126,6 @@
|
|||||||
<span class="group-item__visibility-text">{{
|
<span class="group-item__visibility-text">{{
|
||||||
t(`view.favorite.visibility.${group.visibility}`)
|
t(`view.favorite.visibility.${group.visibility}`)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span
|
|
||||||
class="group-item__visibility-dot"
|
|
||||||
:class="avatarGroupVisibilityDotColors[group.visibility]"></span>
|
|
||||||
</span>
|
</span>
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
||||||
@@ -1622,10 +1620,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.group-item__visibility-dot {
|
.group-item__visibility-dot {
|
||||||
width: 7px;
|
display: none;
|
||||||
height: 7px;
|
}
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
.group-item--public {
|
||||||
|
border-left: 3px solid #22c55e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--friends {
|
||||||
|
border-left: 3px solid #0ea5e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--private {
|
||||||
|
border-left: 3px solid #ef4444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-item--placeholder {
|
.group-item--placeholder {
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
:key="group.key"
|
:key="group.key"
|
||||||
:class="[
|
:class="[
|
||||||
'group-item',
|
'group-item',
|
||||||
|
`group-item--${group.visibility}`,
|
||||||
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
||||||
]"
|
]"
|
||||||
@click="handleGroupClick('remote', group.key)">
|
@click="handleGroupClick('remote', group.key)">
|
||||||
@@ -127,9 +128,6 @@
|
|||||||
<span class="group-item__visibility-text">{{
|
<span class="group-item__visibility-text">{{
|
||||||
t(`view.favorite.visibility.${group.visibility}`)
|
t(`view.favorite.visibility.${group.visibility}`)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span
|
|
||||||
class="group-item__visibility-dot"
|
|
||||||
:class="friendGroupVisibilityDotColors[group.visibility]"></span>
|
|
||||||
</span>
|
</span>
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
||||||
@@ -568,6 +566,10 @@
|
|||||||
const newLocalGroupName = ref('');
|
const newLocalGroupName = ref('');
|
||||||
const newLocalGroupInput = ref(null);
|
const newLocalGroupInput = ref(null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
function handleSortFavoritesChange(value) {
|
function handleSortFavoritesChange(value) {
|
||||||
const next = Boolean(value);
|
const next = Boolean(value);
|
||||||
if (next !== sortFavorites.value) {
|
if (next !== sortFavorites.value) {
|
||||||
@@ -586,11 +588,17 @@
|
|||||||
friendToolbarMenuOpen.value = false;
|
friendToolbarMenuOpen.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function handleFriendImportClick() {
|
function handleFriendImportClick() {
|
||||||
closeFriendToolbarMenu();
|
closeFriendToolbarMenu();
|
||||||
showFriendImportDialog();
|
showFriendImportDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function handleFriendExportClick() {
|
function handleFriendExportClick() {
|
||||||
closeFriendToolbarMenu();
|
closeFriendToolbarMenu();
|
||||||
showFriendExportDialog();
|
showFriendExportDialog();
|
||||||
@@ -600,6 +608,9 @@
|
|||||||
loadFriendSplitterPreferences();
|
loadFriendSplitterPreferences();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function loadFriendSplitterPreferences() {
|
async function loadFriendSplitterPreferences() {
|
||||||
const storedSize = await configRepository.getString('VRCX_FavoritesFriendSplitter', '260');
|
const storedSize = await configRepository.getString('VRCX_FavoritesFriendSplitter', '260');
|
||||||
const parsedSize = Number(storedSize);
|
const parsedSize = Number(storedSize);
|
||||||
@@ -803,6 +814,10 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param visibility
|
||||||
|
*/
|
||||||
function getBadgeVariant(visibility) {
|
function getBadgeVariant(visibility) {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case 'public':
|
case 'public':
|
||||||
@@ -814,16 +829,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function showFriendExportDialog() {
|
function showFriendExportDialog() {
|
||||||
friendExportDialogVisible.value = true;
|
friendExportDialogVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function handleRefreshFavorites() {
|
function handleRefreshFavorites() {
|
||||||
refreshFavorites();
|
refreshFavorites();
|
||||||
getLocalWorldFavorites();
|
getLocalWorldFavorites();
|
||||||
getLocalFriendFavorites();
|
getLocalFriendFavorites();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param visible
|
||||||
|
*/
|
||||||
function handleGroupMenuVisible(key, visible) {
|
function handleGroupMenuVisible(key, visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
activeGroupMenu.value = key;
|
activeGroupMenu.value = key;
|
||||||
@@ -834,6 +860,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function ensureSelectedGroup() {
|
function ensureSelectedGroup() {
|
||||||
if (selectedGroup.value && isGroupAvailable(selectedGroup.value)) {
|
if (selectedGroup.value && isGroupAvailable(selectedGroup.value)) {
|
||||||
return;
|
return;
|
||||||
@@ -841,6 +870,9 @@
|
|||||||
selectDefaultGroup();
|
selectDefaultGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function selectDefaultGroup() {
|
function selectDefaultGroup() {
|
||||||
if (favoriteFriendGroups.value.length) {
|
if (favoriteFriendGroups.value.length) {
|
||||||
const nextGroup =
|
const nextGroup =
|
||||||
@@ -858,6 +890,10 @@
|
|||||||
clearSelectedFriends();
|
clearSelectedFriends();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function isGroupAvailable(group) {
|
function isGroupAvailable(group) {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
return false;
|
return false;
|
||||||
@@ -871,6 +907,11 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
function selectGroup(type, key) {
|
function selectGroup(type, key) {
|
||||||
if (selectedGroup.value?.type === type && selectedGroup.value?.key === key) {
|
if (selectedGroup.value?.type === type && selectedGroup.value?.key === key) {
|
||||||
return;
|
return;
|
||||||
@@ -879,10 +920,20 @@
|
|||||||
clearSelectedFriends();
|
clearSelectedFriends();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
function isGroupActive(type, key) {
|
function isGroupActive(type, key) {
|
||||||
return selectedGroup.value?.type === type && selectedGroup.value?.key === key;
|
return selectedGroup.value?.type === type && selectedGroup.value?.key === key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
function handleGroupClick(type, key) {
|
function handleGroupClick(type, key) {
|
||||||
if (hasSearchInput.value) {
|
if (hasSearchInput.value) {
|
||||||
friendFavoriteSearch.value = '';
|
friendFavoriteSearch.value = '';
|
||||||
@@ -891,6 +942,10 @@
|
|||||||
selectGroup(type, key);
|
selectGroup(type, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param searchTerm
|
||||||
|
*/
|
||||||
function doSearchFriendFavorites(searchTerm) {
|
function doSearchFriendFavorites(searchTerm) {
|
||||||
const search = searchTerm.trim().toLowerCase();
|
const search = searchTerm.trim().toLowerCase();
|
||||||
if (search.length < 3) {
|
if (search.length < 3) {
|
||||||
@@ -908,6 +963,11 @@
|
|||||||
}
|
}
|
||||||
const searchFriendFavorites = debounce(doSearchFriendFavorites, 200);
|
const searchFriendFavorites = debounce(doSearchFriendFavorites, 200);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
function toggleFriendSelection(id, value) {
|
function toggleFriendSelection(id, value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
if (!selectedFavoriteFriends.value.includes(id)) {
|
if (!selectedFavoriteFriends.value.includes(id)) {
|
||||||
@@ -918,10 +978,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function clearSelectedFriends() {
|
function clearSelectedFriends() {
|
||||||
selectedFavoriteFriends.value = [];
|
selectedFavoriteFriends.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function toggleSelectAllFriends() {
|
function toggleSelectAllFriends() {
|
||||||
if (!activeRemoteGroup.value) {
|
if (!activeRemoteGroup.value) {
|
||||||
return;
|
return;
|
||||||
@@ -933,6 +999,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function copySelectedFriends() {
|
function copySelectedFriends() {
|
||||||
if (!selectedFavoriteFriends.value.length) {
|
if (!selectedFavoriteFriends.value.length) {
|
||||||
return;
|
return;
|
||||||
@@ -942,6 +1011,9 @@
|
|||||||
showFriendImportDialog();
|
showFriendImportDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function showFriendBulkUnfavoriteSelectionConfirm() {
|
function showFriendBulkUnfavoriteSelectionConfirm() {
|
||||||
if (!selectedFavoriteFriends.value.length) {
|
if (!selectedFavoriteFriends.value.length) {
|
||||||
return;
|
return;
|
||||||
@@ -956,6 +1028,10 @@
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
function bulkUnfavoriteSelectedFriends(ids) {
|
function bulkUnfavoriteSelectedFriends(ids) {
|
||||||
if (isLocalGroupSelected.value && activeLocalGroupName.value) {
|
if (isLocalGroupSelected.value && activeLocalGroupName.value) {
|
||||||
ids.forEach((id) => {
|
ids.forEach((id) => {
|
||||||
@@ -972,6 +1048,10 @@
|
|||||||
friendEditMode.value = false;
|
friendEditMode.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
*/
|
||||||
function clearFavoriteGroup(ctx) {
|
function clearFavoriteGroup(ctx) {
|
||||||
modalStore
|
modalStore
|
||||||
.confirm({
|
.confirm({
|
||||||
@@ -989,21 +1069,38 @@
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
* @param visibility
|
||||||
|
*/
|
||||||
function handleVisibilitySelection(group, visibility) {
|
function handleVisibilitySelection(group, visibility) {
|
||||||
const menuKey = remoteGroupMenuKey(group.key);
|
const menuKey = remoteGroupMenuKey(group.key);
|
||||||
changeFriendGroupVisibility(group.name, visibility, menuKey);
|
changeFriendGroupVisibility(group.name, visibility, menuKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function handleRemoteRename(group) {
|
function handleRemoteRename(group) {
|
||||||
handleGroupMenuVisible(remoteGroupMenuKey(group.key), false);
|
handleGroupMenuVisible(remoteGroupMenuKey(group.key), false);
|
||||||
changeFavoriteGroupName(group);
|
changeFavoriteGroupName(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function handleRemoteClear(group) {
|
function handleRemoteClear(group) {
|
||||||
handleGroupMenuVisible(remoteGroupMenuKey(group.key), false);
|
handleGroupMenuVisible(remoteGroupMenuKey(group.key), false);
|
||||||
clearFavoriteGroup(group);
|
clearFavoriteGroup(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function changeFavoriteGroupName(group) {
|
function changeFavoriteGroupName(group) {
|
||||||
const currentName = group.displayName || group.name;
|
const currentName = group.displayName || group.name;
|
||||||
modalStore
|
modalStore
|
||||||
@@ -1042,6 +1139,12 @@
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @param visibility
|
||||||
|
* @param menuKey
|
||||||
|
*/
|
||||||
function changeFriendGroupVisibility(name, visibility, menuKey = null) {
|
function changeFriendGroupVisibility(name, visibility, menuKey = null) {
|
||||||
const params = {
|
const params = {
|
||||||
type: 'friend',
|
type: 'friend',
|
||||||
@@ -1064,6 +1167,10 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
function formatVisibility(value) {
|
function formatVisibility(value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return '';
|
return '';
|
||||||
@@ -1071,6 +1178,9 @@
|
|||||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function startLocalGroupCreation() {
|
function startLocalGroupCreation() {
|
||||||
isCreatingLocalGroup.value = true;
|
isCreatingLocalGroup.value = true;
|
||||||
newLocalGroupName.value = '';
|
newLocalGroupName.value = '';
|
||||||
@@ -1079,11 +1189,17 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function cancelLocalGroupCreation() {
|
function cancelLocalGroupCreation() {
|
||||||
isCreatingLocalGroup.value = false;
|
isCreatingLocalGroup.value = false;
|
||||||
newLocalGroupName.value = '';
|
newLocalGroupName.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function handleLocalGroupCreationConfirm() {
|
function handleLocalGroupCreationConfirm() {
|
||||||
const name = newLocalGroupName.value.trim();
|
const name = newLocalGroupName.value.trim();
|
||||||
if (!name) {
|
if (!name) {
|
||||||
@@ -1096,6 +1212,10 @@
|
|||||||
selectGroup('local', name);
|
selectGroup('local', name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function handleLocalRename(group) {
|
function handleLocalRename(group) {
|
||||||
handleGroupMenuVisible(localGroupMenuKey(group), false);
|
handleGroupMenuVisible(localGroupMenuKey(group), false);
|
||||||
modalStore
|
modalStore
|
||||||
@@ -1123,6 +1243,10 @@
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
*/
|
||||||
function handleLocalDelete(group) {
|
function handleLocalDelete(group) {
|
||||||
handleGroupMenuVisible(localGroupMenuKey(group), false);
|
handleGroupMenuVisible(localGroupMenuKey(group), false);
|
||||||
modalStore
|
modalStore
|
||||||
@@ -1280,10 +1404,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.group-item__visibility-dot {
|
.group-item__visibility-dot {
|
||||||
width: 7px;
|
display: none;
|
||||||
height: 7px;
|
}
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
.group-item--public {
|
||||||
|
border-left: 3px solid #22c55e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--friends {
|
||||||
|
border-left: 3px solid #0ea5e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--private {
|
||||||
|
border-left: 3px solid #ef4444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-item.is-active {
|
.group-item.is-active {
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
:key="group.key"
|
:key="group.key"
|
||||||
:class="[
|
:class="[
|
||||||
'group-item',
|
'group-item',
|
||||||
|
`group-item--${group.visibility}`,
|
||||||
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
{ 'is-active': !hasSearchInput && isGroupActive('remote', group.key) }
|
||||||
]"
|
]"
|
||||||
@click="handleGroupClick('remote', group.key)">
|
@click="handleGroupClick('remote', group.key)">
|
||||||
@@ -127,9 +128,6 @@
|
|||||||
<span class="group-item__visibility-text">{{
|
<span class="group-item__visibility-text">{{
|
||||||
t(`view.favorite.visibility.${group.visibility}`)
|
t(`view.favorite.visibility.${group.visibility}`)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span
|
|
||||||
class="group-item__visibility-dot"
|
|
||||||
:class="worldGroupVisibilityDotColors[group.visibility]"></span>
|
|
||||||
</span>
|
</span>
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
:open="activeGroupMenu === remoteGroupMenuKey(group.key)"
|
||||||
@@ -1500,10 +1498,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.group-item__visibility-dot {
|
.group-item__visibility-dot {
|
||||||
width: 7px;
|
display: none;
|
||||||
height: 7px;
|
}
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
.group-item--public {
|
||||||
|
border-left: 3px solid #22c55e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--friends {
|
||||||
|
border-left: 3px solid #0ea5e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-item--private {
|
||||||
|
border-left: 3px solid #ef4444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-item.is-active {
|
.group-item.is-active {
|
||||||
|
|||||||
Reference in New Issue
Block a user