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
12 changes: 3 additions & 9 deletions .github/workflows/docker-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ name: Docker E2E Tests

on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
docker-e2e-tests:
name: "Docker E2E Tests"
runs-on: ubuntu-latest
runs-on: self-hosted

strategy:
matrix:
Expand Down Expand Up @@ -61,7 +55,7 @@ jobs:

docker-test-summary:
name: "Docker Test Summary"
runs-on: ubuntu-latest
runs-on: self-hosted
needs: docker-e2e-tests
if: always()

Expand All @@ -81,7 +75,7 @@ jobs:
echo "With Claude CLI:" >> $GITHUB_STEP_SUMMARY
echo "- Installs Claude CLI via npm" >> $GITHUB_STEP_SUMMARY
echo "- Tests full integration capabilities" >> $GITHUB_STEP_SUMMARY
echo "- Runs comprehensive E2E test suite" >> $GITHUB_STEP_SUMMARY
echo "- Runs comprehensive test suite (E2E tests temporarily disabled)" >> $GITHUB_STEP_SUMMARY
echo "- Validates CLI detection and functionality" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Environment:" >> $GITHUB_STEP_SUMMARY
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
test-without-claude:
name: "Test Extension without Claude CLI"
runs-on: ubuntu-latest
runs-on: self-hosted

steps:
- name: Checkout code
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:

test-with-claude:
name: "Test Extension with Claude CLI"
runs-on: ubuntu-latest
runs-on: self-hosted
needs: test-without-claude

steps:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

test-report:
name: "Generate Test Report"
runs-on: ubuntu-latest
runs-on: self-hosted
needs: [test-without-claude, test-with-claude]
if: always()

Expand Down Expand Up @@ -116,4 +116,4 @@ jobs:
echo "- Main Window Loading Tests" >> $GITHUB_STEP_SUMMARY
echo "- Claude CLI Detection Tests" >> $GITHUB_STEP_SUMMARY
echo "- Claude CLI Integration Tests" >> $GITHUB_STEP_SUMMARY
echo "- End-to-End Workflow Tests" >> $GITHUB_STEP_SUMMARY
echo "- End-to-End Workflow Tests (temporarily disabled)" >> $GITHUB_STEP_SUMMARY
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ test-unit:

# Run end-to-end tests only
test-e2e:
@echo "🧪 Running end-to-end tests..."
@echo "🚫 End-to-end tests are temporarily disabled in CI pipelines"
@npm run test:e2e

# Run end-to-end tests manually (for development)
test-e2e-manual:
@echo "🧪 Running end-to-end tests manually..."
@npm run test:e2e:manual

