Fix VS Code extension (vibe-kanban) (#1074)

* ##  Implementation Complete

Successfully refactored the VS Code integration into the new full-page logs view. Here's what was done:

### Changes Made:

1. **[main.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/main.tsx)** - Removed global VS Code bridge import
2. **[App.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/App.tsx)** - Removed `AppWithStyleOverride` and `WebviewContextMenu` from global app, added new route
3. **[full-attempt-logs.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/full-attempt-logs.tsx)** - New page with ALL VS Code integration self-contained
4. **[paths.ts](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/lib/paths.ts)** - Added `attemptFull()` helper

### Benefits:
 **Clean separation** - Main app has zero VS Code code
 **No conditional logic** - No more `inIframe()` checks in main app
 **Single source** - All VS Code integration in one place
 **More readable** - Clear which code is for which use case
 **Passes all checks** - TypeScript and Rust checks pass

The new page at `/projects/:projectId/tasks/:taskId/attempts/:attemptId/full` is ready for the VS Code extension to load!

* Cleanup script changes for task attempt 1dde75e7-9ab0-41f9-b900-ae395bde2045

* ##  Fix Applied Successfully

Added the missing `ExecutionProcessesProvider` to [full-attempt-logs.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/full-attempt-logs.tsx).

### Changes Made:
1. **Import added** - `ExecutionProcessesProvider` from contexts
2. **Conditional wrapping** - Only wraps `TaskAttemptPanel` when `attempt` exists
3. **Minimal provider setup** - Only the one required provider, nothing extra

### Why This Works:
- `RetryUiProvider` (inside TaskAttemptPanel) needs `ExecutionProcessesContext`
- When `attempt` is undefined, TaskAttemptPanel shows its own loading state
- When `attempt` loads, provider is mounted before RetryUiProvider tries to access context

All type checks pass 

* ##  Complete Provider Fix Applied

Successfully added all required providers to [full-attempt-logs.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/full-attempt-logs.tsx).

### All Providers Now in Place:

**Provider hierarchy** (matching [project-tasks.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/project-tasks.tsx) exactly):
1. **ClickedElementsProvider** (with attempt) - Scopes clicked elements state
2. **ReviewProvider** - Provides review/comment functionality for follow-up
3. **ExecutionProcessesProvider** - Provides execution process state
4. **TaskAttemptPanel** - Internally provides EntriesProvider & RetryUiProvider

### What This Fixes:
-  `useExecutionProcessesContext` error - fixed with ExecutionProcessesProvider
-  `useReview` error - fixed with ReviewProvider
-  All follow-up functionality now has required context
-  Clicked elements properly scoped to this attempt
-  All type checks pass

No more provider errors - the full logs page now has complete context setup! 🎉

* ##  Fixes Applied Successfully

Updated [full-attempt-logs.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/full-attempt-logs.tsx):

### 1. Navbar Height Reduced
- **Before:** `h-12` (3rem)
- **After:** `h-6` (1.5rem) - approximately half

### 2. VirtualizedList Container Fixed
Added `flex flex-col` to logs wrapper (2 places):
- **Before:** `<div className="flex-1 min-h-0">{logs}</div>`
- **After:** `<div className="flex-1 min-h-0 flex flex-col">{logs}</div>`

### Why This Works:
The fix creates the proper flex container chain:
- `main` (flex container) → `logs wrapper` (flex container) → `VirtuosoMessageList` (flex item)
- This allows VirtuosoMessageList to compute a definite height and scroll smoothly
- Now matches the working implementation in project-tasks.tsx

All type checks pass 

* Cleanup script changes for task attempt 1dde75e7-9ab0-41f9-b900-ae395bde2045

* ##  Visual Improvements Applied

Made the requested styling changes:

### 1. Logo Size Reduced
- **Added width prop** to [Logo component](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/components/logo.tsx) (default: 140)
- **Set to 80** in full-attempt-logs page (vs default 140)
- Logo now fits proportionally in the h-6 navbar without looking squished

### 2. Background Changed to Muted
- **Before:** `bg-background`
- **After:** `bg-muted`
- Gives a more subtle, muted appearance

All type checks pass 

* ##  Navbar Removed

Removed the header/navbar from [full-attempt-logs.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/1dde-please-create-a/frontend/src/pages/full-attempt-logs.tsx):
- Deleted header element with Logo
- Removed unused Logo import
- Main content now takes up full screen height

All type checks pass 

* reset navbar
This commit is contained in:
Louis Knight-Webb
2025-10-22 10:43:32 +01:00
committed by GitHub
parent 76535ba457
commit 85796360d3
4 changed files with 118 additions and 40 deletions

View File

@@ -4,6 +4,7 @@ import { I18nextProvider } from 'react-i18next';
import i18n from '@/i18n';
import { Projects } from '@/pages/projects';
import { ProjectTasks } from '@/pages/project-tasks';
import { FullAttemptLogsPage } from '@/pages/full-attempt-logs';
import { NormalLayout } from '@/components/layout/NormalLayout';
import { usePostHog } from 'posthog-js/react';
@@ -29,8 +30,6 @@ import { ThemeMode } from 'shared/types';
import * as Sentry from '@sentry/react';
import { Loader } from '@/components/ui/loader';
import { AppWithStyleOverride } from '@/utils/style-override';
import { WebviewContextMenu } from '@/vscode/ContextMenu';
import NiceModal from '@ebay/nice-modal-react';
import { OnboardingResult } from './components/dialogs/global/OnboardingDialog';
import { ClickedElementsProvider } from './contexts/ClickedElementsProvider';
@@ -157,44 +156,46 @@ function AppContent() {
return (
<I18nextProvider i18n={i18n}>
<ThemeProvider initialTheme={config?.theme || ThemeMode.SYSTEM}>
<AppWithStyleOverride>
<SearchProvider>
<div className="h-screen flex flex-col bg-background">
<WebviewContextMenu />
<SearchProvider>
<div className="h-screen flex flex-col bg-background">
<SentryRoutes>
{/* VS Code full-page logs route (outside NormalLayout for minimal UI) */}
<Route
path="/projects/:projectId/tasks/:taskId/attempts/:attemptId/full"
element={<FullAttemptLogsPage />}
/>
<SentryRoutes>
<Route element={<NormalLayout />}>
<Route path="/" element={<Projects />} />
<Route path="/projects" element={<Projects />} />
<Route path="/projects/:projectId" element={<Projects />} />
<Route
path="/projects/:projectId/tasks"
element={<ProjectTasks />}
/>
<Route path="/settings/*" element={<SettingsLayout />}>
<Route index element={<Navigate to="general" replace />} />
<Route path="general" element={<GeneralSettings />} />
<Route path="agents" element={<AgentSettings />} />
<Route path="mcp" element={<McpSettings />} />
</Route>
<Route
path="/mcp-servers"
element={<Navigate to="/settings/mcp" replace />}
/>
<Route
path="/projects/:projectId/tasks/:taskId"
element={<ProjectTasks />}
/>
<Route
path="/projects/:projectId/tasks/:taskId/attempts/:attemptId"
element={<ProjectTasks />}
/>
<Route element={<NormalLayout />}>
<Route path="/" element={<Projects />} />
<Route path="/projects" element={<Projects />} />
<Route path="/projects/:projectId" element={<Projects />} />
<Route
path="/projects/:projectId/tasks"
element={<ProjectTasks />}
/>
<Route path="/settings/*" element={<SettingsLayout />}>
<Route index element={<Navigate to="general" replace />} />
<Route path="general" element={<GeneralSettings />} />
<Route path="agents" element={<AgentSettings />} />
<Route path="mcp" element={<McpSettings />} />
</Route>
</SentryRoutes>
</div>
<ShortcutsHelp />
</SearchProvider>
</AppWithStyleOverride>
<Route
path="/mcp-servers"
element={<Navigate to="/settings/mcp" replace />}
/>
<Route
path="/projects/:projectId/tasks/:taskId"
element={<ProjectTasks />}
/>
<Route
path="/projects/:projectId/tasks/:taskId/attempts/:attemptId"
element={<ProjectTasks />}
/>
</Route>
</SentryRoutes>
</div>
<ShortcutsHelp />
</SearchProvider>
</ThemeProvider>
</I18nextProvider>
);

View File

@@ -5,4 +5,6 @@ export const paths = {
`/projects/${projectId}/tasks/${taskId}`,
attempt: (projectId: string, taskId: string, attemptId: string) =>
`/projects/${projectId}/tasks/${taskId}/attempts/${attemptId}`,
attemptFull: (projectId: string, taskId: string, attemptId: string) =>
`/projects/${projectId}/tasks/${taskId}/attempts/${attemptId}/full`,
};

View File

@@ -61,8 +61,6 @@ NiceModal.register('project-editor-selection', ProjectEditorSelectionDialog);
NiceModal.register('restore-logs', RestoreLogsDialog);
NiceModal.register('view-processes', ViewProcessesDialog);
NiceModal.register('create-attempt', CreateAttemptDialog);
// Install VS Code iframe keyboard bridge when running inside an iframe
import './vscode/bridge';
import {
useLocation,

View File

@@ -0,0 +1,77 @@
// VS Code webview integration - install keyboard/clipboard bridge
import '@/vscode/bridge';
import { useParams } from 'react-router-dom';
import { AppWithStyleOverride } from '@/utils/style-override';
import { WebviewContextMenu } from '@/vscode/ContextMenu';
import TaskAttemptPanel from '@/components/panels/TaskAttemptPanel';
import { useTaskAttempt } from '@/hooks/useTaskAttempt';
import { useProjectTasks } from '@/hooks/useProjectTasks';
import { ExecutionProcessesProvider } from '@/contexts/ExecutionProcessesContext';
import { ReviewProvider } from '@/contexts/ReviewProvider';
import { ClickedElementsProvider } from '@/contexts/ClickedElementsProvider';
export function FullAttemptLogsPage() {
const {
projectId = '',
taskId = '',
attemptId = '',
} = useParams<{
projectId: string;
taskId: string;
attemptId: string;
}>();
const { data: attempt } = useTaskAttempt(attemptId);
const { tasksById } = useProjectTasks(projectId);
const task = taskId ? (tasksById[taskId] ?? null) : null;
return (
<AppWithStyleOverride>
<div className="h-screen flex flex-col bg-muted">
<WebviewContextMenu />
<main className="flex-1 min-h-0">
{attempt ? (
<ClickedElementsProvider attempt={attempt}>
<ReviewProvider key={attempt.id}>
<ExecutionProcessesProvider
key={attempt.id}
attemptId={attempt.id}
>
<TaskAttemptPanel attempt={attempt} task={task}>
{({ logs, followUp }) => (
<div className="h-full flex flex-col">
<div className="flex-1 min-h-0 flex flex-col">
{logs}
</div>
<div className="border-t shrink-0">
<div className="mx-auto w-full max-w-[50rem]">
{followUp}
</div>
</div>
</div>
)}
</TaskAttemptPanel>
</ExecutionProcessesProvider>
</ReviewProvider>
</ClickedElementsProvider>
) : (
<TaskAttemptPanel attempt={attempt} task={task}>
{({ logs, followUp }) => (
<div className="h-full flex flex-col">
<div className="flex-1 min-h-0 flex flex-col">{logs}</div>
<div className="border-t shrink-0">
<div className="mx-auto w-full max-w-[50rem]">
{followUp}
</div>
</div>
</div>
)}
</TaskAttemptPanel>
)}
</main>
</div>
</AppWithStyleOverride>
);
}