Skip to main content

How to Contribute

Contributions to Web XP are welcome! Whether you’re fixing bugs, adding features, or improving documentation, your help is appreciated.

Getting Started

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/web-xp.git
    cd web-xp
    
  3. Install dependencies:
    npm install
    
  4. Create a branch for your changes:
    git checkout -b feature/your-feature-name
    
  5. Make your changes and test them
  6. Commit your changes with a clear message
  7. Push to your fork:
    git push origin feature/your-feature-name
    
  8. Open a Pull Request on GitHub

Code Style Guidelines

Web XP uses ESLint and Prettier to maintain consistent code style.

Prettier Configuration

The project uses the following Prettier settings (.prettierrc):
{
  "trailingComma": "all",
  "singleQuote": true
}
Key rules:
  • Use single quotes for strings
  • Add trailing commas in objects and arrays
  • Let Prettier handle formatting automatically

ESLint Configuration

The project extends:
  • react-app - Standard React rules
  • plugin:prettier/recommended - Prettier integration

Running the Linter

Before committing, run the linter:
npm run lint
Fix any errors or warnings before submitting your PR.

Code Formatting

To ensure your code matches the project style:
  1. Use an editor with Prettier integration (VS Code, WebStorm, etc.)
  2. Enable format on save in your editor
  3. Or manually format before committing

Coding Standards

React Component Guidelines

Use functional components with hooks:
import React, { useState, useEffect } from 'react';

function MyComponent({ prop1, prop2 }) {
  const [state, setState] = useState(initialValue);
  
  useEffect(() => {
    // Effect logic
  }, [dependencies]);
  
  return (
    <div>{/* Component JSX */}</div>
  );
}

export default MyComponent;
Avoid class components unless absolutely necessary.

Styled Components

Use styled-components for all styling:
import styled from 'styled-components';

const Container = styled.div`
  display: flex;
  flex-direction: column;
  padding: 10px;
`;

function MyComponent() {
  return <Container>{/* Content */}</Container>;
}
Naming convention:
  • Use PascalCase for styled component names
  • Name components descriptively (e.g., Container, Header, Button)

File Organization

Component files:
  • Use .jsx extension for components
  • One component per file
  • Export default at the end
Directory structure:
  • Place new apps in src/WinXP/apps/
  • Place reusable components in src/components/
  • Place assets in src/assets/ organized by type

Import Order

Organize imports in this order:
  1. React imports
  2. Third-party library imports
  3. Local component imports
  4. Asset imports
  5. Style imports
import React, { useState } from 'react';
import styled from 'styled-components';
import useMouse from 'react-use/lib/useMouse';

import { MyComponent } from 'components';
import { ADD_APP } from './constants/actions';

import iconImage from 'assets/windowsIcons/icon.png';

Path Aliases

Use configured path aliases instead of relative imports:
// Good
import MyComponent from 'components/MyComponent';
import myIcon from 'assets/icons/myIcon.png';
import { useCustomHook } from 'hooks/useCustomHook';

// Avoid
import MyComponent from '../../components/MyComponent';
import myIcon from '../../../assets/icons/myIcon.png';

Pull Request Process

Before Submitting

  1. Test your changes thoroughly:
    npm start
    
    • Test in multiple browsers if possible
    • Test on different screen sizes
    • Check console for errors
  2. Run the linter:
    npm run lint
    
    Fix all errors and warnings
  3. Build the project:
    npm run build
    
    Ensure the build succeeds
  4. Review your changes:
    • Remove any console.log statements
    • Remove commented-out code
    • Check for accidental file inclusions

Pull Request Guidelines

Write a clear PR description:
  • What does this PR do?
  • Why is this change needed?
  • How does it work?
  • Are there any breaking changes?
  • Include screenshots for UI changes
Example PR description:
## Summary

Adds a new Calculator app to the desktop.

## Changes

- Created Calculator component in `src/WinXP/apps/Calculator/`
- Added Calculator to appSettings registry
- Added Calculator icon to desktop
- Implemented basic arithmetic operations

## Screenshots

[Screenshot of Calculator app]

## Testing

- Tested all arithmetic operations
- Tested keyboard input
- Tested window minimize/maximize/close
- Verified app appears in taskbar
Keep PRs focused:
  • One feature or fix per PR
  • Avoid mixing unrelated changes
  • Split large changes into multiple PRs
Respond to feedback:
  • Address reviewer comments promptly
  • Ask questions if feedback is unclear
  • Update your PR based on suggestions

Testing Changes

Manual Testing Checklist

When adding or modifying features, test:
  • Window operations:
    • Open, close, minimize, maximize
    • Drag and resize
    • Window focus and z-index
    • Taskbar button behavior
  • Icon interactions:
    • Single click to select
    • Double click to open
    • Drag-to-select (rubber band)
  • Start menu:
    • Menu opens and closes
    • Submenu navigation
    • App launches from menu
  • Power operations:
    • Log off dialog
    • Shutdown dialog
    • Cancel buttons work
  • Mobile compatibility:
    • Warning dialogs appear
    • Layout adapts to small screens

Browser Testing

Test in multiple browsers:
  • Chrome/Edge (Chromium)
  • Firefox
  • Safari (if on macOS)

Screen Size Testing

Test at different viewport sizes:
  • Desktop (1920x1080)
  • Laptop (1366x768)
  • Tablet (768x1024)
  • Mobile (375x667)

Reporting Bugs

If you find a bug:
  1. Check if it’s already reported in GitHub Issues
  2. Create a new issue with:
    • Clear description of the bug
    • Steps to reproduce
    • Expected behavior
    • Actual behavior
    • Screenshots if applicable
    • Browser and OS information

Feature Requests

To suggest a new feature:
  1. Check existing issues to avoid duplicates
  2. Create a new issue with:
    • Clear description of the feature
    • Why it would be useful
    • How it might work
    • Any design considerations

Questions?

If you have questions:
  • Open a GitHub Issue with the question label
  • Check the existing documentation
  • Review the source code for examples
By contributing to Web XP, you agree that your contributions will be licensed under the project’s license. Important: The Windows XP name, artwork, and trademark are property of Microsoft. This project is for educational purposes only.

Code of Conduct

Be respectful and constructive:
  • Be welcoming to newcomers
  • Provide helpful feedback
  • Focus on the code, not the person
  • Respect different opinions and approaches

Recognition

Contributors will be recognized in the project’s README or CONTRIBUTORS file. Thank you for contributing to Web XP!

Build docs developers (and LLMs) love