Files
dragonroll/frontend/app/components/partials/ContentSidebar.vue
Gitea OpenCode Agent 8348936122
All checks were successful
Test / test (push) Successful in 2s
Fix issue #41: Clicking button of actors on sidebar not change map or notes
2026-10-14 22:30:17 +00:00

713 lines
28 KiB
Vue

<script setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useCampaignService } from '~/services/Campaign.js';
import { AnchorMap, AnchoredMap, ClearAnchoredMap, SetActivePane } from '~/services/Content.js';
import { emitter } from '~/services/Emitter';
import Server from '~/services/Server';
import { ClearWindow, CreateWindow, GetFirstWindowId } from '~/services/Windows';
import { HideContextMenu, ShowContextMenu } from '~/services/ContextMenu';
import { ACTOR_DRAG_TYPE } from '~/services/MapTokens';
import NestedNoteList from './NestedNoteList.vue';
const { Campaign } = useCampaignService();
const { t } = useI18n();
const notes = ref([]);
const folders = ref([]);
const actors = ref([]);
const items = ref([]);
const maps = ref([]);
const entryLists = { actor: actors, item: items, map: maps };
const loadingNotes = ref(false);
const loadingEntries = ref(false);
const notesError = ref('');
const entriesError = ref('');
const sidebarCollapsed = ref(false);
const activeSection = ref('notes');
const isDragOverSidebar = ref(false);
const expandedFolderIds = ref([]);
const nestedNoteListRef = ref(null);
let entryRefreshInterval;
async function handleSidebarDrop(event) {
if (activeSection.value !== 'notes') return;
const noteKey = event.dataTransfer.getData('text/plain');
if (!noteKey) return;
try {
await Server().post('/note/update', { id: noteKey, folder: null });
if (nestedNoteListRef.value) {
nestedNoteListRef.value.clearCacheAndReloadExpanded();
} else {
fetchCampaignNotes();
}
} catch (e) {}
}
// An actor row is dragged out of the sidebar onto a map, where it stands as a token. The map viewer
// reads that type back on its drop (see MapViewerPane.vue); a note drag carries 'text/plain'
// instead, so the two never land where the other belongs.
function startActorDrag(event, actor) {
event.dataTransfer.setData(ACTOR_DRAG_TYPE, String(actor._id));
event.dataTransfer.effectAllowed = 'copyMove';
}
function toggleExpandedFolder(folderId) {
const arr = expandedFolderIds.value;
const idx = arr.indexOf(folderId);
if (idx !== -1) {
arr.splice(idx, 1);
} else {
arr.push(folderId);
}
}
function isFolderExpanded(folderId) {
return expandedFolderIds.value.includes(folderId);
}
function openNote(note) {
emitter.emit('push-note', note);
}
function handleNoteCreated(note) {
if (!note) return;
const noteCampaignId = note.campaign?._id ?? note.campaign ?? null;
if (campaignId.value && noteCampaignId && noteCampaignId !== campaignId.value) return;
const createdNote = {
key: note._id,
title: note.title,
text: note.content ?? '',
date: note.date
};
notes.value = notes.value.filter((currentNote) => currentNote.key !== createdNote.key);
// Notes created inside a folder are added by NestedNoteList's own cache handler
const noteFolderId = note.folder?._id ?? note.folder ?? null;
if (!noteFolderId) {
notes.value.unshift(createdNote);
}
openNote(createdNote);
}
function handleNoteRenamed(data) {
const note = notes.value.find(n => n.key === data.key);
if (note) {
note.title = data.title;
}
emitter.emit('title-updated', { key: data.key, title: data.title });
}
function handleNoteDeleted(noteKey) {
notes.value = notes.value.filter(n => n.key !== noteKey);
}
function handleFolderSaved() {
fetchCampaignNotes();
}
function handleFolderDeleted(folderId) {
expandedFolderIds.value = expandedFolderIds.value.filter((id) => id !== folderId);
}
function handleCampaignEntryCreated({ entityType, entry }) {
if (!entry || (entry.campaign && String(entry.campaign) !== String(campaignId.value))) return;
const list = entryLists[entityType];
if (!list) return;
list.value = [...list.value.filter((current) => current._id !== entry._id), entry]
.sort((a, b) => a.name.localeCompare(b.name));
}
function handleCampaignEntryUpdated({ entityType, entry }) {
if (!entry) return;
const list = entryLists[entityType];
if (!list) return;
list.value = list.value.map((current) => current._id === entry._id ? entry : current)
.sort((a, b) => a.name.localeCompare(b.name));
// The anchored map is this very entry (its pins changed, say): write it back without touching
// the pane, so switching back from the notes still shows what is on the map.
if (entityType === 'map' && AnchoredMap.value?._id === entry._id) AnchoredMap.value = entry;
}
const campaignId = computed(() => {
return Campaign.value?._id ?? Campaign.value?.id ?? null;
});
async function fetchCampaignNotes() {
if (!campaignId.value) {
notes.value = [];
folders.value = [];
notesError.value = '';
return;
}
loadingNotes.value = true;
notesError.value = '';
try {
const response = await Server().get('/note/list', { params: { campaign: campaignId.value } });
if (response.data.status !== 'ok') {
notes.value = [];
folders.value = [];
notesError.value = response.data.msg ?? 'Unable to load notes.';
return;
}
folders.value = response.data.folders.map((folder) => ({
_id: folder._id, name: folder.name, date: folder.date, color: folder.color
}));
notes.value = response.data.notes.map((note) => {
return { key: note._id, title: note.title, text: note.content ?? '', date: note.date, color: note.color };
});
} catch (error) {
notes.value = [];
folders.value = [];
notesError.value = 'Unable to load notes.';
} finally {
loadingNotes.value = false;
}
}
function entryEntityType(section) {
if (section === 'actors') return 'actor';
if (section === 'items') return 'item';
if (section === 'maps') return 'map';
return null;
}
function isEntrySection(section) {
return entryEntityType(section) !== null;
}
async function fetchCampaignEntries(entityType = activeSection.value, silent = false) {
const kind = entryEntityType(entityType);
const list = entryLists[kind];
if (!campaignId.value || !list) return;
if (!silent) {
loadingEntries.value = true;
entriesError.value = '';
}
try {
const response = await Server().get(`/${kind}/list`, { params: { campaign: campaignId.value } });
if (response.data.status !== 'ok') {
if (!silent) entriesError.value = response.data.msg ?? t('campaigns.errors.load');
return;
}
const previousById = new Map(list.value.map((entry) => [entry._id, entry]));
list.value = response.data[entityType] ?? [];
// Tell open windows about Foundry changes landing behind them.
for (const entry of list.value) {
const previous = previousById.get(entry._id);
if (previous && JSON.stringify(previous) !== JSON.stringify(entry)) {
emitter.emit('campaign-entry-updated', { entityType: kind, entry });
}
}
} catch (error) {
if (!silent) entriesError.value = t('campaigns.errors.load');
} finally {
if (!silent) loadingEntries.value = false;
}
}
function selectSection(section) {
activeSection.value = section;
if (isEntrySection(section)) fetchCampaignEntries(section);
// Only the notes and maps buttons say something about the note container: they switch it between
// the notes that are open and the anchored map. Actors and items open windows of their own, so
// their buttons leave whatever the note container was showing untouched.
if (section === 'notes') SetActivePane('notes');
else if (section === 'maps' && AnchoredMap.value) SetActivePane('map');
}
function createEntry(entityType) {
if (!campaignId.value) return;
if (entityType === 'map') {
CreateWindow('create_map', { campaign: campaignId.value });
return;
}
CreateWindow('create_campaign_entry', { entityType, campaign: campaignId.value });
}
function entrySummary(actor) {
const bits = [t(`campaigns.actor.types.${actor.type}`)];
if (actor.species) bits.push(actor.species);
if (actor.className) bits.push(actor.className);
if (actor.level) bits.push(`${t('campaigns.actor.level-short')} ${actor.level}`);
if (actor.challengeRating) bits.push(`${t('campaigns.actor.cr-short')} ${actor.challengeRating}`);
return bits.join(' · ');
}
function itemSummary(item) {
return `${t(`campaigns.item.categories.${item.category}`)} · ${t(`campaigns.item.rarities.${item.rarity}`)} · ${t('campaigns.item.quantity-short')} ${item.quantity}`;
}
function mapSummary(map) {
return t('campaigns.map.summary', { size: map.gridSize, scale: map.scale });
}
function editItem(entry) {
if (!campaignId.value) return;
CreateWindow('create_campaign_entry', { entityType: 'item', campaign: campaignId.value, entry });
}
function editMap(map) {
if (!campaignId.value) return;
CreateWindow('create_map', { campaign: campaignId.value, entry: map });
}
function showEntryMenu(entry, entityType) {
const list = entryLists[entityType];
const menuItems = [];
// Characters are edited in their sheet; items and maps get their window in edit mode.
if (entityType === 'item') {
menuItems.push({
name: t('campaigns.actions.edit'),
icon: '/icons/iconoir/regular/edit.svg',
action: () => { HideContextMenu(); editItem(entry); }
});
} else if (entityType === 'map') {
menuItems.push({
name: t('campaigns.actions.edit'),
icon: '/icons/iconoir/regular/edit.svg',
action: () => { HideContextMenu(); editMap(entry); }
});
}
menuItems.push({
name: t('campaigns.actions.delete'),
icon: '/icons/iconoir/regular/trash.svg',
action: async () => {
try {
const response = await Server().post(`/${entityType}/delete`, { id: entry._id });
if (response.data.status === 'ok' && list) {
list.value = list.value.filter((current) => current._id !== entry._id);
if (entityType === 'map' && isAnchoredMap(entry)) ClearAnchoredMap();
}
} catch (error) {} finally { HideContextMenu(); }
}
});
ShowContextMenu(menuItems);
}
async function openCharacterSheet(actor) {
const existingWindowId = GetFirstWindowId('character_sheet');
if (existingWindowId !== undefined) {
ClearWindow({ id: existingWindowId });
await nextTick();
}
CreateWindow('character_sheet', { actor });
}
// Clicking an item opens its window, like a character does with its sheet.
async function openItemSheet(item) {
const existingWindowId = GetFirstWindowId('item_sheet');
if (existingWindowId !== undefined) {
ClearWindow({ id: existingWindowId });
await nextTick();
}
CreateWindow('item_sheet', { item });
}
// Maps are anchored on the note container instead of opening a window: the notes that were open
// stay open, and the sidebar's notes/maps buttons switch between the two.
function openMapViewer(map) {
if (!map) return;
const floatingViewer = GetFirstWindowId('map_viewer');
if (floatingViewer !== undefined) ClearWindow({ id: floatingViewer });
AnchorMap(map);
}
function isAnchoredMap(map) {
return AnchoredMap.value?._id === map._id;
}
function createNote() {
if (!Campaign.value) return;
CreateWindow('new_note', { campaign: campaignId.value });
}
function createFolder() {
CreateWindow('new_folder', { campaign: campaignId.value });
}
function toggleSidebar() {
sidebarCollapsed.value = !sidebarCollapsed.value;
}
const rootNotes = computed(() => notes.value.filter(n => !n._folder));
watch(campaignId, (newVal) => {
if (newVal) {
actors.value = [];
items.value = [];
maps.value = [];
ClearAnchoredMap();
fetchCampaignNotes();
if (isEntrySection(activeSection.value)) fetchCampaignEntries(activeSection.value);
} else {
notes.value = [];
folders.value = [];
actors.value = [];
items.value = [];
maps.value = [];
notesError.value = '';
entriesError.value = '';
ClearAnchoredMap();
}
});
onMounted(() => {
emitter.on('note-created', handleNoteCreated);
emitter.on('note-renamed', handleNoteRenamed);
emitter.on('delete-note', handleNoteDeleted);
emitter.on('folder-saved', handleFolderSaved);
emitter.on('folder-deleted', handleFolderDeleted);
emitter.on('campaign-entry-created', handleCampaignEntryCreated);
emitter.on('campaign-entry-updated', handleCampaignEntryUpdated);
if (campaignId.value) {
fetchCampaignNotes();
}
entryRefreshInterval = setInterval(() => {
// Synced Foundry entries land in the background for both lists.
if ((activeSection.value === 'actors' || activeSection.value === 'items') && campaignId.value) {
fetchCampaignEntries(activeSection.value, true);
}
}, 5000);
});
onBeforeUnmount(() => {
clearInterval(entryRefreshInterval);
emitter.off('note-created', handleNoteCreated);
emitter.off('note-renamed', handleNoteRenamed);
emitter.off('delete-note', handleNoteDeleted);
emitter.off('folder-saved', handleFolderSaved);
emitter.off('folder-deleted', handleFolderDeleted);
emitter.off('campaign-entry-created', handleCampaignEntryCreated);
emitter.off('campaign-entry-updated', handleCampaignEntryUpdated);
});
</script>
<template>
<div class="sidebar-shell">
<nav class="sidebar-actions" aria-label="Campaign tools">
<button
class="sidebar-action"
type="button"
@click="toggleSidebar"
:aria-expanded="(!sidebarCollapsed).toString()"
aria-controls="campaign-section-list"
:title="sidebarCollapsed ? t('campaigns.actions.expand-sidebar') : t('campaigns.actions.collapse-sidebar')"
:aria-label="sidebarCollapsed ? t('campaigns.actions.expand-sidebar') : t('campaigns.actions.collapse-sidebar')"
>
<img
class="sidebar-action-icon"
:src="sidebarCollapsed ? '/icons/iconoir/regular/nav-arrow-right.svg' : '/icons/iconoir/regular/nav-arrow-left.svg'"
alt=""
aria-hidden="true"
>
</button>
<button
class="sidebar-action"
:class="{ selected: activeSection === 'notes' }"
type="button" @click="selectSection('notes')"
:title="t('campaigns.sections.notes')" :aria-label="t('campaigns.sections.notes')"
:aria-pressed="(activeSection === 'notes').toString()"
>
<img class="sidebar-action-icon" src="/icons/iconoir/regular/book.svg" alt="" aria-hidden="true">
</button>
<button
class="sidebar-action"
:class="{ selected: activeSection === 'actors' }"
type="button" @click="selectSection('actors')"
:title="t('campaigns.sections.actors')" :aria-label="t('campaigns.sections.actors')"
:aria-pressed="(activeSection === 'actors').toString()"
>
<img class="sidebar-action-icon" src="/icons/iconoir/regular/user.svg" alt="" aria-hidden="true">
</button>
<button
class="sidebar-action"
:class="{ selected: activeSection === 'items' }"
type="button" @click="selectSection('items')"
:title="t('campaigns.sections.items')" :aria-label="t('campaigns.sections.items')"
:aria-pressed="(activeSection === 'items').toString()"
>
<img class="sidebar-action-icon" src="/icons/iconoir/regular/box.svg" alt="" aria-hidden="true">
</button>
<button
class="sidebar-action"
:class="{ selected: activeSection === 'maps' }"
type="button" @click="selectSection('maps')"
:title="t('campaigns.sections.maps')" :aria-label="t('campaigns.sections.maps')"
:aria-pressed="(activeSection === 'maps').toString()"
>
<img class="sidebar-action-icon" src="/icons/iconoir/regular/map.svg" alt="" aria-hidden="true">
</button>
</nav>
<aside class="notes-sidebar" :class="{ collapsed: sidebarCollapsed }">
<div class="sidebar-header">
<div class="sidebar-copy">
<span class="sidebar-eyebrow">{{ t('campaigns.sidebar-label') }}</span>
<strong class="sidebar-title">{{ t(`campaigns.sections.${activeSection}`) }}</strong>
</div>
<div class="sidebar-header-actions">
<template v-if="activeSection === 'notes'">
<button class="sidebar-action" type="button" @click="createNote" :disabled="!Campaign" :title="t('campaigns.actions.new-note')" :aria-label="t('campaigns.actions.new-note')">
<img class="sidebar-action-icon" src="/icons/iconoir/regular/plus.svg" alt="" aria-hidden="true">
</button>
<button class="sidebar-action" type="button" @click="createFolder" :disabled="!Campaign" :title="t('campaigns.actions.new-folder')" :aria-label="t('campaigns.actions.new-folder')">
<img class="sidebar-action-icon" src="/icons/iconoir/regular/folder.svg" alt="" aria-hidden="true">
</button>
<button class="sidebar-action" type="button" @click="fetchCampaignNotes" :disabled="!Campaign || loadingNotes" :title="t('campaigns.actions.refresh')" :aria-label="t('campaigns.actions.refresh')">
<img class="sidebar-action-icon" src="/icons/iconoir/regular/refresh.svg" alt="" aria-hidden="true">
</button>
</template>
<template v-else>
<button class="sidebar-action" type="button" @click="createEntry(entryEntityType(activeSection))" :disabled="!Campaign" :title="t('campaigns.actions.create', { section: t(`campaigns.sections.${activeSection}`).toLowerCase() })" :aria-label="t('campaigns.actions.create', { section: t(`campaigns.sections.${activeSection}`).toLowerCase() })">
<img class="sidebar-action-icon" src="/icons/iconoir/regular/plus.svg" alt="" aria-hidden="true">
</button>
<button class="sidebar-action" type="button" @click="fetchCampaignEntries(activeSection)" :disabled="!Campaign || loadingEntries" :title="t('campaigns.actions.refresh')" :aria-label="t('campaigns.actions.refresh')">
<img class="sidebar-action-icon" src="/icons/iconoir/regular/refresh.svg" alt="" aria-hidden="true">
</button>
</template>
</div>
</div>
<div class="sidebar-list-drop-wrap" :class="{ 'drag-over': activeSection === 'notes' && isDragOverSidebar }" id="campaign-section-list" @dragenter.self="isDragOverSidebar = true" @dragleave.self="isDragOverSidebar = false" @dragover.prevent @drop.stop="handleSidebarDrop">
<template v-if="activeSection === 'notes'">
<div v-if="loadingNotes" class="sidebar-state">{{ t('campaigns.states.loading-notes') }}</div>
<div v-else-if="notesError" class="sidebar-state error">{{ notesError }}</div>
<div v-else-if="folders.length === 0 && notes.length === 0" class="sidebar-state">{{ t('campaigns.states.empty-notes') }}</div>
<NestedNoteList v-else ref="nestedNoteListRef"
:parent-folder-id="null" :folders="folders" :notes="rootNotes" :campaign-id="campaignId"
:expanded-folder-ids="expandedFolderIds" @open-note="openNote"
@reload-notes="fetchCampaignNotes" @toggle-expanded-folder="toggleExpandedFolder" />
</template>
<template v-else-if="activeSection === 'actors'">
<div v-if="loadingEntries" class="sidebar-state">{{ t('campaigns.states.loading') }}</div>
<div v-else-if="entriesError" class="sidebar-state error">{{ entriesError }}</div>
<div v-else-if="actors.length === 0" class="sidebar-state">{{ t('campaigns.states.empty-actors') }}</div>
<div v-for="actor in actors" :key="actor._id" class="entity-entry" role="button" tabindex="0" draggable="true" :title="t('campaigns.map.tokens.drag')" @click="openCharacterSheet(actor)" @keydown.enter="openCharacterSheet(actor)" @keydown.space.prevent="openCharacterSheet(actor)" @dragstart="startActorDrag($event, actor)" @contextmenu.prevent="showEntryMenu(actor, 'actor')">
<span class="entity-entry-name">{{ actor.name }}</span>
<span class="entity-entry-meta">{{ entrySummary(actor) }}</span>
</div>
</template>
<template v-else-if="activeSection === 'items'">
<div v-if="loadingEntries" class="sidebar-state">{{ t('campaigns.states.loading') }}</div>
<div v-else-if="entriesError" class="sidebar-state error">{{ entriesError }}</div>
<div v-else-if="items.length === 0" class="sidebar-state">{{ t('campaigns.states.empty-items') }}</div>
<div v-for="item in items" :key="item._id" class="entity-entry" role="button" tabindex="0" @click="openItemSheet(item)" @keydown.enter="openItemSheet(item)" @keydown.space.prevent="openItemSheet(item)" @contextmenu.prevent="showEntryMenu(item, 'item')">
<span class="entity-entry-name-row">
<span class="entity-entry-name">{{ item.name }}</span>
<span v-if="item.foundryItemId" class="entity-entry-sync">{{ t('campaigns.synced') }}</span>
</span>
<span class="entity-entry-meta">{{ itemSummary(item) }}</span>
</div>
</template>
<template v-else>
<div v-if="loadingEntries" class="sidebar-state">{{ t('campaigns.states.loading') }}</div>
<div v-else-if="entriesError" class="sidebar-state error">{{ entriesError }}</div>
<div v-else-if="maps.length === 0" class="sidebar-state">{{ t('campaigns.states.empty-maps') }}</div>
<div v-for="map in maps" :key="map._id" class="entity-entry" :class="{ anchored: isAnchoredMap(map) }" role="button" tabindex="0" @click="openMapViewer(map)" @keydown.enter="openMapViewer(map)" @keydown.space.prevent="openMapViewer(map)" @contextmenu.prevent="showEntryMenu(map, 'map')">
<span class="entity-entry-name-row">
<span class="entity-entry-name">{{ map.name }}</span>
<span v-if="isAnchoredMap(map)" class="entity-entry-sync">{{ t('campaigns.map.anchored') }}</span>
</span>
<span class="entity-entry-meta">{{ mapSummary(map) }}</span>
<span v-if="!map.image" class="entity-entry-description">{{ t('campaigns.map.no-image') }}</span>
</div>
</template>
</div>
</aside>
</div>
</template>
<style scoped>
.sidebar-shell {
min-height: 0;
display: flex;
flex-direction: row;
}
.sidebar-actions {
width: 46px;
min-width: 46px;
padding: 8px 6px;
border-right: 1px solid var(--color-border);
background-color: var(--color-background-light);
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.sidebar-action {
width: 34px;
height: 34px;
margin: 0;
padding: 0;
border: 1px solid var(--color-border);
border-radius: 8px;
background: var(--color-background-soft);
box-shadow: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.sidebar-action.selected {
background: var(--color-button-hover);
border-color: var(--color-link);
}
.sidebar-action:hover {
background: var(--color-button-hover);
}
.sidebar-action:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.sidebar-action-icon {
width: 18px;
height: 18px;
filter: invert(var(--color-icon-invert));
}
.notes-sidebar {
min-width: 280px;
width: 280px;
border-right: 1px solid var(--color-border);
background-color: var(--color-background-light);
display: flex;
flex-direction: column;
overflow: hidden;
transition: width 0.2s ease, min-width 0.2s ease, border-color 0.2s ease;
}
.notes-sidebar.collapsed {
width: 0;
min-width: 0;
border-right-color: transparent;
}
.sidebar-header {
width: 280px;
min-width: 280px;
box-sizing: border-box;
padding: 12px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
border-bottom: 1px solid var(--color-border);
}
.sidebar-header-actions { display: flex; align-items: center; gap: 4px; }
.sidebar-header-actions .sidebar-action { width: 30px; height: 30px; }
.sidebar-header-actions .sidebar-action-icon { width: 16px; height: 16px; }
.sidebar-copy {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.sidebar-eyebrow,
.sidebar-meta {
font-size: 12px;
opacity: 0.7;
}
.sidebar-title {
line-height: 1.2;
word-break: break-word;
}
.sidebar-list-drop-wrap {
width: 280px;
min-width: 280px;
box-sizing: border-box;
padding: 10px;
display: flex;
flex-direction: column;
overflow-y: auto;
gap: 2px;
transition: background-color 0.15s ease;
flex: 1;
min-height: 0;
}
.sidebar-list-drop-wrap.drag-over {
background: var(--color-button-hover);
}
.sidebar-state {
padding: 12px;
border-radius: 10px;
background: var(--color-background-soft);
font-size: 14px;
}
.sidebar-state.error {
color: #9e2a2b;
}
.entity-entry {
/* These rows are divs (the note and folder rows are buttons) and there is no global box-sizing
reset, so without border-box the padding and border add onto the 100% width and the entry
sticks out of the sidebar. */
width: 100%; min-width: 0; box-sizing: border-box; padding: 9px 10px; border: 1px solid transparent;
border-radius: 8px;
background: transparent; color: var(--color-text); text-align: left; display: flex; flex-direction: column;
gap: 3px; cursor: pointer;
}
.entity-entry:hover { border-color: var(--color-border); background: var(--color-background-soft); }
.entity-entry:focus-visible { outline: 1px solid var(--color-link); }
/* The map currently anchored on the note container. */
.entity-entry.anchored { border-color: var(--color-link); background: var(--color-background-soft); }
.entity-entry-name-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.entity-entry-name { font-weight: bold; min-width: 0; word-break: break-word; }
.entity-entry-sync {
font-size: 10px;
letter-spacing: 0.04em;
text-transform: uppercase;
opacity: 0.6;
}
.entity-entry-meta, .entity-entry-description { font-size: 12px; opacity: 0.72; }
.entity-entry-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 900px) {
.notes-sidebar {
width: 220px;
min-width: 220px;
}
.sidebar-header,
.sidebar-list-drop-wrap {
width: 220px;
min-width: 220px;
}
}
</style>