Skip to content

Commit 912498a

Browse files
authored
Merge pull request #51 from BUMETCS673/annotationsByJames
Adding annotations to my files
2 parents 3d8994a + bcf0bc2 commit 912498a

File tree

9 files changed

+113
-23
lines changed

9 files changed

+113
-23
lines changed

code/frontend/src/components/asideAndToggler/Aside.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import Location from './Location';
33
import Type from './Type';
44
import ThemeToggler from './themeToggler';
55

6-
/**
7-
* Aside container for filters + theme toggle.
8-
* Styling (border, bg, spacing) is applied by the Layout wrapper,
9-
* so this component just provides clean structure for filters and theme toggle.
10-
*/
6+
/*
7+
AI-generated code: 80% (tool: ChatGPT, modified and adapted,
8+
functions: Aside,
9+
classes: none,
10+
AI chat links: https://chatgpt.com/share/68cdcba0-1218-8006-87a6-66d632a41ec8 )
11+
Human code: 15% (functions: small structural edits, comments, import/casing fixes; classes: none)
12+
Framework-generated code: 5% (tool: Vite/React app template)
13+
*/
1114
export default function Aside() {
1215
return (
1316
<div className="d-flex flex-column gap-3" aria-label="Filters and theme">

code/frontend/src/components/asideAndToggler/Field.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { useState, useRef, useEffect } from 'react';
22
import { createPortal } from 'react-dom';
33

4-
/**
5-
* Field filter component used in the Aside panel.
6-
* Provides a dropdown for selecting job fields.
7-
*/
8-
4+
/*
5+
AI-generated code: 85% (tool: ChatGPT, modified and adapted,
6+
functions: Field (dropdown/popup, click-outside, portal/positioning),
7+
classes: none,
8+
AI chat links: https://chatgpt.com/share/68cdcba0-1218-8006-87a6-66d632a41ec8 )
9+
Human code: 10% (functions: minor tweaks, comments, import moves; classes: none)
10+
Framework-generated code: 5% (tool: Vite/React)
11+
*/
912
const FIELDS = ['Engineering', 'Product', 'Design', 'Data', 'Operations'];
1013

1114
interface FieldProps {

code/frontend/src/components/asideAndToggler/Location.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { useEffect, useRef, useState } from 'react';
22
import { createPortal } from 'react-dom';
33

4-
/**
5-
* Location filter component used in the Aside panel.
6-
* Clicking the button opens an inline input prompt.
7-
*/
4+
/*
5+
AI-generated code: 85% (tool: ChatGPT, modified and adapted,
6+
functions: Location (inline panel, later portal version, centering, close button, keyboard handling),
7+
classes: none,
8+
AI chat links: https://chatgpt.com/share/68cdcba0-1218-8006-87a6-66d632a41ec8 )
9+
Human code: 10% (functions: copy/fit tweaks, comments; classes: none)
10+
Framework-generated code: 5% (tool: Vite/React)
11+
*/
12+
813
interface LocationProps {
914
onChange?: (value: string | null) => void;
1015
}

code/frontend/src/components/asideAndToggler/Type.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { useEffect, useRef, useState } from 'react';
22
import { createPortal } from 'react-dom';
33

4-
/**
5-
* Type filter component used in the Aside panel.
6-
* Provides a dropdown for selecting job types (e.g., full-time, part-time).
7-
*/
4+
/*
5+
AI-generated code: 80% (tool: ChatGPT, modified and adapted,
6+
functions: Type (dropdown/popup variants, shorter fitted panel),
7+
classes: none,
8+
AI chat links: https://chatgpt.com/share/68cdcba0-1218-8006-87a6-66d632a41ec8 )
9+
Human code: 15% (functions: constraints, removing search, comments; classes: none)
10+
Framework-generated code: 5% (tool: Vite/React)
11+
*/
812

913
const TYPES = ['Full-time', 'Part-time', 'Contract', 'Internship'];
1014

code/frontend/src/components/asideAndToggler/themeToggler.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ import { useTheme } from '../../theme/ThemeContext';
22
import sunImage from '../../assets/sun.png';
33
import moonImage from '../../assets/moon.jpg';
44

5-
/**
6-
* Theme toggle button for switching between light and dark mode.
7-
* Updates global font/background colors and persists preference.
8-
*/
5+
/*
6+
AI-generated code: 80% (tool: ChatGPT, modified and adapted,
7+
functions: ThemeToggler,
8+
classes: none,
9+
AI chat links: https://chatgpt.com/share/68cdcba0-1218-8006-87a6-66d632a41ec8 )
10+
Human code: 15% (functions: casing/paths, comments; classes: none)
11+
Framework-generated code: 5% (tool: Vite/React)
12+
*/
13+
14+
// Theme toggle button component
915
export default function ThemeToggler() {
1016
const { theme, toggle } = useTheme();
1117

code/frontend/src/components/loginAndRegistration/LoginForm.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import React, { useState } from "react";
22
import { Link } from "react-router-dom"; // Link to navigate to Register page
33
import { isRequired, isEmail } from "./validation"; // keep path simple (no .ts extension)
44

5+
/*
6+
AI-generated code: ~70%
7+
- Tool: ChatGPT (link: https://chatgpt.com/share/68d43c9d-4d60-8006-a1a7-14ae49475a5a)
8+
- Modified and adapted by human
9+
- Functions/classes: LoginForm component structure, validation logic integration, JSX layout
10+
Human code: ~30%
11+
- Adjustments: added centering fixes, styled footer text, ensured responsive Bootstrap card
12+
- Functions/classes: final layout tweaks, style adjustments, props handling refinements
13+
Framework-generated code: 0%
14+
- (React/Bootstrap boilerplate is used but not auto-generated)
15+
*/
16+
17+
518
/**
619
* @typedef {Object} LoginValues
720
* @property {string} email

code/frontend/src/components/loginAndRegistration/RegisterForm.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ import React, { useState } from "react";
22
import { Link } from "react-router-dom"; // Link to navigate to Login page
33
import { isRequired, isEmail } from "./validation"; // keep path simple (no .ts extension)
44

5+
/*
6+
AI-generated code: ~65%
7+
- Tool: ChatGPT (link: https://chatgpt.com/share/68d43c9d-4d60-8006-a1a7-14ae49475a5a)
8+
- Modified and adapted by human
9+
- Functions/classes: RegisterForm component structure, validation integration, JSX layout
10+
Human code: ~35%
11+
- Adjustments: footer text "Already have an account?", fixed link targets, applied centering card layout
12+
- Functions/classes: human refinements for props, consistent styling with LoginForm
13+
Framework-generated code: 0%
14+
- (React/Bootstrap boilerplate is used but not auto-generated)
15+
*/
16+
517
type RegisterValues = { name: string; email: string; password: string };
618
type Props = {
719
onSubmit?: (values: RegisterValues) => void;

code/frontend/src/components/loginAndRegistration/validation.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
// Basic validation helpers shared by Login and Register forms
1+
/*
2+
AI-generated code: ~50%
3+
- Tool: ChatGPT (link: https://chatgpt.com/share/68d43c9d-4d60-8006-a1a7-14ae49475a5a)
4+
- Functions/classes: isRequired, isEmail utility functions suggested by AI
5+
Human code: ~50%
6+
- Adjustments: simplified regex validation, added doc comments, integration testing with forms
7+
Framework-generated code: 0%
8+
- (Plain TypeScript helpers, no framework generation)
9+
*/
210

11+
// Basic validation helpers shared by Login and Register forms
312
// Check that a value is not empty/whitespace
413
export const isRequired = (v: string) => v.trim().length > 0;
514

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module declarations for importing image assets in TypeScript/TSX files.
2+
// Without these, TypeScript may report errors like "Cannot find module '*.png'".
3+
4+
declare module '*.avif' {
5+
const src: string;
6+
export default src;
7+
}
8+
declare module '*.bmp' {
9+
const src: string;
10+
export default src;
11+
}
12+
declare module '*.gif' {
13+
const src: string;
14+
export default src;
15+
}
16+
declare module '*.jpg' {
17+
const src: string;
18+
export default src;
19+
}
20+
declare module '*.jpeg' {
21+
const src: string;
22+
export default src;
23+
}
24+
declare module '*.png' {
25+
const src: string;
26+
export default src;
27+
}
28+
declare module '*.webp' {
29+
const src: string;
30+
export default src;
31+
}
32+
declare module '*.svg' {
33+
const src: string;
34+
export default src;
35+
}

0 commit comments

Comments
 (0)