fix: keep generated prompts scrolled into view
Force chat to bottom on normal sends Scroll generated commit prompts into view Preserve saved scroll restore for passive navigation
This commit is contained in:
@@ -51,6 +51,13 @@ const getRuntimeGit = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
const requestChatForceScrollBottom = (sessionId: string) => {
|
||||
if (typeof window === 'undefined') return;
|
||||
window.dispatchEvent(new CustomEvent('openchamber:chat-force-scroll-bottom', {
|
||||
detail: { sessionId },
|
||||
}));
|
||||
};
|
||||
|
||||
export async function checkIsGitRepository(directory: string): Promise<boolean> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.checkIsGitRepository(directory);
|
||||
@@ -373,6 +380,8 @@ const runStructuredGenerationInActiveSession = async ({
|
||||
throw new Error('Generation prompts are empty');
|
||||
}
|
||||
|
||||
requestChatForceScrollBottom(generationSession.sessionId);
|
||||
|
||||
const response = await opencodeClient.withDirectory(directory, async () => {
|
||||
return opencodeClient.getApiClient().session.prompt({
|
||||
sessionID: generationSession.sessionId,
|
||||
|
||||
Reference in New Issue
Block a user