Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix ChatView header overflow for long thread titles #60

Mergedjuliusmarmingemerged 2 commits intomain fromcodething/d847b414merged by juliusmarminge View on GitHub

Showing 5 changed files with 61 additions and 31 deletions (loading 3).

x
0 of 5 viewed, 5 left
14 additions and 10 deletionsapps/web/src/components/ChatView.tsxModified
View file
@@ -51,7 +51,7 @@
} from "../session-logic";
import { isScrollContainerNearBottom } from "../chat-scroll";
import { useStore } from "../store";
-import type { ChatImageAttachment } from "../types";
+import { MAX_THREAD_TERMINAL_COUNT, type ChatImageAttachment } from "../types";
import BranchToolbar from "./BranchToolbar";
import GitActionsControl from "./GitActionsControl";
import {
@@ -294,6 +294,8 @@
(activeThread.messages.length > 0 ||
(activeThread.session !== null && activeThread.session.status !== "closed")),
+ const hasReachedTerminalLimit =
+ (activeThread?.terminalIds.length ?? 0) >= MAX_THREAD_TERMINAL_COUNT;
​
const revokePreviewUrls = useCallback((images: Array<{ previewUrl?: string }>) => {
for (const image of images) {
@@ -322,23 +324,23 @@
});
}, [activeThread?.terminalOpen, activeThreadId, dispatch]);
const splitTerminal = useCallback(() => {
- if (!activeThreadId) return;
+ if (!activeThreadId || hasReachedTerminalLimit) return;
dispatch({
type: "SPLIT_THREAD_TERMINAL",
threadId: activeThreadId,
terminalId: `terminal-${crypto.randomUUID()}`,