Skip to content
Draft
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
20 changes: 0 additions & 20 deletions jest.config.ts

This file was deleted.

12,044 changes: 4,704 additions & 7,340 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@
"@primer/octicons-react": "^19.15.2",
"@primer/primitives": "^10.7.0",
"@primer/react": "^37.22.0",
"date-fns": "^4.1.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-is": "^19.1.0",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1",
"styled-components": "^5.3.11"
"remark-gfm": "^4.0.1"
},
"devDependencies": {
"@eslint/js": "^9.25.0",
Expand All @@ -40,8 +37,6 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^29.5.0",
"@types/lodash": "^4.17.17",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.4.1",
Expand All @@ -51,19 +46,13 @@
"eslint-plugin-react-refresh": "^0.4.19",
"gh-pages": "^6.3.0",
"globals": "^16.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^26.1.0",
"prettier": "^3.5.3",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.2",
"typescript": "~5.8.3",
"typescript-eslint": "^8.30.1",
"vite": "^6.3.5",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-svgr": "^4.3.0",
"vitest": "^3.1.4",
"workbox-window": "^7.3.0"
"vitest": "^3.1.4"
}
}
12 changes: 4 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,10 @@
clearSearchItems,
});

const avatarUrls = useMemo(() => {
// Prioritize cached avatar URLs if they exist, otherwise return empty array
// Only return non-empty arrays to prevent unnecessary re-renders
if (cachedAvatarUrls && cachedAvatarUrls.length > 0) {
return cachedAvatarUrls;
}
return [];
}, [cachedAvatarUrls]);
const avatarUrls = useMemo(
() => cachedAvatarUrls?.length > 0 ? cachedAvatarUrls : [],
[cachedAvatarUrls]
);

// Pure comparator for case-insensitive string sorting
const caseInsensitiveCompare = (a: string, b: string): number =>
Expand Down Expand Up @@ -219,7 +215,7 @@
// Skip initial loading in test environment
const isTestEnvironment = typeof window !== 'undefined' &&
(window.navigator?.userAgent?.includes('jsdom') ||
process.env.NODE_ENV === 'test' ||

Check failure on line 218 in src/App.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
import.meta.env?.MODE === 'test');

if (isTestEnvironment) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/LoadingIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Box, Avatar, Text } from '@primer/react';

interface LoadingIndicatorProps {
Expand All @@ -7,11 +6,11 @@ interface LoadingIndicatorProps {
currentUsername?: string;
}

export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
export const LoadingIndicator = ({
loadingProgress,
isLoading,
currentUsername,
}) => {
}: LoadingIndicatorProps) => {
if (!isLoading || !loadingProgress) {
return null;
}
Expand Down
40 changes: 0 additions & 40 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,46 +140,6 @@ export interface GitHubEvent {
created_at: string;
}

// Specific payload types for different GitHub event types
export interface PushEventPayload {
ref?: string;
size?: number;
distinct_size?: number;
commits?: Array<{
sha: string;
message: string;
author: { name: string; email: string };
}>;
}

export interface CreateEventPayload {
ref_type?: string;
ref?: string;
master_branch?: string;
description?: string;
}

export interface ForkEventPayload {
forkee?: {
full_name?: string;
html_url?: string;
};
}

export interface DeleteEventPayload {
ref_type?: string;
ref?: string;
}

export interface GollumEventPayload {
pages?: Array<{
page_name: string;
title: string;
action: string;
html_url: string;
}>;
}

// Context Types
export interface FormContextType {
username: string;
Expand Down
7 changes: 0 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ export const validateGitHubUsernameFormat = (
return { isValid: false, error: 'Username cannot be empty' };
}

if (trimmed.length < 1) {
return {
isValid: false,
error: 'Username must be at least 1 character long',
};
}

if (trimmed.length > 39) {
return {
isValid: false,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/__tests__/rawDataUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ describe('rawDataUtils', () => {
html_url: 'https://github.com/testuser',
},
},
} as any,
},
public: true,
created_at: '2025-10-29T17:13:21Z',
};
Expand All @@ -208,7 +208,7 @@ describe('rawDataUtils', () => {
expect(result?.html_url).toBe('https://github.com/elastic/kibana/pull/241173');
expect(result?.number).toBe(241173);
// Labels come from the pull_request object in the payload
expect(result?.labels).toEqual((mockPREvent.payload as any).pull_request.labels);
expect(result?.labels).toEqual(mockPREvent.payload.pull_request?.labels);
expect(result?.original).toEqual(mockPREvent.payload);
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/utils/rawDataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export const transformEventToItem = (event: GitHubEvent): GitHubItem | null => {
closed_at: issue.closed_at,
number: issue.number,
user: actorUser, // Use event actor instead of issue user
assignee: (payload as any).issue?.assignee || null, // Extract assignee from original payload
assignees: (payload as any).issue?.assignees || [],
assignee: issue.user || null,
assignees: [],
pull_request: issue.pull_request,
original: payload,
originalEventType: type,
};
} else if (type === 'PullRequestEvent' && payload.pull_request) {
const pr = payload.pull_request;
const payloadWithAction = payload as { action?: string; number?: number; labels?: any[] };
const payloadWithAction = payload as { action?: string; number?: number; labels?: Array<{ name: string; color?: string; description?: string }> };

// GitHub API changed format - pr object may only contain url, not full details
// Try to extract PR number from various sources
Expand Down
2 changes: 1 addition & 1 deletion src/views/__tests__/IssuesAndPRsList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { useState } from 'react';
import { ThemeProvider } from '@primer/react';
import IssuesAndPRsList from '../IssuesAndPRsList';
import { GitHubItem } from '../../types';
Expand All @@ -16,7 +17,6 @@ vi.mock('../../App', () => ({
// Mock useLocalStorage to use plain useState
vi.mock('../../hooks/useLocalStorage', () => ({
useLocalStorage: (_key: string, initial: unknown) => {
const { useState } = require('react');
return useState(initial);
},
}));
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/pwa-features.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ test.describe('GitVegas PWA Features', () => {
// Fetch the manifest
const manifestResponse = await page.request.get('/git-vegas/manifest.webmanifest');
const manifest = await manifestResponse.json();

// Check that icons array has required sizes
const iconSizes = manifest.icons.map((icon: any) => icon.sizes);
const iconSizes = manifest.icons.map((icon: { sizes: string }) => icon.sizes);
expect(iconSizes).toContain('192x192');
expect(iconSizes).toContain('512x512');
});
Expand All @@ -233,11 +233,11 @@ test.describe('GitVegas PWA Features', () => {
test('should handle background sync gracefully', async ({ page }) => {
// This test checks for background sync support
// Currently, this is a placeholder for future PWA features
const hasBackgroundSync = await page.evaluate(() => {

await page.evaluate(() => {
return 'serviceWorker' in navigator && 'sync' in navigator.serviceWorker;
});

// Background sync is not required for basic PWA functionality
// This test ensures the app doesn't break if background sync is not available
expect(true).toBeTruthy(); // Always pass for now
Expand Down
Loading