feat(gallery): rework the gallery toolbar, header tabs and image viewer

Rename the tab to 画廊 and give the knowledge-base views a proper switch.
文档 / Wiki / 图谱 / 画廊 read as another breadcrumb level; they are now a
segmented control with an icon and a tooltip per view, and the breadcrumb
wraps instead of squeezing its links on narrow widths.

The gallery toolbar now has the documents tab's shape: what is listed on
the left, search, a 筛选 popup with an active-count badge and a 排序 popup
on the right. The pinned rail, the 全显示/自定义 status words, the filter
on/off switch and the apply-to-all row are gone. Per-value verdicts read
不限 / 隐藏 / 始终显示 with a line explaining that 始终显示 only overrides a
hide, which is what AttrRules actually does. The search scope becomes
checkboxes: ticking every field is "all" mode, and the last field cannot
be unticked. The grid drops the extra 16px padding that doubled the page
gutter, and cards match the document cards.

The viewer moves into GalleryViewer.vue as a full-screen lightbox and
fixes what the old one got wrong: keys never fired (the listener sat on
a div that is never focused), prev/next wrapped within the page instead
of crossing into the next one, and "open source document" had a string
but no button. It adds wheel/double-click zoom, drag to pan, 1:1,
rotation, download, open in new tab, copy caption/OCR, a filmstrip,
image size and status, and a collapsible info panel.
main
wizardchen 2026-09-25 13:16:04 +08:00 committed by lyingbug
parent 68fe9599cd
commit ebbcf96fab
8 changed files with 2078 additions and 1428 deletions

View File

