feat: 添加增量更新命令以支持单文件索引更新

This commit is contained in:
catlog22
2026-01-15 18:14:51 +08:00
parent c24ed016cb
commit c308e429f8
3 changed files with 85 additions and 9 deletions

View File

@@ -6381,12 +6381,12 @@ async function showWatcherControlModal() {
// Get first indexed project path as default
let defaultPath = '';
if (indexes.success && indexes.projects && indexes.projects.length > 0) {
// Sort by last_indexed desc and pick the most recent
const sorted = indexes.projects.sort((a, b) =>
new Date(b.last_indexed || 0) - new Date(a.last_indexed || 0)
if (indexes.success && indexes.indexes && indexes.indexes.length > 0) {
// Sort by lastModified desc and pick the most recent
const sorted = indexes.indexes.sort((a, b) =>
new Date(b.lastModified || 0) - new Date(a.lastModified || 0)
);
defaultPath = sorted[0].source_root || '';
defaultPath = sorted[0].path || '';
}
const modalHtml = buildWatcherControlContent(status, defaultPath);

View File

@@ -956,15 +956,13 @@ function renderSkillFileModal() {
</div>
<!-- Content -->
<div class="flex-1 overflow-hidden p-4">
<div class="flex-1 min-h-0 overflow-auto p-4">
${isEditing ? `
<textarea id="skillFileContent"
class="w-full h-full min-h-[400px] px-4 py-3 bg-background border border-border rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary resize-none"
spellcheck="false">${escapeHtml(content)}</textarea>
` : `
<div class="w-full h-full min-h-[400px] overflow-auto">
<pre class="px-4 py-3 bg-muted/30 rounded-lg text-sm font-mono whitespace-pre-wrap break-words">${escapeHtml(content)}</pre>
</div>
<pre class="px-4 py-3 bg-muted/30 rounded-lg text-sm font-mono whitespace-pre-wrap break-words">${escapeHtml(content)}</pre>
`}
</div>