Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@

interface ChatViewProps {
threadId: ThreadId;
tabBar?: React.ReactNode;
}

export default function ChatView({ threadId }: ChatViewProps) {
export default function ChatView({ threadId, tabBar }: ChatViewProps) {
const threads = useStore((store) => store.threads);
const projects = useStore((store) => store.projects);
const markThreadVisited = useStore((store) => store.markThreadVisited);
Expand Down Expand Up @@ -3149,7 +3150,7 @@
const nextThreadTitle = truncateTitle(buildPlanImplementationThreadTitle(planMarkdown));
const nextThreadModel: ModelSlug =
selectedModel ||
(activeSubThread?.model as ModelSlug) ||

Check warning on line 3153 in apps/web/src/components/ChatView.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint-plugin-react-hooks(exhaustive-deps)

React Hook useCallback has a missing dependency: 'activeSubThread.model'
(activeProject.model as ModelSlug) ||
(globalFavorite?.model as ModelSlug) ||
DEFAULT_MODEL_BY_PROVIDER.codex;
Expand Down Expand Up @@ -3625,6 +3626,8 @@
/>
</header>

{tabBar}

{/* Error banner */}
<ProviderHealthBanner status={activeProviderStatus} />
<ThreadErrorBanner
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/routes/_chat.$threadId.$subThreadId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
});

if (isActive) {
const remaining = thread.subThreads.filter((s) => s.id !== targetSubThreadId);

Check warning on line 141 in apps/web/src/routes/_chat.$threadId.$subThreadId.tsx

View workflow job for this annotation

GitHub Actions / Format, Lint, Typecheck, Test, Browser Test, Build

eslint-plugin-unicorn(prefer-array-find)

Prefer `find` over filtering and accessing the first result.
const fallback = remaining[0];
if (fallback) {
void api.orchestration.dispatchCommand({
Expand Down Expand Up @@ -196,8 +196,7 @@
return (
<>
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
{tabBar}
<ChatView key={`${threadId}:${subThreadId}`} threadId={threadId} />
<ChatView key={`${threadId}:${subThreadId}`} threadId={threadId} tabBar={tabBar} />
</SidebarInset>
<DiffPanelInlineSidebar
diffOpen={diffOpen}
Expand All @@ -212,8 +211,7 @@
return (
<>
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
{tabBar}
<ChatView key={`${threadId}:${subThreadId}`} threadId={threadId} />
<ChatView key={`${threadId}:${subThreadId}`} threadId={threadId} tabBar={tabBar} />
</SidebarInset>
<DiffPanelSheet diffOpen={diffOpen} onCloseDiff={closeDiff}>
{shouldRenderDiffContent ? <LazyDiffPanel mode="sheet" /> : null}
Expand Down
Loading