detailed profiles info

This commit is contained in:
Julian Freeman
2026-04-16 17:50:33 -04:00
parent 33f43aac56
commit 65b9401726
9 changed files with 356 additions and 98 deletions

View File

@@ -6,7 +6,7 @@ import { useBrowserManager } from "./composables/useBrowserManager";
const {
activeSection,
bookmarkProfilesExpanded,
associatedProfilesModal,
bookmarkSortKey,
browserConfigs,
browserMonogram,
@@ -21,7 +21,6 @@ const {
domainFromUrl,
error,
extensionMonogram,
extensionProfilesExpanded,
extensionSortKey,
isDeletingConfig,
isOpeningProfile,
@@ -36,11 +35,12 @@ const {
savingConfig,
sectionCount,
selectedBrowserId,
showBookmarkProfilesModal,
showExtensionProfilesModal,
sortedBookmarks,
sortedExtensions,
sortedProfiles,
toggleBookmarkProfiles,
toggleExtensionProfiles,
closeAssociatedProfilesModal,
} = useBrowserManager();
</script>
@@ -109,16 +109,16 @@ const {
:section-count="sectionCount"
:is-opening-profile="isOpeningProfile"
:extension-monogram="extensionMonogram"
:extension-profiles-expanded="extensionProfilesExpanded"
:bookmark-profiles-expanded="bookmarkProfilesExpanded"
:domain-from-url="domainFromUrl"
:associated-profiles-modal="associatedProfilesModal"
@update:active-section="activeSection = $event"
@update:profile-sort-key="profileSortKey = $event"
@update:extension-sort-key="extensionSortKey = $event"
@update:bookmark-sort-key="bookmarkSortKey = $event"
@open-profile="(browserId, profileId) => openBrowserProfile(browserId, profileId)"
@toggle-extension-profiles="toggleExtensionProfiles"
@toggle-bookmark-profiles="toggleBookmarkProfiles"
@show-extension-profiles="showExtensionProfilesModal"
@show-bookmark-profiles="showBookmarkProfilesModal"
@close-associated-profiles="closeAssociatedProfilesModal"
/>
<template v-else>

View File

@@ -0,0 +1,188 @@
<script setup lang="ts">
import type {
AssociatedProfileSummary,
BookmarkAssociatedProfileSummary,
} from "../../types/browser";
type ModalProfile = AssociatedProfileSummary | BookmarkAssociatedProfileSummary;
defineProps<{
title: string;
profiles: ModalProfile[];
browserId: string;
isBookmark: boolean;
isOpeningProfile: (browserId: string, profileId: string) => boolean;
}>();
const emit = defineEmits<{
close: [];
openProfile: [browserId: string, profileId: string];
}>();
function hasBookmarkPath(
profile: ModalProfile,
): profile is BookmarkAssociatedProfileSummary {
return "bookmarkPath" in profile;
}
</script>
<template>
<div class="modal-backdrop" @click.self="emit('close')">
<section class="modal-card">
<div class="modal-header">
<h3>{{ title }}</h3>
<button class="secondary-button modal-close-button" type="button" @click="emit('close')">
Close
</button>
</div>
<div class="modal-list">
<article v-for="profile in profiles" :key="profile.id" class="modal-profile-card">
<div class="modal-profile-avatar">
<img
v-if="profile.avatarDataUrl"
:src="profile.avatarDataUrl"
:alt="`${profile.name} avatar`"
/>
<span v-else>{{ profile.avatarLabel }}</span>
</div>
<div class="modal-profile-body">
<div class="modal-profile-topline">
<div class="modal-profile-heading">
<h4>{{ profile.name }}</h4>
<span class="badge neutral">{{ profile.id }}</span>
</div>
<button
class="card-action-button"
type="button"
:disabled="isOpeningProfile(browserId, profile.id)"
@click="emit('openProfile', browserId, profile.id)"
>
{{ isOpeningProfile(browserId, profile.id) ? "Opening..." : "Open" }}
</button>
</div>
<p v-if="isBookmark && hasBookmarkPath(profile)" class="modal-bookmark-path">
{{ profile.bookmarkPath }}
</p>
</div>
</article>
</div>
</section>
</div>
</template>
<style scoped>
.modal-backdrop {
position: fixed;
inset: 0;
z-index: 40;
display: grid;
place-items: center;
padding: 24px;
background: rgba(15, 23, 42, 0.26);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
}
.modal-card {
width: min(720px, 100%);
max-height: min(78vh, 820px);
display: flex;
flex-direction: column;
gap: 14px;
padding: 16px;
border: 1px solid var(--panel-border);
border-radius: 22px;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.modal-header h3,
.modal-profile-heading h4 {
margin: 0;
font-weight: 600;
letter-spacing: -0.03em;
}
.modal-list {
display: flex;
flex-direction: column;
gap: 10px;
min-height: 0;
overflow: auto;
padding-right: 4px;
}
.modal-profile-card {
display: flex;
gap: 12px;
padding: 12px;
border: 1px solid rgba(148, 163, 184, 0.18);
border-radius: 16px;
background: var(--panel-strong);
}
.modal-profile-avatar {
display: grid;
place-items: center;
flex-shrink: 0;
width: 46px;
height: 46px;
border-radius: 14px;
background: linear-gradient(135deg, #dbeafe, #eff6ff);
color: #1d4ed8;
font-size: 1rem;
font-weight: 700;
overflow: hidden;
}
.modal-profile-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.modal-profile-body {
min-width: 0;
flex: 1;
}
.modal-profile-topline {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.modal-profile-heading {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.modal-bookmark-path {
margin: 8px 0 0;
color: var(--muted);
font-size: 0.86rem;
}
@media (max-width: 720px) {
.modal-backdrop {
padding: 12px;
}
.modal-profile-card,
.modal-profile-topline,
.modal-profile-heading {
flex-direction: column;
}
}
</style>

View File

@@ -6,12 +6,11 @@ defineProps<{
bookmarks: BookmarkSummary[];
sortKey: BookmarkSortKey;
domainFromUrl: (url: string) => string;
bookmarkProfilesExpanded: (url: string) => boolean;
}>();
const emit = defineEmits<{
"update:sortKey": [value: BookmarkSortKey];
toggleProfiles: [url: string];
showProfiles: [url: string];
}>();
</script>
@@ -41,23 +40,11 @@ const emit = defineEmits<{
<button
class="disclosure-button"
type="button"
@click="emit('toggleProfiles', bookmark.url)"
@click="emit('showProfiles', bookmark.url)"
>
<span>Profiles</span>
<span>View Profiles</span>
<span class="badge neutral">{{ bookmark.profileIds.length }}</span>
</button>
<div
v-if="bookmarkProfilesExpanded(bookmark.url)"
class="disclosure-panel"
>
<span
v-for="profileId in bookmark.profileIds"
:key="`${bookmark.url}-${profileId}`"
class="badge"
>
{{ profileId }}
</span>
</div>
</div>
</div>
</article>
@@ -125,13 +112,6 @@ const emit = defineEmits<{
cursor: pointer;
}
.disclosure-panel {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
}
@media (max-width: 720px) {
.bookmark-card {
flex-direction: column;

View File

@@ -1,11 +1,14 @@
<script setup lang="ts">
import type {
ActiveSection,
AssociatedProfileSummary,
BookmarkAssociatedProfileSummary,
BookmarkSortKey,
BrowserView,
ExtensionSortKey,
ProfileSortKey,
} from "../../types/browser";
import AssociatedProfilesModal from "./AssociatedProfilesModal.vue";
import BookmarksList from "./BookmarksList.vue";
import ExtensionsList from "./ExtensionsList.vue";
import ProfilesList from "./ProfilesList.vue";
@@ -23,9 +26,13 @@ defineProps<{
sectionCount: (section: ActiveSection) => number;
isOpeningProfile: (browserId: string, profileId: string) => boolean;
extensionMonogram: (name: string) => string;
extensionProfilesExpanded: (extensionId: string) => boolean;
bookmarkProfilesExpanded: (url: string) => boolean;
domainFromUrl: (url: string) => string;
associatedProfilesModal: {
title: string;
browserId: string;
profiles: (AssociatedProfileSummary | BookmarkAssociatedProfileSummary)[];
isBookmark: boolean;
} | null;
}>();
const emit = defineEmits<{
@@ -34,8 +41,9 @@ const emit = defineEmits<{
"update:extensionSortKey": [value: ExtensionSortKey];
"update:bookmarkSortKey": [value: BookmarkSortKey];
openProfile: [browserId: string, profileId: string];
toggleExtensionProfiles: [extensionId: string];
toggleBookmarkProfiles: [url: string];
showExtensionProfiles: [extensionId: string];
showBookmarkProfiles: [url: string];
closeAssociatedProfiles: [];
}>();
</script>
@@ -87,9 +95,8 @@ const emit = defineEmits<{
:extensions="sortedExtensions"
:sort-key="extensionSortKey"
:extension-monogram="extensionMonogram"
:extension-profiles-expanded="extensionProfilesExpanded"
@update:sort-key="emit('update:extensionSortKey', $event)"
@toggle-profiles="emit('toggleExtensionProfiles', $event)"
@show-profiles="emit('showExtensionProfiles', $event)"
/>
<BookmarksList
@@ -97,11 +104,21 @@ const emit = defineEmits<{
:bookmarks="sortedBookmarks"
:sort-key="bookmarkSortKey"
:domain-from-url="domainFromUrl"
:bookmark-profiles-expanded="bookmarkProfilesExpanded"
@update:sort-key="emit('update:bookmarkSortKey', $event)"
@toggle-profiles="emit('toggleBookmarkProfiles', $event)"
@show-profiles="emit('showBookmarkProfiles', $event)"
/>
</div>
<AssociatedProfilesModal
v-if="associatedProfilesModal"
:title="associatedProfilesModal.title"
:profiles="associatedProfilesModal.profiles"
:browser-id="associatedProfilesModal.browserId"
:is-bookmark="associatedProfilesModal.isBookmark"
:is-opening-profile="isOpeningProfile"
@close="emit('closeAssociatedProfiles')"
@open-profile="(browserId, profileId) => emit('openProfile', browserId, profileId)"
/>
</template>
<style scoped>

View File

@@ -6,12 +6,11 @@ defineProps<{
extensions: ExtensionSummary[];
sortKey: ExtensionSortKey;
extensionMonogram: (name: string) => string;
extensionProfilesExpanded: (extensionId: string) => boolean;
}>();
const emit = defineEmits<{
"update:sortKey": [value: ExtensionSortKey];
toggleProfiles: [extensionId: string];
showProfiles: [extensionId: string];
}>();
</script>
@@ -55,23 +54,11 @@ const emit = defineEmits<{
<button
class="disclosure-button"
type="button"
@click="emit('toggleProfiles', extension.id)"
@click="emit('showProfiles', extension.id)"
>
<span>Profiles</span>
<span>View Profiles</span>
<span class="badge neutral">{{ extension.profileIds.length }}</span>
</button>
<div
v-if="extensionProfilesExpanded(extension.id)"
class="disclosure-panel"
>
<span
v-for="profileId in extension.profileIds"
:key="`${extension.id}-${profileId}`"
class="badge"
>
{{ profileId }}
</span>
</div>
</div>
</div>
</article>
@@ -158,13 +145,6 @@ const emit = defineEmits<{
cursor: pointer;
}
.disclosure-panel {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
}
@media (max-width: 720px) {
.extension-card {
flex-direction: column;

View File

@@ -6,6 +6,8 @@ import { sortBookmarks, sortExtensions, sortProfiles } from "../utils/sort";
import type {
ActiveSection,
AppPage,
AssociatedProfileSummary,
BookmarkAssociatedProfileSummary,
BookmarkSortKey,
BrowserConfigEntry,
BrowserConfigListResponse,
@@ -36,8 +38,12 @@ export function useBrowserManager() {
});
const selectedBrowserId = ref("");
const activeSection = ref<ActiveSection>("profiles");
const expandedExtensionIds = ref<string[]>([]);
const expandedBookmarkUrls = ref<string[]>([]);
const associatedProfilesModal = ref<{
title: string;
browserId: string;
profiles: (AssociatedProfileSummary | BookmarkAssociatedProfileSummary)[];
isBookmark: boolean;
} | null>(null);
const profileSortKey = ref<ProfileSortKey>("name");
const extensionSortKey = ref<ExtensionSortKey>("name");
const bookmarkSortKey = ref<BookmarkSortKey>("title");
@@ -80,9 +86,8 @@ export function useBrowserManager() {
);
watch(selectedBrowserId, () => {
expandedExtensionIds.value = [];
expandedBookmarkUrls.value = [];
openProfileError.value = "";
associatedProfilesModal.value = null;
});
async function loadBrowserConfigs() {
@@ -272,24 +277,30 @@ export function useBrowserManager() {
return currentBrowser.value.bookmarks.length;
}
function toggleExtensionProfiles(extensionId: string) {
expandedExtensionIds.value = expandedExtensionIds.value.includes(extensionId)
? expandedExtensionIds.value.filter((id) => id !== extensionId)
: [...expandedExtensionIds.value, extensionId];
function showExtensionProfilesModal(extensionId: string) {
const extension = currentBrowser.value?.extensions.find((item) => item.id === extensionId);
if (!extension || !currentBrowser.value) return;
associatedProfilesModal.value = {
title: `${extension.name} Profiles`,
browserId: currentBrowser.value.browserId,
profiles: extension.profiles,
isBookmark: false,
};
}
function toggleBookmarkProfiles(url: string) {
expandedBookmarkUrls.value = expandedBookmarkUrls.value.includes(url)
? expandedBookmarkUrls.value.filter((value) => value !== url)
: [...expandedBookmarkUrls.value, url];
function showBookmarkProfilesModal(url: string) {
const bookmark = currentBrowser.value?.bookmarks.find((item) => item.url === url);
if (!bookmark || !currentBrowser.value) return;
associatedProfilesModal.value = {
title: `${bookmark.title} Profiles`,
browserId: currentBrowser.value.browserId,
profiles: bookmark.profiles,
isBookmark: true,
};
}
function extensionProfilesExpanded(extensionId: string) {
return expandedExtensionIds.value.includes(extensionId);
}
function bookmarkProfilesExpanded(url: string) {
return expandedBookmarkUrls.value.includes(url);
function closeAssociatedProfilesModal() {
associatedProfilesModal.value = null;
}
onMounted(() => {
@@ -298,7 +309,7 @@ export function useBrowserManager() {
return {
activeSection,
bookmarkProfilesExpanded,
associatedProfilesModal,
bookmarkSortKey,
browserConfigs,
browserMonogram,
@@ -313,7 +324,6 @@ export function useBrowserManager() {
domainFromUrl,
error,
extensionMonogram,
extensionProfilesExpanded,
extensionSortKey,
isDeletingConfig,
isOpeningProfile,
@@ -328,10 +338,11 @@ export function useBrowserManager() {
savingConfig,
sectionCount,
selectedBrowserId,
showBookmarkProfilesModal,
showExtensionProfilesModal,
sortedBookmarks,
sortedExtensions,
sortedProfiles,
toggleBookmarkProfiles,
toggleExtensionProfiles,
closeAssociatedProfilesModal,
};
}

View File

@@ -19,12 +19,29 @@ export type ExtensionSummary = {
version: string | null;
iconDataUrl: string | null;
profileIds: string[];
profiles: AssociatedProfileSummary[];
};
export type BookmarkSummary = {
url: string;
title: string;
profileIds: string[];
profiles: BookmarkAssociatedProfileSummary[];
};
export type AssociatedProfileSummary = {
id: string;
name: string;
avatarDataUrl: string | null;
avatarLabel: string;
};
export type BookmarkAssociatedProfileSummary = {
id: string;
name: string;
avatarDataUrl: string | null;
avatarLabel: string;
bookmarkPath: string;
};
export type ProfileSortKey = "name" | "email" | "id";