diff --git a/src/main/services/team/FileContentResolver.ts b/src/main/services/team/FileContentResolver.ts index 58474949..0795b417 100644 --- a/src/main/services/team/FileContentResolver.ts +++ b/src/main/services/team/FileContentResolver.ts @@ -74,6 +74,19 @@ export class FileContentResolver { logger.debug(`Файл недоступен на диске: ${filePath}`); } + // Fast path: if the agent created the file and it still exists on disk, + // the original content is definitely empty, so skip expensive history lookup. + const hasWriteNew = snippets.some((s) => !s.isError && s.type === 'write-new'); + if (hasWriteNew && currentContent !== null) { + const result = { + original: '', + modified: currentContent, + source: 'snippet-reconstruction' as const, + }; + this.cacheResult(cacheKey, result); + return result; + } + // Strategy 1: Try file-history backup const historyResult = await this.tryFileHistoryBackup(teamName, memberName, filePath); if (historyResult) { diff --git a/src/renderer/components/team/ClaudeLogsSection.tsx b/src/renderer/components/team/ClaudeLogsSection.tsx index e8dfa2c0..a6ceb73e 100644 --- a/src/renderer/components/team/ClaudeLogsSection.tsx +++ b/src/renderer/components/team/ClaudeLogsSection.tsx @@ -123,7 +123,7 @@ export const ClaudeLogsSection = ({ ) : undefined } - headerContentClassName={isSidebar ? 'flex-wrap items-center gap-y-1 py-1 pr-3' : 'pr-3'} + headerContentClassName={isSidebar ? 'flex-wrap items-center gap-y-1 py-1 pr-1' : 'pr-1'} headerExtra={sectionHeaderExtra} defaultOpen={false} contentClassName="pt-0 [overflow-anchor:none]" diff --git a/src/renderer/components/team/CollapsibleTeamSection.tsx b/src/renderer/components/team/CollapsibleTeamSection.tsx index 82743da9..2cd656ee 100644 --- a/src/renderer/components/team/CollapsibleTeamSection.tsx +++ b/src/renderer/components/team/CollapsibleTeamSection.tsx @@ -85,7 +85,7 @@ export const CollapsibleTeamSection = ({ >