feat(git-diff): add React Query with pull-to-refresh and cleaner diff display
- Add useGitDiffQuery hook using React Query for caching and revalidation - Add sendRpcRequest utility for promisified WebSocket RPC with requestId matching - Add requestId to git_diff_request/response for proper request correlation - Enable pull-to-refresh via RefreshControl in GitDiffPane - Auto-revalidate when sidebar opens with "changes" tab active - Clean up diff display: remove metadata noise, strip +/- prefixes - Default both sidebars open on web platform 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
8c33df472f
commit
348242541c
@@ -450,6 +450,7 @@ export const AgentPermissionResponseMessageSchema = z.object({
|
||||
export const GitDiffRequestSchema = z.object({
|
||||
type: z.literal("git_diff_request"),
|
||||
agentId: z.string(),
|
||||
requestId: z.string().optional(),
|
||||
});
|
||||
|
||||
const FileExplorerEntrySchema = z.object({
|
||||
@@ -736,6 +737,7 @@ export const GitDiffResponseSchema = z.object({
|
||||
agentId: z.string(),
|
||||
diff: z.string(),
|
||||
error: z.string().nullable(),
|
||||
requestId: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -840,7 +840,7 @@ export class Session {
|
||||
break;
|
||||
|
||||
case "git_diff_request":
|
||||
await this.handleGitDiffRequest(msg.agentId);
|
||||
await this.handleGitDiffRequest(msg.agentId, msg.requestId);
|
||||
break;
|
||||
|
||||
case "file_explorer_request":
|
||||
@@ -1967,7 +1967,7 @@ export class Session {
|
||||
/**
|
||||
* Handle git diff request for an agent
|
||||
*/
|
||||
private async handleGitDiffRequest(agentId: string): Promise<void> {
|
||||
private async handleGitDiffRequest(agentId: string, requestId?: string): Promise<void> {
|
||||
console.log(
|
||||
`[Session ${this.clientId}] Handling git diff request for agent ${agentId}`
|
||||
);
|
||||
@@ -1983,6 +1983,7 @@ export class Session {
|
||||
agentId,
|
||||
diff: "",
|
||||
error: `Agent not found: ${agentId}`,
|
||||
requestId,
|
||||
},
|
||||
});
|
||||
return;
|
||||
@@ -1998,6 +1999,7 @@ export class Session {
|
||||
agentId,
|
||||
diff: stdout,
|
||||
error: null,
|
||||
requestId,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2015,6 +2017,7 @@ export class Session {
|
||||
agentId,
|
||||
diff: "",
|
||||
error: error.message,
|
||||
requestId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user