# Run integration tests only
test-integration:
@echo "🧪 Running integration tests..."
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.4.1
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
testPathIgnorePatterns: [
"/node_modules/",
"/tests/unit/suite/", // Exclude VSCode extension tests (they use Mocha, not Jest)
"/tests/e2e/", // Exclude E2E tests (temporarily disabled in CI pipelines)
"/tests/integration/", // Exclude integration tests from unit test runs
],
transform: {
"^.+\\.(ts|tsx)$": [
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "claude-runner",
"displayName": "Claude Runner",
"description": "Execute Claude Code commands directly from VS Code with an intuitive interface",
"version": "0.4.0",
"version": "0.4.1",
"publisher": "Codingworkflow",
"private": false,
"license": "GPL-3.0",
Expand Down Expand Up @@ -238,16 +238,18 @@
"lint:fix": "eslint . --ext ts,tsx --fix --ignore-path .gitignore",
"test": "npm run test:unit",
"test:integration": "npm run compile-tests && node ./out/tests/unit/runTest.js",
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"test:unit:coverage": "jest --coverage",
"test:e2e": "jest --testPathPattern=tests/e2e --passWithNoTests",
"test:e2e:coverage": "jest --testPathPattern=tests/e2e --coverage",
"test:integration:coverage": "jest --testPathPattern=tests/integration --coverage",
"test:all": "npm run test:unit && npm run test:e2e && npm run test:integration",
"test:all:coverage": "jest --coverage --testPathPattern=\"(tests/e2e|tests/integration|src/test/services)\"",
"test:unit": "jest --testPathPattern=tests/unit",
"test:unit:watch": "jest --testPathPattern=tests/unit --watch",
"test:unit:coverage": "jest --testPathPattern=tests/unit --coverage",
"test:e2e": "echo 'E2E tests are temporarily disabled in CI pipelines'",
"test:e2e:manual": "jest --testPathPattern=tests/e2e --passWithNoTests",
"test:e2e:coverage": "echo 'E2E tests are temporarily disabled in CI pipelines'",
"test:e2e:coverage:manual": "jest --testPathPattern=tests/e2e --coverage",
"test:integration:coverage": "jest --testPathPattern=tests/integration --testPathIgnorePatterns=/node_modules/ --coverage",
"test:all": "npm run test:unit && npm run test:integration",
"test:all:coverage": "jest --coverage --testPathPattern=\"(tests/unit|tests/integration)\" --testPathIgnorePatterns=/node_modules/",
"test:ci:without-claude": "npm run test:unit",
"test:ci:with-claude": "npm run test:ci:without-claude && npm run test:e2e && npm run test:integration",
"test:ci:with-claude": "npm run test:ci:without-claude && npm run test:integration",
"test:watch": "npm run test -- --watch",
"clean": "rimraf dist out coverage *.vsix *.log",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
Expand Down
36 changes: 23 additions & 13 deletions src/components/common/ModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,44 @@ interface ModelSelectorProps {
model: string;
onUpdateModel: (model: string) => void;
disabled?: boolean;
hideLabel?: boolean;
}

const ModelSelector: React.FC<ModelSelectorProps> = ({
model,
onUpdateModel,
disabled = false,
hideLabel = false,
}) => {
const models = AVAILABLE_MODELS.map((m) => ({
value: m.id,
label: m.name,
}));

const selectElement = (
<select
id="model-select"
value={model}
onChange={(e) => onUpdateModel(e.target.value)}
className="model-select"
disabled={disabled}
>
{models.map((m) => (
<option key={m.value} value={m.value}>
{m.label}
</option>
))}
</select>
);

if (hideLabel) {
return selectElement;
}

return (
<div className="input-group">
<label htmlFor="model-select">Claude Model</label>
<select
id="model-select"
value={model}
onChange={(e) => onUpdateModel(e.target.value)}
className="model-select"
disabled={disabled}
>
{models.map((m) => (
<option key={m.value} value={m.value}>
{m.label}
</option>
))}
</select>
{selectElement}
</div>
);
};
Expand Down
85 changes: 51 additions & 34 deletions src/components/panels/ChatPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ disabled }) => {
setMessages((prev) => [...prev, userMessage]);
setInputMessage("");

// Set chatSending to true to show the spinner
actions.updateMainState({ chatSending: true });

try {
// Send to extension host - this will handle full conversation
actions.sendChatMessage(
Expand Down Expand Up @@ -109,9 +106,10 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ disabled }) => {
disabled={disabled}
/>

<Card title="Claude Chat">
<div className="chat-mode-selector">
<div className="button-group">
<Card>
<div className="task-header">
<h4>Chat</h4>
<div className="control-buttons">
<Button
variant={chatMode === "extension" ? "primary" : "secondary"}
onClick={() => setChatMode("extension")}
Expand All @@ -138,11 +136,15 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ disabled }) => {
</p>
</div>

<ModelSelector
model={main.model}
onUpdateModel={actions.updateModel}
disabled={disabled}
/>
<div className="input-group">
<label>Model</label>
<ModelSelector
model={main.model}
onUpdateModel={actions.updateModel}
disabled={disabled}
hideLabel={true}
/>
</div>

<Toggle
checked={main.allowAllTools}
Expand Down Expand Up @@ -202,11 +204,15 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ disabled }) => {
</div>
) : (
<div className="extension-chat">
<ModelSelector
model={main.model}
onUpdateModel={actions.updateModel}
disabled={disabled || main.chatSending}
/>
<div className="input-group">
<label>Model</label>
<ModelSelector
model={main.model}
onUpdateModel={actions.updateModel}
disabled={disabled || main.chatSending}
hideLabel={true}
/>
</div>

<div className="chat-container">
<div className="chat-messages">
Expand Down Expand Up @@ -261,24 +267,35 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ disabled }) => {
</Button>
</div>
<div className="chat-controls-right">
<Button
variant="primary"
onClick={handleSendMessage}
disabled={
(disabled ?? false) ||
(main.chatSending ?? false) ||
!inputMessage.trim()
}
>
{main.chatSending ? (
<>
<span className="loading-spinner" />
<span>Processing...</span>
</>
) : (
"Send"
)}
</Button>
{(main.chatSending ?? false) ||
(main.chatStopping ?? false) ? (
<Button
variant="secondary"
onClick={() => actions.stopChatGeneration()}
disabled={disabled ?? false}
>
{main.chatStopping ? (
<>
<span className="loading-spinner" />
<span>Stopping...</span>
</>
) : (
<>
<span className="stop-icon">●</span>
<span>Stop</span>
</>
)}
</Button>
) : (
<Button
variant="primary"
onClick={handleSendMessage}
disabled={(disabled ?? false) || !inputMessage.trim()}
>
<span className="send-icon">▶</span>
<span>Send</span>
</Button>
)}
</div>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion src/contexts/ExtensionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export interface MainViewState {
}>;
chatSessionId?: string;
chatSending?: boolean;
chatStopping?: boolean;

// Pause/Resume state
isPaused: boolean;
Expand Down Expand Up @@ -366,6 +367,7 @@ export interface ExtensionActions {

// Chat Actions
sendChatMessage: (message: string, isFirstMessage: boolean) => void;
stopChatGeneration: () => void;
clearChatSession: () => void;

// Commands View Actions
Expand Down Expand Up @@ -560,6 +562,10 @@ export const ExtensionProvider: React.FC<{ children: ReactNode }> = ({
sendMessage("sendChatMessage", { message, isFirstMessage });
},

stopChatGeneration: () => {
sendMessage("stopChatGeneration");
},

clearChatSession: () => {
sendMessage("clearChatSession");
},
Expand Down Expand Up @@ -747,7 +753,7 @@ export const ExtensionProvider: React.FC<{ children: ReactNode }> = ({
updates: {
chatMessages: message.chatMessages,
chatSessionId: message.sessionId,
chatSending: false,
chatSending: message.isStreaming ?? false,
},
});
}
Expand Down
Loading
Loading