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
162 changes: 162 additions & 0 deletions .agents/skills/testing-workspace-ide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Testing Workspace IDE

## Overview

This skill provides guidance for testing the Workspace IDE application, covering both unit tests with Vitest and end-to-end tests with Playwright.

## Dev Server Setup

```bash
cd Claude-OpenAI-Code
npm install
npm run dev
```

The app runs at `http://localhost:5173` (Vite dev server). Default state: Splits layout with 3 panes (Editor, Preview, Console).

---

## Unit Testing with Vitest

### Setup

```bash
# Install Vitest (if not already installed)
npm install -D vitest @testing-library/react @testing-library/jest-dom jsdom

# Add test script to package.json
# "test": "vitest",
# "test:coverage": "vitest --coverage"
```

### Configuration

Create `vitest.config.ts` at the project root:

```typescript
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
include: ['src/**/*.{test,spec}.{ts,tsx}'],
},
});
```

### Writing Tests

```typescript
// src/components/layout/__tests__/TopBar.test.tsx
import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { TopBar } from '../TopBar';

describe('TopBar', () => {
it('renders the workspace tabs', () => {
render(<TopBar />);
expect(screen.getByRole('tablist')).toBeInTheDocument();
});
});
```

### Running Tests

```bash
npm run test # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npx vitest run # Run tests once (CI mode)
```

---

## E2E Testing with Playwright

### Setup

```bash
# Install Playwright
npm install -D @playwright/test
npx playwright install chromium
```

### Configuration

Create `playwright.config.ts` at the project root:

```typescript
import { defineConfig } from '@playwright/test';

export default defineConfig({
testDir: './e2e',
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
webServer: {
command: 'npm run dev',
port: 5173,
reuseExistingServer: !process.env.CI,
},
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
},
});
```

### Writing E2E Tests

```typescript
// e2e/workspace.spec.ts
import { test, expect } from '@playwright/test';

test('workspace loads with default layout', async ({ page }) => {
await page.goto('/');
await expect(page.locator('#root')).toBeVisible();
});

test('can switch layout modes', async ({ page }) => {
await page.goto('/');
// Click layout selector
// Verify layout changes
});

test('global search opens with Ctrl+K', async ({ page }) => {
await page.goto('/');
await page.keyboard.press('Control+k');
// Verify search modal is visible
});
```

### Running E2E Tests

```bash
npx playwright test # Run all E2E tests
npx playwright test --headed # Run with browser visible
npx playwright test --ui # Open Playwright UI
npx playwright show-report # View test report
```

---

## Key UI Elements to Test

| Element | Location | What to Verify |
|---------|----------|---------------|
| **LayoutSelector** | TopBar, top-right | Dropdown opens, layout name updates |
| **File Tree** | Left sidebar | Files list, context menu, CRUD operations |
| **Tools Dock** | Bottom toolbar | Tool buttons open correct panes |
| **Search Bar** | Ctrl+K modal | Opens/closes, shows results |
| **Resources Panel** | Bottom sidebar | Shows RAM, CPU, Storage bars |
| **Spotlight** | Click project name | Settings page opens |
| **Pane Options** | Three dots icon | Split, maximize, float options |

## Tips

- No authentication required — the app runs fully locally.
- CI runs build check via GitHub Actions. No automated test suite exists by default.
- The app uses Zustand for state management. Layout state is in `workspaceStore` under `kittyLayout`.
- Layout modes: Stack, Tall, Fat, Grid, Splits, Horizontal, Vertical.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default code owners for the repository
* @ATC-O48
2 changes: 1 addition & 1 deletion .github/Funding.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [ATC-O48]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
91 changes: 91 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Bug Report
description: Report a bug or unexpected behavior in Workspace IDE.
labels:
- "bug"
- "triage"
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug! Please fill out the form below to help us investigate.

- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Open the IDE in browser
2. Click on '...'
3. Scroll down to '...'
4. See error
validations:
required: true

- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true

- type: textarea
id: actual_behavior
attributes:
label: Actual Behavior
description: A clear and concise description of what actually happened.
validations:
required: true

- type: dropdown
id: os
attributes:
label: Operating System
options:
- Windows
- macOS
- Linux
- Other
validations:
required: true

- type: dropdown
id: browser
attributes:
label: Browser
options:
- Chrome
- Firefox
- Safari
- Edge
- Other
validations:
required: true

- type: input
id: node_version
attributes:
label: Node.js Version
description: Run `node --version` to find out.
placeholder: "v18.x.x"

- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain the problem.

- type: textarea
id: additional_context
attributes:
label: Additional Context
description: Add any other context about the problem here (console errors, logs, etc.).
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discussions
url: https://github.com/ATC-O48/Claude-OpenAI-Code/discussions
about: Ask questions, share ideas, and connect with the community.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Feature Request
description: Suggest a new feature or improvement for Workspace IDE.
labels:
- "enhancement"
- "triage"
body:
- type: markdown
attributes:
value: |
Thank you for suggesting a feature! Please fill out the form below so we can understand your request.

- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of the feature you'd like.
validations:
required: true

- type: textarea
id: use_case
attributes:
label: Use Case
description: Describe the problem or workflow this feature would address.
placeholder: "As a developer, I want to ... so that ..."
validations:
required: true

- type: textarea
id: proposed_solution
attributes:
label: Proposed Solution
description: Describe how you think this feature should work.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Describe any alternative solutions or features you've considered.

- type: textarea
id: additional_context
attributes:
label: Additional Context
description: Add any other context, mockups, or screenshots about the feature request.
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Description

<!-- Provide a brief description of your changes. -->

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement

## Testing

<!-- Describe the tests you ran and how to reproduce them. -->

- [ ] Tested locally with `npm run dev`
- [ ] Verified in Chrome
- [ ] Verified in Firefox (if applicable)

## Screenshots

<!-- If applicable, add screenshots to show your changes. -->

## Checklist

- [ ] My code follows the project's code style
- [ ] I have run `npm run lint` with no errors
- [ ] I have run `npm run build` successfully
- [ ] I have added/updated documentation as needed
- [ ] My changes do not introduce new warnings
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build:
name: Lint, Type-check & Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20, 22]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Type-check
run: npx tsc --noEmit

- name: Build
run: npm run build
Loading
Loading