diff --git a/internal/governance/source_catalog.go b/internal/governance/source_catalog.go
index 6edc1a8..5c1dc2e 100644
--- a/internal/governance/source_catalog.go
+++ b/internal/governance/source_catalog.go
@@ -13,6 +13,24 @@ type CatalogSource struct {
SnapshotOnly bool `json:"snapshot_only"`
SnapshotStatus string `json:"snapshot_status"`
LastRefreshDurationMS int64 `json:"last_refresh_duration_ms"`
+ // ScanProgress / ScanMessage 只在 SnapshotStatus == "scanning" 时有值:新来源在首次扫描
+ // 完成前也出现在「来源与目录」里,带着百分比与进度文案,不必等到快照落地才看得见。
+ ScanProgress int `json:"scan_progress,omitempty"`
+ ScanMessage string `json:"scan_message,omitempty"`
+}
+
+// CatalogScanProgress 是「已登记、但还没有快照」的来源的首次扫描进度(来自 worker 写在
+// 任务载荷里的进度,非另起一套计数)。
+type CatalogScanProgress struct {
+ ConnectionID string
+ SourceType SourceType
+ Name string
+ Progress int
+ Message string
+ ScannedDirectories int
+ DiscoveredDirectories int
+ ScannedFiles int
+ StartedAt time.Time
}
type CatalogBreadcrumb struct {
diff --git a/internal/httpapi/server.go b/internal/httpapi/server.go
index 3de535a..a10064f 100644
--- a/internal/httpapi/server.go
+++ b/internal/httpapi/server.go
@@ -617,9 +617,46 @@ func listCatalogSources(w http.ResponseWriter, r *http.Request, store Store) {
writeJSON(w, http.StatusInternalServerError, map[string]string{"error": "could not list source catalogs"})
return
}
+ sources = append(sources, scanningCatalogSources(r.Context(), store)...)
writeJSON(w, http.StatusOK, map[string]any{"data": sources, "summary": map[string]int{"total": len(sources)}})
}
+// catalogScanProgressLister 是本路由需要的最小能力面:列出「已登记、还没有快照」的来源的
+// 首次扫描进度。真实 Store 实现它;未接线时安静跳过(只是没有"扫描中"那几行,不影响既有列表)。
+type catalogScanProgressLister interface {
+ ListCatalogScanProgress(context.Context) ([]governance.CatalogScanProgress, error)
+}
+
+// scanningCatalogSources 把首次扫描中的来源投影成目录列表里的行:新来源不必等快照落地才出现。
+func scanningCatalogSources(ctx context.Context, store Store) []governance.CatalogSource {
+ lister, ok := store.(catalogScanProgressLister)
+ if !ok {
+ return nil
+ }
+ progress, err := lister.ListCatalogScanProgress(ctx)
+ if err != nil {
+ return nil
+ }
+ out := make([]governance.CatalogSource, 0, len(progress))
+ for _, item := range progress {
+ out = append(out, governance.CatalogSource{
+ ConnectionID: item.ConnectionID,
+ SourceType: item.SourceType,
+ Name: item.Name,
+ // 还没有快照:根节点与计数只报"已扫到多少",由前端按"首次扫描中"呈现。
+ RootNodeID: "",
+ FolderCount: item.DiscoveredDirectories,
+ FileCount: item.ScannedFiles,
+ ObservedAt: item.StartedAt,
+ SnapshotOnly: true,
+ SnapshotStatus: "scanning",
+ ScanProgress: item.Progress,
+ ScanMessage: item.Message,
+ })
+ }
+ return out
+}
+
func listCatalogNodes(w http.ResponseWriter, r *http.Request, store Store) {
filter := governance.CatalogNodeFilter{ConnectionID: r.URL.Query().Get("connection_id"), ParentNodeID: r.URL.Query().Get("parent_id"), Limit: 50}
if !validCatalogID(filter.ConnectionID) || !validCatalogID(filter.ParentNodeID) {
diff --git a/internal/platform/postgres/catalog_scan_progress_integration_test.go b/internal/platform/postgres/catalog_scan_progress_integration_test.go
new file mode 100644
index 0000000..f24b44e
--- /dev/null
+++ b/internal/platform/postgres/catalog_scan_progress_integration_test.go
@@ -0,0 +1,85 @@
+package postgres
+
+import (
+ "context"
+ "os"
+ "strings"
+ "testing"
+
+ "github.com/jackc/pgx/v5/pgxpool"
+)
+
+// 「正在首次扫描」的来源也必须出现在来源与目录里:进度取自 worker 写在任务载荷里的同一份计数,
+// 只有"已启用 + 还没有快照 + 有在跑/排队的 source.catalog.refresh"三者同时成立才算。
+func TestCatalogScanProgressShowsOnlySourcesWithoutSnapshot(t *testing.T) {
+ databaseURL := isolatedIntegrationDatabaseURL(t, os.Getenv("TEST_DATABASE_URL"))
+ if databaseURL == "" {
+ t.Skip("TEST_DATABASE_URL is not set")
+ }
+ ctx := context.Background()
+ pool, err := pgxpool.New(ctx, databaseURL)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer pool.Close()
+ if err := ApplyMigrations(ctx, pool); err != nil {
+ t.Fatal(err)
+ }
+ store := NewStore(pool)
+
+ // 四个来源:扫描中(无快照)、停用、已有快照、以及"有快照又恰好有一次失败任务"的来源。
+ if _, err := pool.Exec(ctx, `
+INSERT INTO source_connections(id,source_type,name,enabled) VALUES
+ ('conn-scan','dingtalk','公司级营销资料管理',TRUE),
+ ('conn-off','dingtalk','已停用的来源',FALSE),
+ ('conn-head','dingtalk','已完成首次扫描',TRUE);
+INSERT INTO jobs(id,type,payload,state,idempotency_key) VALUES
+ ('job-scan-running','source.catalog.refresh',
+ '{"connection_id":"conn-scan","progress":36,"message":"正在扫描目录:已完成 470 个文件夹,待处理 683 个","scanned_directories":470,"discovered_directories":1153,"scanned_files":1428}'::jsonb,
+ 'running','scan-running'),
+ ('job-scan-old','source.catalog.refresh',
+ '{"connection_id":"conn-scan","progress":99,"message":"上一次已完成,不该被当成当前进度"}'::jsonb,
+ 'completed','scan-old'),
+ ('job-off-running','source.catalog.refresh',
+ '{"connection_id":"conn-off","progress":12,"message":"停用来源不该出现"}'::jsonb,
+ 'running','scan-off'),
+ ('job-wrong-type','artifact.fetch',
+ '{"connection_id":"conn-scan","progress":80,"message":"别的任务类型不该被当成扫描进度"}'::jsonb,
+ 'running','scan-other'),
+ ('job-head-running','source.catalog.refresh',
+ '{"connection_id":"conn-head","progress":5,"message":"已有快照的来源不再按扫描中展示"}'::jsonb,
+ 'running','scan-head');
+INSERT INTO source_catalog_snapshots(id,source_connection_id,snapshot_sha256,source_label,node_count,folder_count,file_count,observed_at,created_at)
+VALUES('snap-head','conn-head',repeat('a',64),'已完成首次扫描',1,1,0,now(),now());
+INSERT INTO source_catalog_nodes(snapshot_id,node_id,node_type,name,relative_path,source_locator_hash,sort_order,direct_child_count,subtree_file_count,subtree_bytes)
+VALUES('snap-head','root-head','folder','已完成首次扫描','',repeat('b',64),0,0,0,0);
+INSERT INTO source_catalog_heads(source_connection_id,snapshot_id,activated_at)
+VALUES('conn-head','snap-head',now());`); err != nil {
+ t.Fatal(err)
+ }
+
+ progress, err := store.ListCatalogScanProgress(ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(progress) != 1 {
+ t.Fatalf("scanning sources = %d (%+v), want only the one without a snapshot", len(progress), progress)
+ }
+ item := progress[0]
+ if item.ConnectionID != "conn-scan" || item.Name != "公司级营销资料管理" {
+ t.Fatalf("progress item = %+v", item)
+ }
+ // 取的是在跑的那次任务,不是历史上已完成的那次。
+ if item.Progress != 36 {
+ t.Fatalf("progress = %d, want 36 (the running job, not the completed one)", item.Progress)
+ }
+ if item.ScannedDirectories != 470 || item.DiscoveredDirectories != 1153 || item.ScannedFiles != 1428 {
+ t.Fatalf("counters = %+v", item)
+ }
+ if !strings.Contains(item.Message, "470 个文件夹") {
+ t.Fatalf("message = %q", item.Message)
+ }
+ if item.StartedAt.IsZero() {
+ t.Fatal("started_at should carry the scan start so the page can show a time")
+ }
+}
\ No newline at end of file
diff --git a/internal/platform/postgres/source_catalog.go b/internal/platform/postgres/source_catalog.go
index c9a945e..d052b36 100644
--- a/internal/platform/postgres/source_catalog.go
+++ b/internal/platform/postgres/source_catalog.go
@@ -12,6 +12,58 @@ import (
var ErrCatalogNodeNotFound = errors.New("catalog node not found")
+// ListCatalogScanProgress 列出「已启用、但还没有快照」的来源的首次扫描进度。
+// 进度取自 worker 写在任务载荷里的同一份计数(jobs.payload),不另立一套口径:
+// 新来源在首次扫描完成前也能出现在「来源与目录」里,而不是等快照落地才出现。
+func (s *Store) ListCatalogScanProgress(ctx context.Context) ([]governance.CatalogScanProgress, error) {
+ rows, err := s.db.Query(ctx, `
+SELECT connection.id, connection.source_type, connection.name,
+ COALESCE(NULLIF(job.payload->>'progress','')::integer,0),
+ COALESCE(job.payload->>'message',''),
+ COALESCE(NULLIF(job.payload->>'scanned_directories','')::integer,0),
+ COALESCE(NULLIF(job.payload->>'discovered_directories','')::integer,0),
+ COALESCE(NULLIF(job.payload->>'scanned_files','')::integer,0),
+ job.created_at
+FROM source_connections connection
+JOIN LATERAL (
+ SELECT candidate.*
+ FROM jobs candidate
+ WHERE candidate.type='source.catalog.refresh'
+ AND candidate.state IN ('pending','running','retry')
+ AND candidate.payload->>'connection_id'=connection.id
+ ORDER BY candidate.created_at DESC
+ LIMIT 1
+) job ON TRUE
+LEFT JOIN source_catalog_heads head ON head.source_connection_id=connection.id
+WHERE connection.enabled AND head.source_connection_id IS NULL
+ORDER BY job.created_at DESC, connection.id`)
+ if err != nil {
+ return nil, fmt.Errorf("list catalog scan progress: %w", err)
+ }
+ defer rows.Close()
+ result := make([]governance.CatalogScanProgress, 0)
+ for rows.Next() {
+ var item governance.CatalogScanProgress
+ var sourceType string
+ if err := rows.Scan(&item.ConnectionID, &sourceType, &item.Name, &item.Progress, &item.Message,
+ &item.ScannedDirectories, &item.DiscoveredDirectories, &item.ScannedFiles, &item.StartedAt); err != nil {
+ return nil, fmt.Errorf("scan catalog scan progress: %w", err)
+ }
+ item.SourceType = governance.SourceType(sourceType)
+ if !item.SourceType.Valid() {
+ return nil, errors.New("invalid catalog scan progress projection")
+ }
+ if item.Progress < 0 {
+ item.Progress = 0
+ }
+ if item.Progress > 100 {
+ item.Progress = 100
+ }
+ result = append(result, item)
+ }
+ return result, rows.Err()
+}
+
func (s *Store) ListCatalogSources(ctx context.Context) ([]governance.CatalogSource, error) {
rows, err := s.db.Query(ctx, `
SELECT connection.id, connection.source_type, snapshot.source_label, root.node_id,
diff --git a/web/src/SourceCatalogBrowser.test.tsx b/web/src/SourceCatalogBrowser.test.tsx
index 3485c36..f2889dd 100644
--- a/web/src/SourceCatalogBrowser.test.tsx
+++ b/web/src/SourceCatalogBrowser.test.tsx
@@ -10,6 +10,16 @@ const page:CatalogNodePage={current:{...node('公司级技术支持知识库','f
describe('SourceCatalogBrowserView',()=>{
+ it('shows a source that is still doing its first scan, with progress',()=>{
+ const scanning:CatalogSource={...source,connection_id:'conn-scan',name:'公司级营销资料管理',root_node_id:'',folder_count:1153,file_count:1428,snapshot_status:'scanning',scan_progress:36,scan_message:'正在扫描目录:已完成 470 个文件夹,待处理 683 个',last_refresh_duration_ms:0}
+ const html=renderToStaticMarkup()
+ // 新来源不必等快照落地就出现在列表里,并且带百分比。
+ for(const text of ['公司级营销资料管理','首次扫描中 36%','首次扫描中 · 36%','正在扫描目录:已完成 470 个文件夹,待处理 683 个','已发现约 1428 份文件'])expect(html).toContain(text)
+ // 还没有目录:不渲染空目录、也不提供标注/格式筛选入口。
+ expect(html).not.toContain('当前目录为空。')
+ expect(html).not.toContain('禁止导入')
+ })
+
it('uses a Windows-style path bar instead of a directory tree',()=>{
const html=renderToStaticMarkup()
expect(html).toContain('aria-label="当前目录路径"')
diff --git a/web/src/SourceCatalogBrowser.tsx b/web/src/SourceCatalogBrowser.tsx
index dfcabfd..ec22629 100644
--- a/web/src/SourceCatalogBrowser.tsx
+++ b/web/src/SourceCatalogBrowser.tsx
@@ -56,11 +56,16 @@ export function SourceCatalogBrowserView({sources,selectedSource,page,loading,er
- {selectedSource&&page?<>
+ {selectedSource&&selectedSource.snapshot_status==='scanning'?
+ 首次扫描中 · {selectedSource.scan_progress??0}%{selectedSource.name}
+ :selectedSource&&page?<>
@@ -99,8 +104,10 @@ export function SourceCatalogBrowser(){
const closeHistory=()=>{setHistoryOpen(false);setHistoryActive(null);setHistoryPage(null);setHistoryError(null)}
useEffect(()=>{const controller=new AbortController();setLoading(true);void fetchCatalogSources(controller.signal).then(result=>{if(controller.signal.aborted)return;setSources(result);setSelected(current=>current&&result.find(source=>source.connection_id===current.connection_id)||result[0]||null);setParentID(current=>current||result[0]?.root_node_id||'');setError(null)}).catch(cause=>{if(!controller.signal.aborted)setError(cause instanceof Error?cause.message:'加载来源目录失败')}).finally(()=>{if(!controller.signal.aborted)setLoading(false)});return()=>controller.abort()},[revision])
- useEffect(()=>{if(!selected||!parentID)return;const controller=new AbortController();setLoading(true);void fetchCatalogNodes(selected.connection_id,parentID,50,offset,controller.signal).then(result=>{if(!controller.signal.aborted){setPage(result);setError(null)}}).catch(cause=>{if(!controller.signal.aborted)setError(cause instanceof Error?cause.message:'加载目录失败')}).finally(()=>{if(!controller.signal.aborted)setLoading(false)});return()=>controller.abort()},[selected,parentID,offset,revision])
+ useEffect(()=>{if(!selected||!parentID||selected.snapshot_status==='scanning')return;const controller=new AbortController();setLoading(true);void fetchCatalogNodes(selected.connection_id,parentID,50,offset,controller.signal).then(result=>{if(!controller.signal.aborted){setPage(result);setError(null)}}).catch(cause=>{if(!controller.signal.aborted)setError(cause instanceof Error?cause.message:'加载目录失败')}).finally(()=>{if(!controller.signal.aborted)setLoading(false)});return()=>controller.abort()},[selected,parentID,offset,revision])
+ // 有来源正在首次扫描时自动刷新列表:百分比会自己往前走,扫完那一行自动变成正式来源。
+ useEffect(()=>{if(!sources.some(source=>source.snapshot_status==='scanning'))return;const timer=window.setTimeout(()=>setRevision(value=>value+1),3000);return()=>window.clearTimeout(timer)},[sources])
useEffect(()=>{const controller=new AbortController();void fetchCatalogRoutingCapabilities(controller.signal).then(setRoutingCapabilities).catch(()=>setRoutingCapabilities({internal_enabled:false,external_enabled:false}));return()=>controller.abort()},[revision])
useEffect(()=>{if(!selected)return;const controller=new AbortController();void fetchJobs(controller.signal).then(items=>{if(controller.signal.aborted)return;const match=items.find(job=>job.type==='source.catalog.refresh'&&job.payload&&typeof job.payload==='object'&&(job.payload as Record).connection_id===selected.connection_id);setRefreshJob(match||null)}).catch(()=>undefined);return()=>controller.abort()},[selected])
useEffect(()=>{if(!refreshJob||!['pending','running','retry'].includes(refreshJob.state))return;const timer=window.setTimeout(()=>void fetchJobs().then(items=>{const current=items.find(job=>job.id===refreshJob.id);if(!current)return;setRefreshJob(previous=>{if(previous?.state!=='completed'&¤t.state==='completed')setRevision(value=>value+1);return current})}).catch(()=>undefined),750);return()=>window.clearTimeout(timer)},[refreshJob])
diff --git a/web/src/sourceCatalog.test.ts b/web/src/sourceCatalog.test.ts
index 36a0994..0e48a78 100644
--- a/web/src/sourceCatalog.test.ts
+++ b/web/src/sourceCatalog.test.ts
@@ -4,6 +4,26 @@ import { fetchAllCatalogFolders,fetchCatalogNodes,fetchCatalogRoutingCapabilitie
afterEach(()=>vi.unstubAllGlobals())
describe('source catalog API',()=>{
+ it('keeps a source that is still scanning, with its progress',async()=>{
+ const fetchMock=vi.fn().mockResolvedValue(new Response(JSON.stringify({data:[
+ {connection_id:'conn-scan',source_type:'dingtalk',name:'公司级营销资料管理',root_node_id:'',folder_count:1153,file_count:1428,observed_at:'2026-10-10T08:51:44Z',snapshot_only:true,snapshot_status:'scanning',last_refresh_duration_ms:0,scan_progress:36,scan_message:'正在扫描目录:已完成 470 个文件夹,待处理 683 个'},
+ {connection_id:'conn-1',source_type:'dingtalk',name:'公司级技术支持知识库',root_node_id:'root-1',folder_count:8,file_count:3468,observed_at:'2026-09-08T00:00:00Z',snapshot_only:true,snapshot_status:'ready',last_refresh_duration_ms:12000}
+ ],summary:{total:2}})))
+ vi.stubGlobal('fetch',fetchMock)
+ const sources=await fetchCatalogSources()
+ expect(sources).toHaveLength(2)
+ expect(sources[0].snapshot_status).toBe('scanning')
+ expect(sources[0].scan_progress).toBe(36)
+ expect(sources[0].scan_message).toContain('470 个文件夹')
+ expect(sources[1].snapshot_status).toBe('ready')
+ expect(sources[1].scan_progress).toBeUndefined()
+ })
+
+ it('rejects a scanning source without progress instead of rendering a fake 0%',async()=>{
+ const fetchMock=vi.fn().mockResolvedValue(new Response(JSON.stringify({data:[{connection_id:'conn-scan',source_type:'dingtalk',name:'X',root_node_id:'',folder_count:0,file_count:0,observed_at:'2026-10-10T08:51:44Z',snapshot_only:true,snapshot_status:'scanning',last_refresh_duration_ms:0}],summary:{total:1}})))
+ vi.stubGlobal('fetch',fetchMock)
+ await expect(fetchCatalogSources()).rejects.toThrow(/来源目录响应无效/)
+ })
it('loads safe source roots',async()=>{
const fetchMock=vi.fn().mockResolvedValue(new Response(JSON.stringify({data:[{connection_id:'conn-1',source_type:'dingtalk',name:'公司级技术支持知识库',root_node_id:'root-1',folder_count:8,file_count:3468,observed_at:'2026-09-08T00:00:00Z',snapshot_only:true,snapshot_status:'ready',last_refresh_duration_ms:12000,secret:'drop'}],summary:{total:1}})))
vi.stubGlobal('fetch',fetchMock)
diff --git a/web/src/sourceCatalog.ts b/web/src/sourceCatalog.ts
index 25e48d1..5f3c00a 100644
--- a/web/src/sourceCatalog.ts
+++ b/web/src/sourceCatalog.ts
@@ -3,7 +3,7 @@ import { newOperationID } from './operationKey'
export type CatalogSourceType='dingtalk'|'pp'|'alist'
export type CatalogPolicy='internal'|'external'|'both'|'blocked'
-export interface CatalogSource {connection_id:string;source_type:CatalogSourceType;name:string;root_node_id:string;folder_count:number;file_count:number;observed_at:string;snapshot_only:boolean;snapshot_status:'ready';last_refresh_duration_ms:number}
+export interface CatalogSource {connection_id:string;source_type:CatalogSourceType;name:string;root_node_id:string;folder_count:number;file_count:number;observed_at:string;snapshot_only:boolean;snapshot_status:'ready'|'scanning';last_refresh_duration_ms:number;scan_progress?:number;scan_message?:string}
export interface CatalogBreadcrumb {node_id:string;name:string}
export interface CatalogNode {node_id:string;parent_node_id?:string;node_type:'folder'|'file';name:string;direct_child_count:number;subtree_file_count:number;subtree_bytes:number;size_bytes?:number;modified_at?:string;content_sha256?:string;visibility:'internal'|'external'|'both'|'blocked'|'mixed'|'unknown';imported_count:number;parsed_count:number;active_count:number;failed_count:number;routable_count:number}
export interface CatalogSnapshot {snapshot_id:string;connection_id:string;root_node_id:string;source_name:string;node_count:number;folder_count:number;file_count:number;observed_at:string;created_at:string;is_head:boolean}
@@ -22,8 +22,11 @@ export async function fetchCatalogSources(signal?:AbortSignal):Promise{
- if(!record(raw)||typeof raw.connection_id!=='string'||typeof raw.source_type!=='string'||!sourceTypes.has(raw.source_type)||typeof raw.name!=='string'||typeof raw.root_node_id!=='string'||!count(raw.folder_count)||!count(raw.file_count)||typeof raw.observed_at!=='string'||raw.snapshot_only!==true||raw.snapshot_status!=='ready'||!count(raw.last_refresh_duration_ms))throw new Error('来源目录响应无效')
- return {connection_id:raw.connection_id,source_type:raw.source_type as CatalogSourceType,name:raw.name,root_node_id:raw.root_node_id,folder_count:raw.folder_count,file_count:raw.file_count,observed_at:raw.observed_at,snapshot_only:true,snapshot_status:'ready',last_refresh_duration_ms:raw.last_refresh_duration_ms}
+ if(!record(raw)||typeof raw.connection_id!=='string'||typeof raw.source_type!=='string'||!sourceTypes.has(raw.source_type)||typeof raw.name!=='string'||typeof raw.root_node_id!=='string'||!count(raw.folder_count)||!count(raw.file_count)||typeof raw.observed_at!=='string'||raw.snapshot_only!==true||(raw.snapshot_status!=='ready'&&raw.snapshot_status!=='scanning')||!count(raw.last_refresh_duration_ms))throw new Error('来源目录响应无效')
+ // scanning = 已登记但首次扫描还没落地:带进度,正好让新来源立刻出现在列表里。
+ const scanning=raw.snapshot_status==='scanning'
+ if(scanning&&!count(raw.scan_progress))throw new Error('来源目录响应无效')
+ return {connection_id:raw.connection_id,source_type:raw.source_type as CatalogSourceType,name:raw.name,root_node_id:raw.root_node_id,folder_count:raw.folder_count,file_count:raw.file_count,observed_at:raw.observed_at,snapshot_only:true,snapshot_status:raw.snapshot_status as 'ready'|'scanning',last_refresh_duration_ms:raw.last_refresh_duration_ms,scan_progress:scanning?raw.scan_progress as number:undefined,scan_message:typeof raw.scan_message==='string'?raw.scan_message:undefined}
})
}
export async function fetchCatalogSnapshots(connectionID:string,limit=20,offset=0,signal?:AbortSignal):Promise{
diff --git a/web/src/sourceCatalogBrowser.css b/web/src/sourceCatalogBrowser.css
index c8afc57..7148050 100644
--- a/web/src/sourceCatalogBrowser.css
+++ b/web/src/sourceCatalogBrowser.css
@@ -29,3 +29,13 @@
.pill-dot.retry{background:var(--c-warn)}
.catalog-refresh-hide{margin-left:auto;border:0;background:transparent;color:#4c7d9e;font:inherit;font-size:11px;text-decoration:underline;padding:0 2px}
.catalog-refresh-failed-note{margin:6px 0 0;color:var(--c-fail);font-size:11px}
+
+/* 首次扫描中的来源:还没快照,但立刻出现在列表里并显示进度。 */
+.catalog-source.scanning strong { color: #b45309; }
+.catalog-scanning-state { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--border, #e3e8ec); border-radius: 10px; background: var(--card, #fff); }
+.catalog-scanning-state > div { display: flex; align-items: baseline; gap: 10px; }
+.catalog-scanning-state strong { font-size: 15px; }
+.catalog-scanning-state span { color: var(--muted-foreground, #5b6773); font-size: 13px; }
+.catalog-scanning-state progress { width: 100%; height: 10px; }
+.catalog-scanning-state p { margin: 0; font-size: 13px; }
+.catalog-scanning-state small { color: var(--muted-foreground, #5b6773); font-size: 12px; }