feat: project dropdown in sidebar, resizable AI sidebar with snap, ctx & t/s telemetry, live line-number re-anchoring, and thinking indicator
This commit is contained in:
@@ -328,6 +328,25 @@ export class AIStore {
|
||||
});
|
||||
}
|
||||
|
||||
/** Update a suggestion's line number or text anchor when editor blocks shift. */
|
||||
async updateSuggestion(
|
||||
sessionId: string,
|
||||
suggestionId: string,
|
||||
patch: Partial<Pick<AISuggestion, "lineNumber" | "originalText" | "newText" | "text">>,
|
||||
): Promise<AISession> {
|
||||
return this.withTransaction(async () => {
|
||||
const session = this.require(sessionId);
|
||||
const suggestion = session.suggestions.find((s) => s.id === suggestionId);
|
||||
if (!suggestion) return this.clone(session);
|
||||
if (patch.lineNumber !== undefined) suggestion.lineNumber = patch.lineNumber;
|
||||
if (patch.originalText !== undefined) suggestion.originalText = patch.originalText;
|
||||
if (patch.newText !== undefined) suggestion.newText = patch.newText;
|
||||
if (patch.text !== undefined) suggestion.text = patch.text;
|
||||
session.updatedAt = nowIso();
|
||||
return this.clone(session);
|
||||
});
|
||||
}
|
||||
|
||||
/** Add a note to a session and persist it. */
|
||||
async addNote(sessionId: string, note: Omit<AINote, "id" | "createdAt" | "updatedAt">): Promise<AISession> {
|
||||
return this.withTransaction(async () => {
|
||||
|
||||
Reference in New Issue
Block a user