-
Notifications
You must be signed in to change notification settings - Fork 15k
Upgraded typing game, chat backend, and main index files #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@microsoft-github-policy-service agree |
TacticalReader
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of Changes: Pull Request #1516 – "Upgraded typing game, chat backend, and main index files"
Major Components Updated:
-
Typing Game (4-typing-game/solution/index.*):
- Improved CSS for layout, responsiveness, and design elements.
- HTML structure refactored for clarity and accessibility.
- JavaScript logic upgraded for better gameplay, flow, and feedback.
-
Chat Project Backend (9-chat-project/solution/backend/python/api.py, llm.py):
- API endpoints and chat logic streamlined for reliability.
- Refactored backend code: cleaner functions, improved modularity, possibly optimized or bug-fixed.
- LLM logic updated for better message handling and context tracking.
-
Core Files (index.css, index.html):
- UI/UX enhancements for landing page.
- Better styling, new elements, and structural changes.
Educational Content Improvements:
- Numerous assignment and README files (mainly for lessons/chapters) rewritten for clarity:
- More descriptive assignment instructions for HTML, CSS, and JavaScript basics.
- Enhanced rubrics—examples, structure, and expectations are clearer.
- Modernized assignment objectives (using Flexbox/Grid, semantic HTML, etc.).
Code Quality Observations:
- Added Font Awesome (icon library) for rich navigation and UI elements.
- Improved semantic HTML, accessibility features, and code comments.
- All changes appear non-breaking, focusing on enhancement without disrupting existing functionality.
Suggestions for Further Improvement:
- Test the updated game and chat app across browsers and devices to verify responsiveness.
- Consider adding automated tests (unit/smoke) for backend APIs if not present.
- Document new features in an updated README so contributors can utilize and extend easily.
- Ensure assignment examples align with modern standards and best practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Comprehensive UI/UX, accessibility, and backend refactors across multiple lesson projects. Key updates include adding theming, icons, richer layouts, expanded backend API with logging, and feature enhancements to the typing, banking, chat, and space game demos.
- Introduces extensive new HTML/CSS (navigation, dialogs, theming, responsiveness, a11y attributes).
- Adds backend robustness (LLM wrapper, health/test endpoints, logging) but also introduces security and HTML/JS integration issues.
- Refactors mini‑apps (typing game, space game, banking) with new logic; several structural and semantic regressions were introduced (invalid HTML, missing scripts, disabled input not re‑enabled, unsafe CORS, over‑permissive logging).
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| index.html | Added external fonts & analytics script modifications; introduced invalid placement of DOCTYPE and link plus malformed script content. |
| index.css | Large design system and component styles added; contains duplicated selectors. |
| for-teachers.md | Expanded educator instructions; minor redundancy in link text. |
| 9-chat-project/solution/frontend/index.html | Accessibility, theming, and UI controls added for chat app. |
| 9-chat-project/solution/backend/python/llm.py | Added logging, env validation, configurable model; potential sensitive prompt logging. |
| 9-chat-project/solution/backend/python/api.py | Added structured JSON endpoints and error handling; permissive CORS & debug enabled. |
| 8-code-editor/1-using-a-code-editor/README.md | Rewritten lesson content with expanded structure. |
| 7-bank-project/solution/styles.css | Full redesign with tokens, theming, responsiveness. |
| 7-bank-project/solution/index.html | Reworked SPA templates with accessibility and modal patterns. |
| 7-bank-project/solution/app.js | Major refactor: routing, state mgmt, formatting, currency/date utilities. |
| 6-space-game/solution/index.html | Rebuilt game shell with HUD, dialogs, controls; style tag misplacement. |
| 6-space-game/solution/app.js | Completely new game engine logic (loop, input, entities, scoring). |
| 6-space-game/2-drawing-to-canvas/solution/index.html | Enhanced themed page but removed script inclusion and missing closing body tag. |
| 6-space-game/2-drawing-to-canvas/solution/app.js | Refactored drawing helpers and enemy layout logic. |
| 4-typing-game/solution/index.js | Modernized typing game logic; missed re‑enabling disabled input on restart. |
| 4-typing-game/solution/index.html | Added icons, duplicate body content and inline date/time script causing structural issues. |
| 4-typing-game/solution/index.css | Full new UI styling layer. |
| 3-terrarium/solution/style.css | Added navigation, footer, responsive enhancements. |
| 3-terrarium/solution/index.html | Added nav, header/footer; potential invalid Font Awesome icon usage. |
| Multiple assignment *.md files | Expanded and clarified assignment instructions and rubrics. |
Comments suppressed due to low confidence (1)
4-typing-game/solution/index.js:1
- After finishing a round the input is disabled (line 72), but startGame does not re-enable it; subsequent starts will fail. Add
typedValueElement.disabled = false;at the beginning of startGame.
// Typing Game - Modern ES6+ Version
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <!-- Add Google Fonts --> | ||
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet"><!DOCTYPE html> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DOCTYPE must be the very first element in the document, and the element belongs inside . Also the DOCTYPE is appended to the end of the tag on the same line, which is invalid. Move to the top (line 1) and relocate the into the section on its own line.
| (function(c,l,a,r,i,t,y){ <!-- Add Font Awesome --> | ||
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML comments and a tag have been inserted inside a <script> block, breaking the JavaScript IIFE and resulting in a syntax/runtime error. Remove the HTML comment and move the <link rel="stylesheet" ...> element into (outside the <script>).
| body { | ||
| font-family: 'Inter', Arial, sans-serif; | ||
| } | ||
| /* Body and Typography */ | ||
| body { | ||
| font-family: 'Inter', Arial, sans-serif; | ||
| background: #f7f8fa; | ||
| color: #222; | ||
| margin: 0; | ||
| padding: 0; | ||
| } |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate body selectors (lines 4–6 and 8–14) repeat the font-family declaration. Remove the first block or consolidate into a single body rule to avoid confusion.
| .app-nav ul li { | ||
| width: max-content; | ||
| } |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate .app-nav ul li rule appears twice; keep a single definition to reduce redundancy.
| .app-nav ul li { | ||
| width: max-content; | ||
| } | ||
|
|
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate .app-nav ul li rule appears twice; keep a single definition to reduce redundancy.
| .app-nav ul li { | |
| width: max-content; | |
| } |
| <i class="fa-solid fa-star"></i> Score: <span id="score">0</span> | ||
| <i class="fa-solid fa-heart"></i> Lives: <span id="lives">3</span> | ||
| </div> | ||
| <canvas id="canvas" width="1024" height="768"></canvas> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The closing tag is missing and the original <script src="app.js"></script> was removed, so the game logic will not run. Reintroduce the script tag before and add a proper closing tag.
| <canvas id="canvas" width="1024" height="768"></canvas> | |
| <canvas id="canvas" width="1024" height="768"></canvas> | |
| <script src="app.js"></script> | |
| </body> |
| <!-- ...existing code... --> | ||
| <body> | ||
| <h1> | ||
| <i class="fas fa-keyboard"></i> Practice your typing | ||
| </h1> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second tag and duplicate heading/content are nested inside the existing body, creating invalid HTML and duplicated UI. Remove the duplicate block and consolidate the datetime section into the original structure.
| <script> | ||
| // ...existing code... | ||
|
|
||
| function updateDateTime() { |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline script logic duplicates functionality and is embedded after the main script include; prefer moving this datetime script into a separate JS module or the existing index.js to keep behavior consolidated and avoid scattered inline code.
| setInterval(updateDateTime, 60000); | ||
|
|
||
| // ...existing code... | ||
| </script> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline script logic duplicates functionality and is embedded after the main script include; prefer moving this datetime script into a separate JS module or the existing index.js to keep behavior consolidated and avoid scattered inline code.
| <div id="page"> | ||
| <h1>My Terrarium</h1> | ||
| <header> | ||
| <h1><i class="fas fa-jar"></i> My Terrarium</h1> |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The icon class 'fa-jar' may not exist in the loaded Font Awesome version (could render as a missing icon). Verify the icon name (e.g., 'fa-jar-wheat' or another available icon) or remove it to avoid broken UI.
| <h1><i class="fas fa-jar"></i> My Terrarium</h1> | |
| <h1><i class="fas fa-seedling"></i> My Terrarium</h1> |
Upgraded typing game, chat backend, and main index files
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Fixes # (issue)
Type of change