@ -3463,52 +3463,58 @@ export default {
pageActions: 'Page actions',
tabDocuments: 'Documents',
tabGallery: 'Gallery',
tabDocumentsTip: 'Upload and manage the source documents',
tabWikiTip: 'Wiki pages compiled automatically from the documents',
tabGalleryTip: 'Browse every image extracted from the documents',
viewTabs: 'Knowledge base views',
gallery: {
panelFilter: 'Filter',
panelSearch: 'Search',
enableFilter: 'Enable filter',
searchAll: 'Search all fields',
verdictDefault: '-',
verdictOff: 'off',
verdictOn: 'on',
searchScope: 'Search scope',
scopeAll: 'All',
scopeCustom: 'Custom',
filterScope: 'Filter',
filterOff: 'Show all',
filterOn: 'Custom',
editSearch: 'Open search settings',
editFilter: 'Open filter settings',
pin: 'Pin to the right',
unpin: 'Unpin',
title: 'Gallery',
searchPlaceholder: 'Search image content',
sortByLabel: 'Sort by',
allImages: 'All images',
count: '{count} images',
countFiltered: '{count} matching',
searchPlaceholder: 'Search captions or image text',
filters: 'Filters',
clearFilters: 'Clear filters',
searchIn: 'Search in',
searchInHint: 'Keywords only match the ticked content',
attrSection: 'Image attributes',
attrHint: '"Hide" removes images with that value; "Always show" keeps them even when another rule hides them',
verdictDefault: 'Any',
verdictOff: 'Hide',
verdictOn: 'Always show',
keywordsPlaceholder: 'Separate keywords with commas',
noAttrs: 'No attributes to filter by',
sort: 'Sort',
sortField: 'Sort by',
sortOrder: 'Order',
orderAsc: 'Ascending',
orderDesc: 'Descending',
filtersTitle: 'Filters',
searchFields: 'Search fields',
modeAll: 'All fields',
modeCustom: 'Custom',
keywordsPlaceholder: 'Separate keywords with commas',
applyAll: 'Apply to all attributes',
count: '{count} images',
empty: 'No images in this knowledge base yet',
emptyFiltered: 'No images match the current filters',
attrSection: 'Image attributes',
noAttrs: 'No image attributes available',
attributes: 'Attributes',
caption: 'Caption',
ocr: 'OCR text',
source: 'Source',
noCaption: 'No caption',
noOcr: 'No OCR text',
chunkType: 'Type',
viewerClose: 'Close',
prev: 'Previous',
next: 'Next',
openSource: 'Open source document',
empty: 'No images to browse yet',
emptyHint: 'Images in your documents appear here once parsing finishes',
emptyFiltered: 'No images match these filters',
imageLoadError: 'Image failed to load',
noCaption: 'No caption',
noOcr: 'No text recognized',
caption: 'Caption',
ocr: 'Text in image (OCR)',
attributes: 'Attributes',
source: 'Source document',
details: 'Details',
dimensions: 'Size',
status: 'Status',
openSource: 'Open source document',
copy: 'Copy',
zoomIn: 'Zoom in (+)',
zoomOut: 'Zoom out (-)',
zoomReset: 'Fit to window (0)',
actualSize: 'Actual size',
rotate: 'Rotate (R)',
download: 'Download',
openOriginal: 'Open in new tab',
toggleInfo: 'Image info (I)',
viewerClose: 'Close (Esc)',
prev: 'Previous (←)',
next: 'Next (→)',
// Display names for the builtin attributes the gallery itself
// declares. Attributes contributed by other sources fall back to the
// pipeline's own wording (see the imageAttr namespace).

View File

@ -3463,52 +3463,58 @@ export default {
pageActions: 'ページ操作',
tabDocuments: 'ドキュメント',
tabGallery: 'ギャラリー',
tabDocumentsTip: '元のドキュメントをアップロード・管理',
tabWikiTip: 'ドキュメントから自動で整理された Wiki ページ',
tabGalleryTip: 'ドキュメントから抽出されたすべての画像を閲覧',
viewTabs: 'ナレッジベースのビュー',
gallery: {
panelFilter: 'フィルター設定',
panelSearch: '検索設定',
enableFilter: 'フィルター有効',
searchAll: '全フィールド検索',
verdictDefault: '-',
verdictOff: 'off',
verdictOn: 'on',
searchScope: '検索範囲',
scopeAll: 'すべて',
scopeCustom: 'カスタム',
filterScope: 'フィルター',
filterOff: 'すべて表示',
filterOn: 'カスタム',
editSearch: '検索設定を開く',
editFilter: 'フィルター設定を開く',
pin: '右側に固定',
unpin: '固定を解除',
title: 'ギャラリー',
searchPlaceholder: '画像の内容を検索',
sortByLabel: '並べ替え',
allImages: 'すべての画像',
count: '{count} 枚',
countFiltered: '{count} 枚が該当',
searchPlaceholder: '説明や画像内の文字を検索',
filters: 'フィルター',
clearFilters: 'フィルターをクリア',
searchIn: '検索対象',
searchInHint: 'キーワードはチェックした内容だけで照合します',
attrSection: '画像属性',
attrHint: '「非表示」はその値を持つ画像を除外し、「常に表示」は他の条件で非表示になっても残します',
verdictDefault: '指定なし',
verdictOff: '非表示',
verdictOn: '常に表示',
keywordsPlaceholder: 'キーワードはカンマで区切る',
noAttrs: '絞り込める属性はありません',
sort: '並べ替え',
sortField: '並べ替え基準',
sortOrder: '順序',
orderAsc: '昇順',
orderDesc: '降順',
filtersTitle: 'フィルター',
searchFields: '検索フィールド',
modeAll: 'すべてのフィールド',
modeCustom: 'カスタム',
keywordsPlaceholder: 'キーワードはカンマで区切る',
applyAll: '全属性に一括設定',
count: '{count} 枚の画像',
empty: 'このナレッジベースに画像はまだありません',
emptyFiltered: '現在のフィルターに一致する画像はありません',
attrSection: '画像属性',
noAttrs: '画像属性はありません',
attributes: '属性',
caption: '説明',
ocr: 'OCR テキスト',
source: 'ソース',
noCaption: '説明なし',
noOcr: 'OCR テキストなし',
chunkType: '種類',
viewerClose: '閉じる',
prev: '前へ',
next: '次へ',
openSource: 'ソース文書を開く',
empty: '閲覧できる画像はまだありません',
emptyHint: 'ドキュメント内の画像は解析完了後にここに表示されます',
emptyFiltered: '条件に一致する画像はありません',
imageLoadError: '画像の読み込みに失敗しました',
noCaption: '説明なし',
noOcr: '文字は認識されませんでした',
caption: '説明',
ocr: '画像内の文字(OCR)',
attributes: '属性',
source: '元のドキュメント',
details: '詳細',
dimensions: 'サイズ',
status: '状態',
openSource: '元のドキュメントを開く',
copy: 'コピー',
zoomIn: '拡大 (+)',
zoomOut: '縮小 (-)',
zoomReset: 'ウィンドウに合わせる (0)',
actualSize: '実寸',
rotate: '回転 (R)',
download: 'ダウンロード',
openOriginal: '新しいタブで開く',
toggleInfo: '画像情報 (I)',
viewerClose: '閉じる (Esc)',
prev: '前へ (←)',
next: '次へ (→)',
// Display names for the builtin attributes the gallery itself
// declares. Attributes contributed by other sources fall back to the
// pipeline's own wording (see the imageAttr namespace).

View File

@ -4443,52 +4443,58 @@ export default {
pageActions: '페이지 작업',
tabDocuments: '문서',
tabGallery: '갤러리',
tabDocumentsTip: '원본 문서를 업로드하고 관리합니다',
tabWikiTip: '문서에서 자동으로 정리된 Wiki 페이지',
tabGalleryTip: '문서에서 추출한 모든 이미지를 둘러봅니다',
viewTabs: '지식베이스 보기',
gallery: {
panelFilter: '필터 설정',
panelSearch: '검색 설정',
enableFilter: '필터 사용',
searchAll: '전체 필드 검색',
verdictDefault: '-',
verdictOff: 'off',
verdictOn: 'on',
searchScope: '검색 범위',
scopeAll: '전체',
scopeCustom: '사용자 지정',
filterScope: '필터',
filterOff: '전체 표시',
filterOn: '사용자 지정',
editSearch: '검색 설정 열기',
editFilter: '필터 설정 열기',
pin: '오른쪽에 고정',
unpin: '고정 해제',
title: '갤러리',
searchPlaceholder: '이미지 내용 검색',
sortByLabel: '정렬',
allImages: '모든 이미지',
count: '{count}장',
countFiltered: '{count}장 일치',
searchPlaceholder: '설명 또는 이미지 속 텍스트 검색',
filters: '필터',
clearFilters: '필터 지우기',
searchIn: '검색 범위',
searchInHint: '키워드는 체크한 내용에서만 일치 여부를 확인합니다',
attrSection: '이미지 속성',
attrHint: '"숨기기"는 해당 값을 가진 이미지를 제외하고, "항상 표시"는 다른 조건으로 숨겨져도 유지합니다',
verdictDefault: '전체',
verdictOff: '숨기기',
verdictOn: '항상 표시',
keywordsPlaceholder: '키워드는 쉼표로 구분',
noAttrs: '필터링할 속성이 없습니다',
sort: '정렬',
sortField: '정렬 기준',
sortOrder: '순서',
orderAsc: '오름차순',
orderDesc: '내림차순',
filtersTitle: '필터',
searchFields: '검색 필드',
modeAll: '전체 필드',
modeCustom: '사용자 지정',
keywordsPlaceholder: '쉼표로 키워드 구분',
applyAll: '모든 속성에 일괄 적용',
count: '{count}개의 이미지',
empty: '이 지식 베이스에는 아직 이미지가 없습니다',
emptyFiltered: '현재 필터와 일치하는 이미지가 없습니다',
attrSection: '이미지 속성',
noAttrs: '사용 가능한 이미지 속성이 없습니다',
attributes: '속성',
caption: '설명',
ocr: 'OCR 텍스트',
source: '출처',
noCaption: '설명 없음',
noOcr: 'OCR 텍스트 없음',
chunkType: '유형',
viewerClose: '닫기',
prev: '이전',
next: '다음',
openSource: '출처 문서 열기',
empty: '아직 볼 수 있는 이미지가 없습니다',
emptyHint: '문서 속 이미지는 파싱이 끝나면 여기에 표시됩니다',
emptyFiltered: '조건에 맞는 이미지가 없습니다',
imageLoadError: '이미지를 불러오지 못했습니다',
noCaption: '설명 없음',
noOcr: '인식된 텍스트 없음',
caption: '설명',
ocr: '이미지 속 텍스트(OCR)',
attributes: '속성',
source: '원본 문서',
details: '상세 정보',
dimensions: '크기',
status: '상태',
openSource: '원본 문서 열기',
copy: '복사',
zoomIn: '확대 (+)',
zoomOut: '축소 (-)',
zoomReset: '창에 맞추기 (0)',
actualSize: '원본 크기',
rotate: '회전 (R)',
download: '다운로드',
openOriginal: '새 탭에서 열기',
toggleInfo: '이미지 정보 (I)',
viewerClose: '닫기 (Esc)',
prev: '이전 (←)',
next: '다음 (→)',
// Display names for the builtin attributes the gallery itself
// declares. Attributes contributed by other sources fall back to the
// pipeline's own wording (see the imageAttr namespace).

View File

@ -4443,52 +4443,58 @@ export default {
pageActions: 'Действия со страницей',
tabDocuments: 'Документы',
tabGallery: 'Галерея',
tabDocumentsTip: 'Загрузка исходных документов и управление ими',
tabWikiTip: 'Wiki-страницы, автоматически составленные из документов',
tabGalleryTip: 'Все изображения, извлечённые из документов',
viewTabs: 'Представления базы знаний',
gallery: {
panelFilter: 'Фильтр',
panelSearch: 'Поиск',
enableFilter: 'Включить фильтр',
searchAll: 'Искать во всех полях',
verdictDefault: '-',
verdictOff: 'off',
verdictOn: 'on',
searchScope: 'Область поиска',
scopeAll: 'Все',
scopeCustom: 'Вручную',
filterScope: 'Фильтр',
filterOff: 'Показывать все',
filterOn: 'Вручную',
editSearch: 'Открыть настройки поиска',
editFilter: 'Открыть настройки фильтра',
pin: 'Закрепить справа',
unpin: 'Открепить',
title: 'Галерея',
searchPlaceholder: 'Поиск по содержимому изображений',
sortByLabel: 'Сортировка',
allImages: 'Все изображения',
count: 'Изображений: {count}',
countFiltered: 'Найдено: {count}',
searchPlaceholder: 'Поиск по описанию или тексту на изображении',
filters: 'Фильтры',
clearFilters: 'Сбросить фильтры',
searchIn: 'Где искать',
searchInHint: 'Ключевые слова ищутся только в отмеченных полях',
attrSection: 'Атрибуты изображений',
attrHint: '«Скрыть» убирает изображения с этим значением; «Всегда показывать» оставляет их, даже если другое правило их скрывает',
verdictDefault: 'Любое',
verdictOff: 'Скрыть',
verdictOn: 'Всегда показывать',
keywordsPlaceholder: 'Ключевые слова через запятую',
noAttrs: 'Нет атрибутов для фильтрации',
sort: 'Сортировка',
sortField: 'Сортировать по',
sortOrder: 'Порядок',
orderAsc: 'По возрастанию',
orderDesc: 'По убыванию',
filtersTitle: 'Фильтры',
searchFields: 'Поля поиска',
modeAll: 'Все поля',
modeCustom: 'Свои поля',
keywordsPlaceholder: 'Разделяйте ключевые слова запятыми',
applyAll: 'Применить ко всем атрибутам',
count: '{count} изображений',
empty: 'В этой базе знаний пока нет изображений',
emptyFiltered: 'Нет изображений, соответствующих фильтрам',
attrSection: 'Атрибуты изображения',
noAttrs: 'Атрибуты изображения отсутствуют',
attributes: 'Атрибуты',
caption: 'Описание',
ocr: 'OCR-текст',
source: 'Источник',
noCaption: 'Нет описания',
noOcr: 'Нет OCR-текста',
chunkType: 'Тип',
viewerClose: 'Закрыть',
prev: 'Назад',
next: 'Вперёд',
openSource: 'Открыть исходный документ',
empty: 'Изображений пока нет',
emptyHint: 'Изображения из документов появятся здесь после завершения разбора',
emptyFiltered: 'Нет изображений, подходящих под фильтры',
imageLoadError: 'Не удалось загрузить изображение',
noCaption: 'Нет описания',
noOcr: 'Текст не распознан',
caption: 'Описание',
ocr: 'Текст на изображении (OCR)',
attributes: 'Атрибуты',
source: 'Исходный документ',
details: 'Подробности',
dimensions: 'Размер',
status: 'Статус',
openSource: 'Открыть исходный документ',
copy: 'Копировать',
zoomIn: 'Увеличить (+)',
zoomOut: 'Уменьшить (-)',
zoomReset: 'По размеру окна (0)',
actualSize: 'Исходный размер',
rotate: 'Повернуть (R)',
download: 'Скачать',
openOriginal: 'Открыть в новой вкладке',
toggleInfo: 'Сведения (I)',
viewerClose: 'Закрыть (Esc)',
prev: 'Назад (←)',
next: 'Вперёд (→)',
// Display names for the builtin attributes the gallery itself
// declares. Attributes contributed by other sources fall back to the
// pipeline's own wording (see the imageAttr namespace).

View File

@ -4444,53 +4444,59 @@ export default {
editingBadge: '编辑中',
pageActions: '页面操作',
tabDocuments: '文档',
tabGallery: '图库',
tabGallery: '画廊',
tabDocumentsTip: '上传和管理原始文档',
tabWikiTip: '由文档自动整理生成的 Wiki 页面',
tabGalleryTip: '浏览从文档中解析出的全部图片',
viewTabs: '知识库视图',
gallery: {
panelFilter: '筛选设置',
panelSearch: '搜索设置',
enableFilter: '开启筛选',
searchAll: '搜索全部字段',
verdictDefault: '-',
verdictOff: 'off',
verdictOn: 'on',
searchScope: '搜索范围',
scopeAll: '全部',
scopeCustom: '自定义',
filterScope: '筛选',
filterOff: '全显示',
filterOn: '自定义',
editSearch: '打开搜索设置',
editFilter: '打开筛选设置',
pin: '固定到右侧',
unpin: '取消固定',
title: '图库',
searchPlaceholder: '搜索图片内容',
sortByLabel: '排序',
title: '画廊',
allImages: '全部图片',
count: '共 {count} 张',
countFiltered: '筛选出 {count} 张',
searchPlaceholder: '搜索图片描述或文字',
filters: '筛选',
clearFilters: '清除筛选',
searchIn: '搜索范围',
searchInHint: '关键词只在勾选的内容中匹配',
attrSection: '图片属性',
attrHint: '「隐藏」不显示带该属性的图片;「始终显示」即使被其他条件隐藏也保留',
verdictDefault: '不限',
verdictOff: '隐藏',
verdictOn: '始终显示',
keywordsPlaceholder: '多个关键词用逗号分隔',
noAttrs: '暂无可筛选的属性',
sort: '排序',
sortField: '排序依据',
sortOrder: '顺序',
orderAsc: '升序',
orderDesc: '降序',
filtersTitle: '筛选',
searchFields: '搜索字段',
modeAll: '全部字段',
modeCustom: '自定义',
keywordsPlaceholder: '多个关键词用逗号分隔',
applyAll: '全部属性统一设置',
count: '{count} 张图片',
empty: '该知识库暂无可浏览的图片',
emptyFiltered: '没有符合当前筛选条件的图片',
attrSection: '图片属性',
noAttrs: '暂无图片属性',
attributes: '属性',
caption: '描述',
ocr: 'OCR 文本',
source: '来源',
noCaption: '无描述',
noOcr: '无 OCR 文本',
chunkType: '类型',
viewerClose: '关闭',
prev: '上一张',
next: '下一张',
openSource: '打开来源文档',
empty: '还没有可浏览的图片',
emptyHint: '文档中的图片在解析完成后会出现在这里',
emptyFiltered: '没有符合条件的图片',
imageLoadError: '图片加载失败',
noCaption: '暂无描述',
noOcr: '未识别到文字',
caption: '描述',
ocr: '图中文字(OCR)',
attributes: '属性',
source: '来源文档',
details: '详细信息',
dimensions: '尺寸',
status: '状态',
openSource: '打开来源文档',
copy: '复制',
zoomIn: '放大 (+)',
zoomOut: '缩小 (-)',
zoomReset: '适应窗口 (0)',
actualSize: '原始尺寸',
rotate: '旋转 (R)',
download: '下载',
openOriginal: '在新标签页打开',
toggleInfo: '图片信息 (I)',
viewerClose: '关闭 (Esc)',
prev: '上一张 (←)',
next: '下一张 (→)',
// Display names for the builtin attributes the gallery itself
// declares. Attributes contributed by other sources fall back to the
// pipeline's own wording (see the imageAttr namespace).

View File

@ -109,6 +109,27 @@ const wikiIndexingTip = computed(() => {
if (!wikiIsIndexing.value) return ''
return t('knowledgeEditor.wikiBrowser.queueStatus', { count: wikiStatus.value.pendingTasks || 0 })
})
// The views of this knowledge base, in header order. Wiki and graph only
// exist on wiki KBs; a stale wiki/graph tab on another KB renders documents,
// so the header marks documents active then too.
const kbViewTabs = computed(() => {
const w = 'knowledgeEditor.wikiBrowser'
const tabs: Array<{ key: KbTab; icon: string; label: string; tip: string; indexing?: boolean }> = [
{ key: 'documents', icon: 'file', label: t(`${w}.tabDocuments`), tip: t(`${w}.tabDocumentsTip`) },
]
if (isWiki.value) {
const indexing = wikiIsIndexing.value
tabs.push(
{ key: 'wiki', icon: 'book-open', label: 'Wiki', tip: indexing ? wikiIndexingTip.value : t(`${w}.tabWikiTip`), indexing },
{ key: 'graph', icon: 'relation', label: t(`${w}.tabGraph`), tip: indexing ? wikiIndexingTip.value : t(`${w}.tabGraphTip`), indexing },
)
}
tabs.push({ key: 'gallery', icon: 'image', label: t(`${w}.tabGallery`), tip: t(`${w}.tabGalleryTip`) })
return tabs
})
const shownKbTab = computed<KbTab>(() =>
kbViewTabs.value.some((tab) => tab.key === activeKbTab.value) ? activeKbTab.value : 'documents',
)
const onWikiStatusChange = (payload: { pendingTasks: number; isActive: boolean; pendingIssues: number }) => {
wikiStatus.value = payload
}
@ -2258,33 +2279,17 @@ const handleKBEditorSuccess = (kbIdValue: string) => {
</template>
</button>
<t-icon name="chevron-right" class="breadcrumb-separator" />
<span :class="['breadcrumb-tab', { active: activeKbTab === 'documents' }]"
@click="activeKbTab = 'documents'">{{ $t('knowledgeEditor.wikiBrowser.tabDocuments') }}</span>
<template v-if="isWiki">
<span class="breadcrumb-tab-sep">/</span>
<span :class="['breadcrumb-tab', { active: activeKbTab === 'wiki', indexing: wikiIsIndexing }]"
@click="activeKbTab = 'wiki'">
Wiki
<t-tooltip v-if="wikiIsIndexing" :content="wikiIndexingTip" placement="bottom">
<t-loading size="small" class="breadcrumb-tab-indicator" />
</t-tooltip>
</span>
<span class="breadcrumb-tab-sep">/</span>
<t-tooltip :content="$t('knowledgeEditor.wikiBrowser.tabGraphTip')" placement="bottom">
<span :class="['breadcrumb-tab', { active: activeKbTab === 'graph', indexing: wikiIsIndexing }]"
@click="activeKbTab = 'graph'">
{{ $t('knowledgeEditor.wikiBrowser.tabGraph') }}
<t-tooltip v-if="wikiIsIndexing" :content="wikiIndexingTip" placement="bottom">
<t-loading size="small" class="breadcrumb-tab-indicator" />
</t-tooltip>
</span>
<div class="kb-view-tabs" role="tablist" :aria-label="$t('knowledgeEditor.wikiBrowser.viewTabs')">
<t-tooltip v-for="tab in kbViewTabs" :key="tab.key" :content="tab.tip" placement="bottom">
<button type="button" role="tab" class="kb-view-tab"
:class="{ active: shownKbTab === tab.key, indexing: tab.indexing }"
:aria-selected="shownKbTab === tab.key" @click="activeKbTab = tab.key">
<t-loading v-if="tab.indexing" size="small" class="kb-view-tab__indicator" />
<t-icon v-else :name="tab.icon" size="16px" />
<span>{{ tab.label }}</span>
</button>
</t-tooltip>
<span class="breadcrumb-tab-sep">/</span>
</template>
<span :class="['breadcrumb-tab', { active: activeKbTab === 'gallery' }]"
@click="activeKbTab = 'gallery'">
{{ $t('knowledgeEditor.wikiBrowser.tabGallery') }}
</span>
</div>
</h2>
<!-- 标题行右侧的动作锚点:聚拢"信息"和"设置"两个圆形按钮。 -->
<div class="kb-title-actions">
@ -2322,7 +2327,7 @@ const handleKBEditorSuccess = (kbIdValue: string) => {
</div>
<!-- Image Gallery (4th tab) -->
<ImageGallery v-if="activeKbTab === 'gallery' && kbId" :knowledge-base-id="kbId" />
<ImageGallery v-if="activeKbTab === 'gallery' && kbId" :knowledge-base-id="kbId" @open-source-doc="openSourceDoc" />
<!-- wiki/graph tabs only exist on wiki KBs; a stale tab (?tab= or one
carried over from a previous KB) falls back to documents. -->
@ -2643,44 +2648,59 @@ const handleKBEditorSuccess = (kbIdValue: string) => {
box-sizing: border-box;
}
// Breadcrumb tab switch (文档/Wiki in breadcrumb)
.breadcrumb-tab {
cursor: pointer;
color: var(--td-text-color-placeholder);
font-weight: 400;
transition: color var(--app-motion-fast);
// View switch (文档 / Wiki / 图谱 / 画廊): a segmented control after the
// breadcrumb, drawn like the documents tab's view toggle so the four views
// read as siblings rather than as another breadcrumb level.
.kb-view-tabs {
display: inline-flex;
align-items: center;
gap: 4px;
gap: 2px;
margin-left: 2px;
padding: 3px;
border-radius: var(--app-radius-lg);
background: var(--td-bg-color-secondarycontainer);
}
.kb-view-tab {
display: inline-flex;
align-items: center;
gap: 6px;
height: 28px;
padding: 0 12px;
border: 0;
border-radius: var(--app-radius-md);
background: transparent;
color: var(--td-text-color-secondary);
font-family: var(--app-font-family);
font-size: var(--app-text-base);
font-weight: 500;
line-height: 1;
white-space: nowrap;
cursor: pointer;
transition: color var(--app-motion-fast) ease, background-color var(--app-motion-fast) ease;
&:hover {
color: var(--td-text-color-primary);
}
&.active {
background: var(--td-bg-color-container);
color: var(--td-brand-color);
font-weight: 600;
box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}
&.indexing {
&:focus-visible {
outline: 2px solid var(--app-focus-border);
outline-offset: 1px;
}
&__indicator {
display: inline-flex;
color: var(--td-brand-color);
}
}
.breadcrumb-tab-indicator {
display: inline-flex;
align-items: center;
color: var(--td-brand-color);
font-size: var(--app-text-sm);
line-height: 1;
}
.breadcrumb-tab-sep {
margin: 0 6px;
color: var(--td-text-color-disabled);
font-weight: 400;
}
.wiki-main-area {
flex: 1;
min-height: 0;
@ -3102,7 +3122,9 @@ const handleKBEditorSuccess = (kbIdValue: string) => {
.document-breadcrumb {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
row-gap: 8px;
margin: 0;
font-size: var(--app-text-3xl);
font-weight: 600;
@ -3120,6 +3142,7 @@ const handleKBEditorSuccess = (kbIdValue: string) => {
display: inline-flex;
align-items: center;
gap: 4px;
white-space: nowrap;
border-radius: var(--app-radius-sm);
transition: all var(--app-motion-instant) ease;

View File

@ -0,0 +1,816 @@
<script setup lang="ts">
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import type { ImageAsset } from '@/api/image-gallery'
import { copyWithToast } from '@/utils/clipboard'
export interface GalleryAttrRow {
key: string
label: string
value: string
}
const props = defineProps<{
/** The images of the page on screen; the viewer walks them in order. */
items: ImageAsset[]
index: number
/** Position of items[0] in the whole result set, so the counter and the
* prev/next bounds speak about every image, not just this page. */
offset: number
total: number
/** A neighbouring page is being fetched; navigation waits for it. */
loading: boolean
thumbUrls: Record<string, string>
resolveSrc: (url: string) => Promise<string>
attrRows: (img: ImageAsset) => GalleryAttrRow[]
}>()
const emit = defineEmits<{
(e: 'close'): void
(e: 'select', index: number): void
/** Step past the page edge; the gallery loads the neighbouring page. */
(e: 'step', delta: 1 | -1): void
(e: 'open-source', knowledgeId: string): void
}>()
const NS = 'knowledgeEditor.wikiBrowser.gallery'
const { t, locale } = useI18n()
const current = computed<ImageAsset | null>(() => props.items[props.index] ?? null)
const position = computed(() => props.offset + props.index + 1)
const hasPrev = computed(() => position.value > 1)
const hasNext = computed(() => position.value < props.total)
function prev(): void {
if (props.loading || !hasPrev.value) return
if (props.index > 0) emit('select', props.index - 1)
else emit('step', -1)
}
function next(): void {
if (props.loading || !hasNext.value) return
if (props.index < props.items.length - 1) emit('select', props.index + 1)
else emit('step', 1)
}
// ---------------------------------------------------------------------------
// Zoom, pan and rotation. Scale 1 is "fit to the stage"; the translation is
// kept relative to the stage centre so zooming can anchor on the cursor.
// ---------------------------------------------------------------------------
const MIN_SCALE = 0.2
const MAX_SCALE = 8
const scale = ref(1)
const rotation = ref(0)
const tx = ref(0)
const ty = ref(0)
const dragging = ref(false)
function resetView(): void {
scale.value = 1
rotation.value = 0
tx.value = 0
ty.value = 0
}
function zoomTo(target: number, anchor?: { x: number; y: number }): void {
const next = Math.min(MAX_SCALE, Math.max(MIN_SCALE, target))
const k = next / scale.value
const ax = anchor?.x ?? 0
const ay = anchor?.y ?? 0
tx.value = ax - (ax - tx.value) * k
ty.value = ay - (ay - ty.value) * k
scale.value = next
// Nothing to pan once the image fits again; re-centre it.
if (next <= fitScale()) {
tx.value = 0
ty.value = 0
}
}
/** The scale at which the (possibly rotated) image fits the stage. */
function fitScale(): number {
const img = imgEl.value
const stage = stageEl.value
if (!img || !stage || rotation.value % 180 === 0) return 1
const w = img.clientWidth
const h = img.clientHeight
if (!w || !h) return 1
const style = getComputedStyle(stage)
const boxW = stage.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight)
const boxH = stage.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom)
return Math.min(1, boxW / h, boxH / w)
}
/** The scale at which one image pixel is one screen pixel. */
function actualScale(): number {
const img = imgEl.value
if (!img || !natural.value || !img.clientWidth) return 1
return natural.value.w / img.clientWidth
}
function anchorOf(e: { clientX: number; clientY: number }): { x: number; y: number } {
const rect = stageEl.value?.getBoundingClientRect()
if (!rect) return { x: 0, y: 0 }
return { x: e.clientX - rect.left - rect.width / 2, y: e.clientY - rect.top - rect.height / 2 }
}
const zoomIn = () => zoomTo(scale.value * 1.25)
const zoomOut = () => zoomTo(scale.value / 1.25)
const zoomActual = () => zoomTo(actualScale())
function rotate(): void {
rotation.value = (rotation.value + 90) % 360
tx.value = 0
ty.value = 0
scale.value = fitScale()
}
function onWheel(e: WheelEvent): void {
if (!loaded.value) return
zoomTo(scale.value * Math.exp(-e.deltaY * 0.002), anchorOf(e))
}
function onDblClick(e: MouseEvent): void {
if (!loaded.value) return
if (Math.abs(scale.value - fitScale()) > 0.01) {
resetView()
scale.value = fitScale()
} else {
zoomTo(Math.max(2, actualScale()), anchorOf(e))
}
}
let dragStart: { x: number; y: number; tx: number; ty: number } | null = null
function onPointerDown(e: PointerEvent): void {
if (e.button !== 0 || !loaded.value || scale.value <= fitScale()) return
dragStart = { x: e.clientX, y: e.clientY, tx: tx.value, ty: ty.value }
dragging.value = true
;(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId)
}
function onPointerMove(e: PointerEvent): void {
if (!dragStart) return
tx.value = dragStart.tx + e.clientX - dragStart.x
ty.value = dragStart.ty + e.clientY - dragStart.y
}
function onPointerUp(): void {
dragStart = null
dragging.value = false
}
// ---------------------------------------------------------------------------
// Source resolution. The <img> is rendered only once a displayable source is
// in hand: a raw storage handle would fire the error handler and mask the
// image that is still being fetched. The token keeps a slow fetch from
// overwriting a faster one that navigated past it.
// ---------------------------------------------------------------------------
const src = ref('')
const loaded = ref(false)
const failed = ref(false)
const natural = ref<{ w: number; h: number } | null>(null)
let srcToken = 0
watch(
() => current.value?.url,
async (url) => {
const token = ++srcToken
resetView()
src.value = ''
loaded.value = false
failed.value = false
natural.value = null
if (!url) return
const resolved = await props.resolveSrc(url)
if (token !== srcToken) return
src.value = resolved
},
{ immediate: true },
)
const imgEl = ref<HTMLImageElement | null>(null)
const stageEl = ref<HTMLElement | null>(null)
function onImgLoad(): void {
loaded.value = true
const el = imgEl.value
if (el) natural.value = { w: el.naturalWidth, h: el.naturalHeight }
}
function onImgError(): void {
failed.value = true
}
const canPan = computed(() => loaded.value && scale.value > 1)
const zoomPercent = computed(() => `${Math.round(scale.value * 100)}%`)
const imgStyle = computed(() => ({
transform: `translate(${tx.value}px, ${ty.value}px) rotate(${rotation.value}deg) scale(${scale.value})`,
}))
// ---------------------------------------------------------------------------
// Actions
// ---------------------------------------------------------------------------
const EXT_BY_TYPE: Record<string, string> = {
'image/png': 'png',
'image/jpeg': 'jpg',
'image/gif': 'gif',
'image/webp': 'webp',
'image/svg+xml': 'svg',
'image/bmp': 'bmp',
}
function downloadName(img: ImageAsset, type: string): string {
const base = (img.source_name || 'image').replace(/\.[^./\\]+$/, '').replace(/[\\/:*?"<>|]+/g, '_')
const fromUrl = /\.([a-z0-9]{2,5})(?:$|[?#])/i.exec(img.url)?.[1]
const ext = EXT_BY_TYPE[type] || fromUrl || 'png'
return `${base}-${position.value}.${ext}`
}
async function download(): Promise<void> {
const img = current.value
if (!img || !src.value) return
try {
const blob = await (await fetch(src.value)).blob()
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = downloadName(img, blob.type)
a.click()
setTimeout(() => URL.revokeObjectURL(url), 1000)
} catch {
// A cross-origin image the browser may not read back: let it open instead.
openOriginal()
}
}
function openOriginal(): void {
if (src.value) window.open(src.value, '_blank', 'noopener')
}
const copyText = (text: string) => copyWithToast(text, 'common.copySuccess')
// The info panel is a per-viewer preference; storage may be unavailable.
const INFO_KEY = 'weknora_gallery_viewer_info'
function readInfoPref(): boolean {
try {
return localStorage.getItem(INFO_KEY) !== '0'
} catch {
return true
}
}
const showInfo = ref(readInfoPref())
function toggleInfo(): void {
showInfo.value = !showInfo.value
try {
localStorage.setItem(INFO_KEY, showInfo.value ? '1' : '0')
} catch {
// Not remembered this time; the toggle itself still works.
}
}
const attrs = computed(() => (current.value ? props.attrRows(current.value) : []))
function formatTime(iso: string): string {
if (!iso) return ''
const d = new Date(iso)
return Number.isNaN(d.getTime()) ? iso : d.toLocaleString(locale.value)
}
// ---------------------------------------------------------------------------
// Filmstrip: keep the current thumbnail in view as the viewer moves.
// ---------------------------------------------------------------------------
const stripEl = ref<HTMLElement | null>(null)
watch(
() => [props.index, props.items] as const,
async () => {
await nextTick()
const el = stripEl.value?.querySelector<HTMLElement>('.igv-strip__item.is-current')
el?.scrollIntoView({ block: 'nearest', inline: 'center', behavior: 'smooth' })
},
{ immediate: true },
)
// ---------------------------------------------------------------------------
// Keyboard. Bound on window while the viewer is mounted: the overlay itself is
// never focused, so a listener on it would never hear a key.
// ---------------------------------------------------------------------------
function onKey(e: KeyboardEvent): void {
if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey) return
const target = e.target as HTMLElement | null
if (target?.closest?.('input, textarea, select, [contenteditable="true"]')) return
const actions: Record<string, () => void> = {
Escape: () => emit('close'),
ArrowLeft: prev,
ArrowRight: next,
'+': zoomIn,
'=': zoomIn,
'-': zoomOut,
'0': () => resetView(),
r: rotate,
i: toggleInfo,
}
const action = actions[e.key]
if (!action) return
e.preventDefault()
action()
}
onMounted(() => window.addEventListener('keydown', onKey))
onBeforeUnmount(() => window.removeEventListener('keydown', onKey))
</script>
<template>
<Teleport to="body">
<div class="igv" :class="{ 'has-info': showInfo }" role="dialog" aria-modal="true" :aria-label="current?.caption || t(`${NS}.title`)">
<div class="igv-main">
<header class="igv-topbar">
<div class="igv-topbar__title">
<span class="igv-counter">{{ position }} / {{ total }}</span>
<span class="igv-name" :title="current?.source_name">{{ current?.source_name || current?.knowledge_id }}</span>
</div>
<div class="igv-tools">
<t-tooltip :content="t(`${NS}.zoomOut`)">
<button type="button" class="igv-tool" :disabled="!loaded" :aria-label="t(`${NS}.zoomOut`)" @click="zoomOut">
<t-icon name="zoom-out" />
</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.zoomReset`)">
<button type="button" class="igv-tool igv-tool--text" :disabled="!loaded" @click="resetView">{{ zoomPercent }}</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.zoomIn`)">
<button type="button" class="igv-tool" :disabled="!loaded" :aria-label="t(`${NS}.zoomIn`)" @click="zoomIn">
<t-icon name="zoom-in" />
</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.actualSize`)">
<button type="button" class="igv-tool igv-tool--text" :disabled="!loaded" @click="zoomActual">1:1</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.rotate`)">
<button type="button" class="igv-tool" :disabled="!loaded" :aria-label="t(`${NS}.rotate`)" @click="rotate">
<t-icon name="rotation" />
</button>
</t-tooltip>
<span class="igv-tools__sep" />
<t-tooltip :content="t(`${NS}.download`)">
<button type="button" class="igv-tool" :disabled="!src" :aria-label="t(`${NS}.download`)" @click="download">
<t-icon name="download" />
</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.openOriginal`)">
<button type="button" class="igv-tool" :disabled="!src" :aria-label="t(`${NS}.openOriginal`)" @click="openOriginal">
<t-icon name="jump" />
</button>
</t-tooltip>
<t-tooltip :content="t(`${NS}.toggleInfo`)">
<button type="button" class="igv-tool" :class="{ 'is-on': showInfo }" :aria-pressed="showInfo" :aria-label="t(`${NS}.toggleInfo`)" @click="toggleInfo">
<t-icon name="info-circle" />
</button>
</t-tooltip>
<span class="igv-tools__sep" />
<t-tooltip :content="t(`${NS}.viewerClose`)">
<button type="button" class="igv-tool" :aria-label="t(`${NS}.viewerClose`)" @click="emit('close')">
<t-icon name="close" />
</button>
</t-tooltip>
</div>
</header>
<div
ref="stageEl"
class="igv-stage"
:class="{ 'can-pan': canPan, 'is-dragging': dragging }"
@wheel.prevent="onWheel"
@dblclick="onDblClick"
@pointerdown="onPointerDown"
@pointermove="onPointerMove"
@pointerup="onPointerUp"
@pointercancel="onPointerUp"
@click.self="emit('close')"
>
<img
v-if="src && !failed"
ref="imgEl"
:src="src"
:alt="current?.caption"
class="igv-image"
:class="{ 'is-loaded': loaded }"
:style="imgStyle"
draggable="false"
@load="onImgLoad"
@error="onImgError"
/>
<div v-if="failed" class="igv-state">
<t-icon name="image-error" size="32px" />
<span>{{ t(`${NS}.imageLoadError`) }}</span>
</div>
<t-loading v-else-if="!loaded || loading" class="igv-state" size="medium" />
<button type="button" class="igv-nav igv-nav--prev" :disabled="!hasPrev || loading" :aria-label="t(`${NS}.prev`)" @click.stop="prev">
<t-icon name="chevron-left" size="24px" />
</button>
<button type="button" class="igv-nav igv-nav--next" :disabled="!hasNext || loading" :aria-label="t(`${NS}.next`)" @click.stop="next">
<t-icon name="chevron-right" size="24px" />
</button>
</div>
<div v-if="items.length > 1" ref="stripEl" class="igv-strip">
<button
v-for="(img, i) in items"
:key="img.id"
type="button"
class="igv-strip__item"
:class="{ 'is-current': i === index }"
:aria-label="img.caption || String(offset + i + 1)"
@click="emit('select', i)"
>
<img v-if="thumbUrls[img.id]" :src="thumbUrls[img.id]" alt="" draggable="false" />
</button>
</div>
</div>
<aside v-if="showInfo && current" class="igv-info">
<section class="igv-section">
<div class="igv-section__head">
<h3>{{ t(`${NS}.caption`) }}</h3>
<button v-if="current.caption" type="button" class="igv-copy" @click="copyText(current.caption)">
<t-icon name="file-copy" size="14px" />{{ t(`${NS}.copy`) }}
</button>
</div>
<p class="igv-text" :class="{ 'is-muted': !current.caption }">{{ current.caption || t(`${NS}.noCaption`) }}</p>
</section>
<section class="igv-section">
<div class="igv-section__head">
<h3>{{ t(`${NS}.ocr`) }}</h3>
<button v-if="current.ocr_text" type="button" class="igv-copy" @click="copyText(current.ocr_text)">
<t-icon name="file-copy" size="14px" />{{ t(`${NS}.copy`) }}
</button>
</div>
<p class="igv-text" :class="{ 'is-muted': !current.ocr_text }">{{ current.ocr_text || t(`${NS}.noOcr`) }}</p>
</section>
<section v-if="attrs.length" class="igv-section">
<div class="igv-section__head"><h3>{{ t(`${NS}.attributes`) }}</h3></div>
<dl class="igv-props">
<template v-for="a in attrs" :key="a.key">
<dt>{{ a.label }}</dt>
<dd>{{ a.value }}</dd>
</template>
</dl>
</section>
<section class="igv-section">
<div class="igv-section__head"><h3>{{ t(`${NS}.details`) }}</h3></div>
<dl class="igv-props">
<dt>{{ t(`${NS}.source`) }}</dt>
<dd>
<button type="button" class="igv-source" :title="t(`${NS}.openSource`)" @click="emit('open-source', current.knowledge_id)">
<t-icon name="file" size="14px" />
<span>{{ current.source_name || current.knowledge_id }}</span>
</button>
</dd>
<template v-if="natural">
<dt>{{ t(`${NS}.dimensions`) }}</dt>
<dd>{{ natural.w }} × {{ natural.h }}</dd>
</template>
<dt>{{ t(`${NS}.status`) }}</dt>
<dd>
<t-tag size="small" variant="light" :theme="current.is_enabled ? 'success' : 'default'">
{{ t(`${NS}.attr.builtin_is_enabled_value_${current.is_enabled ? 'true' : 'false'}`) }}
</t-tag>
</dd>
<template v-if="current.created_at">
<dt>{{ t(`${NS}.attr.builtin_created_at`) }}</dt>
<dd>{{ formatTime(current.created_at) }}</dd>
</template>
</dl>
</section>
</aside>
</div>
</Teleport>
</template>
<style scoped lang="less">
// The stage is always dark, whatever the app theme: images read best on a
// neutral dark ground, and the controls over it are sized for that.
.igv {
--igv-stage-bg: #111214;
--igv-chrome-fg: rgb(255 255 255 / 86%);
--igv-chrome-muted: rgb(255 255 255 / 55%);
--igv-chrome-hover: rgb(255 255 255 / 12%);
position: fixed;
inset: 0;
z-index: var(--z-drawer);
display: grid;
grid-template-columns: minmax(0, 1fr);
background: var(--igv-stage-bg);
color: var(--igv-chrome-fg);
&.has-info {
grid-template-columns: minmax(0, 1fr) 360px;
}
}
.igv-main {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
}
.igv-topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
height: 52px;
padding: 0 12px 0 20px;
flex-shrink: 0;
&__title {
display: flex;
align-items: baseline;
gap: 12px;
min-width: 0;
}
}
.igv-counter {
font-size: var(--app-text-md);
font-variant-numeric: tabular-nums;
color: var(--igv-chrome-muted);
white-space: nowrap;
}
.igv-name {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: var(--app-text-base);
}
.igv-tools {
display: flex;
align-items: center;
gap: 2px;
flex-shrink: 0;
&__sep {
width: 1px;
height: 18px;
margin: 0 6px;
background: rgb(255 255 255 / 16%);
}
}
.igv-tool {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 32px;
height: 32px;
padding: 0 6px;
border: 0;
border-radius: var(--app-radius-sm);
background: transparent;
color: var(--igv-chrome-fg);
font: inherit;
font-size: var(--app-text-xl);
cursor: pointer;
transition: background-color var(--app-motion-fast) ease;
&--text {
min-width: 48px;
font-size: var(--app-text-sm);
font-variant-numeric: tabular-nums;
}
&:hover:not(:disabled),
&.is-on {
background: var(--igv-chrome-hover);
}
&:disabled {
opacity: 0.35;
cursor: default;
}
&:focus-visible {
outline: 2px solid var(--app-focus-border);
outline-offset: 1px;
}
}
.igv-stage {
position: relative;
flex: 1;
min-height: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
padding: 16px 72px;
user-select: none;
touch-action: none;
&.can-pan { cursor: grab; }
&.is-dragging { cursor: grabbing; }
}
.igv-image {
max-width: 100%;
max-height: 100%;
object-fit: contain;
opacity: 0;
transition: transform var(--app-motion-fast) ease, opacity var(--app-motion-fast) ease;
will-change: transform;
&.is-loaded { opacity: 1; }
.is-dragging & { transition: opacity var(--app-motion-fast) ease; }
}
.igv-state {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--igv-chrome-muted);
font-size: var(--app-text-md);
pointer-events: none;
}
.igv-nav {
position: absolute;
top: 50%;
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
margin-top: -22px;
border: 0;
border-radius: var(--app-radius-pill);
background: rgb(255 255 255 / 10%);
color: var(--igv-chrome-fg);
cursor: pointer;
transition: background-color var(--app-motion-fast) ease, opacity var(--app-motion-fast) ease;
&--prev { left: 16px; }
&--next { right: 16px; }
&:hover:not(:disabled) { background: rgb(255 255 255 / 20%); }
&:disabled { opacity: 0.2; cursor: default; }
&:focus-visible { outline: 2px solid var(--app-focus-border); outline-offset: 2px; }
}
.igv-strip {
display: flex;
gap: 6px;
flex-shrink: 0;
padding: 10px 20px 14px;
overflow-x: auto;
scrollbar-width: thin;
scrollbar-color: rgb(255 255 255 / 20%) transparent;
&__item {
flex: 0 0 auto;
width: 56px;
height: 42px;
padding: 0;
border: 2px solid transparent;
border-radius: var(--app-radius-xs);
overflow: hidden;
background: rgb(255 255 255 / 8%);
opacity: 0.5;
cursor: pointer;
transition: opacity var(--app-motion-fast) ease, border-color var(--app-motion-fast) ease;
img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
&:hover { opacity: 0.85; }
&.is-current {
opacity: 1;
border-color: var(--td-brand-color);
}
}
}
.igv-info {
min-height: 0;
overflow-y: auto;
padding: 20px;
background: var(--td-bg-color-container);
color: var(--td-text-color-primary);
border-left: 1px solid var(--td-component-stroke);
}
.igv-section {
& + & {
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid var(--td-component-stroke);
}
&__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 8px;
h3 {
margin: 0;
font-size: var(--app-text-md);
font-weight: 600;
color: var(--td-text-color-secondary);
}
}
}
.igv-copy {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 6px;
border: 0;
border-radius: var(--app-radius-xs);
background: transparent;
color: var(--td-text-color-secondary);
font: inherit;
font-size: var(--app-text-sm);
cursor: pointer;
&:hover {
color: var(--td-brand-color);
background: var(--td-bg-color-container-hover);
}
}
.igv-text {
margin: 0;
font-size: var(--app-text-base);
line-height: 1.65;
white-space: pre-wrap;
word-break: break-word;
&.is-muted { color: var(--td-text-color-placeholder); }
}
.igv-props {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: 8px 16px;
margin: 0;
font-size: var(--app-text-md);
line-height: 22px;
dt { color: var(--td-text-color-secondary); }
dd {
margin: 0;
min-width: 0;
text-align: right;
word-break: break-word;
}
}
.igv-source {
display: inline-flex;
align-items: center;
gap: 4px;
max-width: 100%;
padding: 0;
border: 0;
background: transparent;
color: var(--td-brand-color);
font: inherit;
cursor: pointer;
span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:hover span { text-decoration: underline; }
}
@media (max-width: 900px) {
.igv.has-info { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 40%; }
.igv-info { border-left: 0; border-top: 1px solid var(--td-component-stroke); }
.igv-stage { padding: 12px 56px; }
}
</style>

File diff suppressed because it is too large Load Diff